You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Faceted fields are indexed verbatim without any "normalization". So, the value USA is indexed as it is.
However, when a filter_by is performed on a string field, Typesense "normalizes" the string before searching for it. So, Typesense looks for usa (the normalized version of USA) and is not able to find the document. I'm going to call this a bug. Ideally, when a facet field is filtered upon, we should search verbatim instead of normalizing the filter_by value.
For now, as a work-around, you can create another string field that has a facet: false and filter on that.
…d of normalizing the filter_by value.
There was also a difference in the behavior between string and string array facet fields which is corrected in this PR.
Fixes#54
…d of normalizing the filter_by value.
There was also a difference in the behavior between string and string array facet fields which is corrected in this PR.
Fixes#54
Hi.
I'm experimenting typesense but I'm getting an unexpected behaviour.
Best,
Vinícius.
Description
Using the companies example, a query with filter_by country is returning empty if the field is facet. Is this the expected behavior?
Steps to reproduce
Companies example taken from here: https://typesense.org/0.9.2/api/
Query using filter_by:
localhost:8108/collections/companies/documents/search?q=stark&query_by=company_name&filter_by=country:USA
Expected Behavior
{"facet_counts":[1],"found":1,"hits":[{"document":{"company_name":"Stark Industries","country":"USA","id":"124","num_employees":5215},"highlights":[{"field":"company_name","snippet":"Stark Industries"}],"seq_id":0}],"page":1,"search_time_ms":0}
Actual Behavior
{"found":0,"hits":[],"page":1,"search_time_ms":0}
Metadata
Typsense Version: 0.92
OS: macOS 10.12.6
The text was updated successfully, but these errors were encountered: