Hi team, I’m using Typesense v0.29.0.rc28 and I’m ...
# community-help
v
Hi team, I’m using Typesense v0.29.0.rc28 and I’m seeing unexpected behavior with prefix filtering in
filter_by
. Here’s the curl request:
Copy code
curl --location '
https://192.168.0.75:8108/collections/ClientNameList/documents/search?q=*&filter_by=entityname:Zion*&per_page=250&max_filter_by_candidates=10000' \
--header 'x-typesense-api-key: ****************'
My
entityname
field is a string (example values:
ZionWorks9680
,
ZionWorks8912
, etc.). I know there are more than 4 matching records, but this query always returns exactly 4 results. Some context: • I'm using
q=*
and prefix filtering on
entityname
. • I already tried increasing
max_filter_by_candidates
, but no change. Any insights would be appreciated. Thanks!
f
Hey, could you provide a set of curl commands like this one for us to be able to debug? Without a sample dataset it's difficult to reproduce this
v
Hi , I have attached request with response
Hi @Fanis Tharropoulos Is there any update regarding prefix filtering?
f
I'm sorry, I've been away today. I've marked it to see it when I get back.
Hey @V Parthiban, It has to do with your
max_filter_by_candidates
value. By default, it's 4:
v
Hi @Fanis Tharropoulos even after passing max_filter_by_candidates i am geting only 4 results curl --location 'https://192.168.0.75:8108/collections/ClientNameList/documents/search?filter_by=entityname%3AZion*&%20max_filter_by_candidates=10&q=*' \ --header 'x-typesense-api-key: a4LUtneo7zwCO7fIP30nl2RRgJ3sq7hI' Response: { "facet_counts": [], "found": 4, "hits": [ { "document": { "SecGroup": [ "L1_FOMO", "L1_FOCHH" ], "Template": [ "Client Douments" ], "entityname": "ZionRealm9176", "id": "ZionRealm9176", "partycode": "CL98980" }, "highlight": {}, "highlights": [] }, { "document": { "SecGroup": [ "L1_FOMO", "L1_FOCHH" ], "Template": [ "Client Douments" ], "entityname": "ZionRealm9860", "id": "ZionRealm9860", "partycode": "CL98988" }, "highlight": {}, "highlights": [] }, { "document": { "SecGroup": [ "L1_FOMO", "L1_FOCHH" ], "Template": [ "Client Douments" ], "entityname": "ZionRealm9358", "id": "ZionRealm9358", "partycode": "CL98982" }, "highlight": {}, "highlights": [] }, { "document": { "SecGroup": [ "L1_FOMO", "L1_FOCHH" ], "Template": [ "Client Douments" ], "entityname": "ZionWorks992", "id": "ZionWorks992", "partycode": "CL100000" }, "highlight": {}, "highlights": [] } ], "out_of": 100094, "page": 1, "request_params": { "collection_name": "ClientNameList", "first_q": "*", "per_page": 10, "q": "*" }, "search_cutoff": false, "search_time_ms": 2 }
f
I debugged on an instance of Typesense running on the
28rc
build of
v29
, and on a test suite on the main Typesense repo. Could you provide a set of curl commands to create the collection, index a sample document set and then run the query? The one that wasn't matched at first was
ZionWorks8851
, but after adding
max_filter_by_candidates=5
, it worked as normal
v
Hi @Fanis Tharropoulos now its working for me max_filter_by_candidates there was some typo err Thanks, ok what is the max val for max_filter_by_candidates, i expect to return all matching documents
f
It's an unsigned long, so it's (2^32-1)
✅ 1
Unless you have more than 4 billion documents, put it somewhere around the maximum. Keep in mind, this will be more computationally intensive
✅ 1