Thanks for the reply, Raju!
Yes, I am able to connect to a bucket but the issue lies upon using the cluster object for search_query method (as shown above).
try:
print:(“Reached here”)
result = cluster.search_query(“index”, PrefixQuery(“airports-”), SearchOptions(fields=[“field-1”]))
for row in result.rows():
print("Score: {}".format(row.score()))
print("Document Id: {}".format(row.id()))
# Also print fields that are included in the query
print(row.fields())
The code snippet that you shared - is that supposed to be working?
Because I am getting below exception when upon iterating through result.
Ran it on couchbase playground.
<RC=0x41D[LCB_ERR_HTTP (1053)], HTTP Request failed. Examine 'objextra' for full result, Results=1, C Source=(src/pycbc_http.c,206), OBJ=ViewResult<rc=0x41D[LCB_ERR_HTTP (1053)], value={'error': 'rest_auth: preparePerms, err: index not found', 'request': {'ctl': {'timeout': 75000}, 'indexName': 'index', 'query': {'prefix': 'airports-'}}, 'status': 'fail'}, http_status=0, tracing_context=0, tracing_output=None>, Context={'http_response_code': 400, 'error_message': 'rest_auth: preparePerms, err: index not found', 'index_name': 'index', 'query': '', 'params': '', 'http_response_body': '', 'endpoint': '127.0.0.1:8094', 'type': 'SearchErrorContext'}, Tracing Output={":nokey:0": null}>