hi everyone! is it possible that, when using hybri...
# community-help
d
hi everyone! is it possible that, when using hybrid search, I've a facet that counts 80 results and when I add it as a filter I get 120 results? It's very strange!
k
With a filter added, the actual tokens that match the query for keyword search can change and this can fetch a different set of results. Take a look at
max_candidates
.
d
Thank you for your answer! It seems that the parameter doesn't affect the search and the facets results! I always have more results with active filter than on the facet without the active filter!
k
Does the same happen with only keyword search or only vector search?
d
only when using vector search both with hybrid search
Copy code
query_by: 'embedding,title,content',
vector_query: 'embedding:([], alpha: 0.5, distance_threshold: 0.8, k: 200)',
and with vector only
Copy code
query_by: 'embedding',
vector_query: 'embedding:([], alpha: 1, distance_threshold: 2, k: 200)',
k
I suspect that when filtering is added, the approximate knn search on the graph takes a different search path which unearths more candidates.
d
Oh yes I agree with you! I think that this behaviour may occur beacuse filtering is done before the knn search so that knn is done on a different dataset. I think that filtering has to be done after the knn search to remove unmatched documents. Is it possible?
k
Filtering is done along with the knn search. But when search takes a wider path, more candidates could be picked because a larger portion of the graph is traversed. You can try setting a larger M value for the hnsw index construction to mitigate this.