If there are certain fields that I donโ€™t want to c...
# community-help
a
If there are certain fields that I donโ€™t want to cater for fuzzy searching such as itinerary numbers, what is the recommended approach?
k
The
num_typos
argument applies to all fields being searched upon. There is no way to control this behavior at a per-field level.
g
right but you can use a facet right?
for fields that you only want to match exactly
j
True, you'd then have to use filter_by to get to the exact record with the value.
But setting it as a facet, will not cause it to match exactly when the query is sent via the
q
search parameter
๐Ÿ‘ 1
a
This is going to be a problem for me as I need an exact match via the q search parameter
If you have a booking reference number or an itinerary number on every record, it does not make sense to treat it as a facet as it will be n facets
But you don't want to fuzzy search by a unique reference number
k
Right, I can see how that can be a problem: are you doing a search across multiple fields, some of which include such booking numbers?
a
Is there any plan to introduce per field typo tolerance? I think this is a must have for some search fields
k
Perhaps we should extend the
num_typos
syntax to support something like
num_typos: f1:2,f1:0
๐Ÿ‘ 1
a
Exactly Kishore
k
Can you please create an issue for this on Github? We will extend the num_typos to support that. I think it is certainly a must-have for certain search use cases.
a
I have multiple search fields, some of which should only have 1 match
Thanks! Iโ€™ll do that @Kishore Nallan
I have a hotel app
So even when you search by the arrival or departure dates you would not want to typo tolerance for those dates fields
By the way, for instantsearch is there a component that can have a date range input for a date field facet?
k
๐Ÿ‘
for instantsearch is there a component that can have a date range input for a date field facet
@Jason Bosco best placed to answer that.
a
In that case I can use that to solve the date search but still will raise an issue for the reference number
k
I think it is still an important feature to add.
a
I definitely agree ;)
Will raise the issue a little later
k
Thanks.
a
k
๐Ÿ‘
a
Thank you ๐Ÿ™๐Ÿผ
j
@Ashwin Mohan Ram To use dates with InstantSearch, the recommendation is to stores the dates as integer time stamps and then use the range slider: https://discourse.algolia.com/t/filter-by-days-months-since-against-date-field-with-instantsearch/6440/2