Llamaindex vector store query empty response

I have followed the link given below and created a vector store on Couchbase server using llamaindex. The indexing is working properly. I can see the documents getting processed on Couchbase UI. However, when I query the same using llamaindex query, I always get empty response. What could be the issue?

https://docs.llamaindex.ai/en/stable/examples/vector_stores/CouchbaseVectorStoreDemo/

Hi @jithinmukundan - What query are you using? What data?

I am loading some random pdf files as mentioned in the documentation link. Indexing is working, i can see the documents in Couchbase UI. However, the following query always returns empty response

query_engine = index.as_query_engine()
response = query_engine.query(“What is xyz?”)
print(response)

I also tried the following

vector_search = VectorSearch.from_vector_query(VectorQuery(‘vector_field’,vector))
request = search.SearchRequest.create(vector_search)
result = cluster.search(‘vector-index’, request)
for row in result.rows():
print(row)

But getting the following error
couchbase.exceptions.QueryIndexNotFoundException: QueryIndexNotFoundException(<ec=17, category=couchbase.common, message=index_not_found (17), context=SearchErrorContext({‘last_dispatched_to’: ‘172.23.113.134:8094’, ‘last_dispatched_from’: ‘172.23.113.133:51908’, ‘retry_attempts’: 0, ‘client_context_id’: ‘852c75-0c3e-6147-fcf0-bc3a2644c6defb’, ‘method’: ‘POST’, ‘path’: ‘/api/index/vector-index/query’, ‘http_status’: 400, ‘http_body’: ‘{“error”:“rest_auth: preparePerms, err: index not found”,“request”:{“ctl”:{“timeout”:75000},“explain”:false,“knn”:[{“field”:“vector_field”,“k”:3,“vector”:[-0.010490856133401394,-0.040347788482904434,0.03652790188789368]}],“query”:{“match_none”:null},“showrequest”:false},“status”:“fail”}\n’, ‘index_name’: ‘vector-index’, ‘query’: ‘{“match_none”: null}’, ‘parameters’: ‘{“ctl”:{“timeout”:75000},“explain”:false,“knn”:[{“field”:“vector_field”,“k”:3,“vector”:[-0.010490856133401394,-0.040347788482904434,0.03652790188789368]}],“query”:{“match_none”:null},“showrequest”:false}’, ‘context_type’: ‘SearchErrorContext’}), C Source=/couchbase-python-client/src/search.cxx:552>)

How did you create “vector-index”? Can you post a screen-shot of it in the web-ui?

I imported the json as mentioned in the link. Please see the screenshot and json below.

{
“type”: “fulltext-index”,
“name”: “test._default.vector-index”,
“uuid”: “408dc416c89385ea”,
“sourceType”: “gocbcore”,
“sourceName”: “test”,
“sourceUUID”: “9ca791954bfd966176bcc174562e6747”,
“planParams”: {
“maxPartitionsPerPIndex”: 103,
“indexPartitions”: 10
},
“params”: {
“doc_config”: {
“docid_prefix_delim”: “”,
“docid_regexp”: “”,
“mode”: “type_field”,
“type_field”: “type”
},
“mapping”: {
“analysis”: {},
“default_analyzer”: “standard”,
“default_datetime_parser”: “dateTimeOptional”,
“default_field”: “_all”,
“default_mapping”: {
“dynamic”: true,
“enabled”: true,
“properties”: {
“embedding”: {
“dynamic”: false,
“enabled”: true,
“fields”: [
{
“dims”: 1536,
“index”: true,
“name”: “embedding”,
“similarity”: “dot_product”,
“type”: “vector”,
“vector_index_optimized_for”: “recall”
}
]
},
“metadata”: {
“dynamic”: true,
“enabled”: true
},
“text”: {
“dynamic”: false,
“enabled”: true,
“fields”: [
{
“index”: true,
“name”: “text”,
“store”: true,
“type”: “text”
}
]
}
}
},
“default_type”: “_default”,
“docvalues_dynamic”: false,
“index_dynamic”: true,
“store_dynamic”: true,
“type_field”: “_type”
},
“store”: {
“indexType”: “scorch”,
“segmentVersion”: 16
}
},
“sourceParams”: {}
}

@jithinmukundan What embedding model do you use? Specifically, does it have the same dimensions as in the index definition (1536)?
If that is not the case, you can end up with not getting any results.

1 Like

Yes, this was the issue. The embedding model I use has a dimension of 1024. I updated this in the json and now it is working perfectly. Thanks a lot.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.