qdrant-haystack icon indicating copy to clipboard operation
qdrant-haystack copied to clipboard

Add SearchParams to query_by_embedding

Open pandasar13 opened this issue 2 years ago • 0 comments

In qdrant you can pass hnsw_ef to the SearchParams to indicate the ef_search value. However,this feature is not present in qdrant-haystack.

My idea would be to add a parameter to the init in which you could optionally specify the ef_search , and if not specified then it simply uses the same value given to ef_construction.

It could be added to qdrant-haystack in the query_by_embedding function.

points = self.client.search(
            collection_name=index,
            query_vector=cast(list, query_emb.tolist()),
            query_filter=qdrant_filters,
            limit=top_k,
            with_vectors=return_embedding or True,
           
          #parameter to add
           search_params=rest.SearchParams(hnsw_ef=128, exact=False)
        )

Thehnsw_efand exact could be passed to the init as a dictionary. If not given they would default to the qdrant default.

pandasar13 avatar Nov 11 '23 11:11 pandasar13