Hello ! New question here, we have many people who...
# community-help
g
Hello ! New question here, we have many people who type a query followed with the city or country, like in Google, do we have any ways to chunk and "understand" the query sothat we can refine the query param based on the query string ? What's the goto solution for this kind of usage ?
f
You want to look into curation. But the queries have to be hand-written when defining the override. Dynamic filtering will be helpful if you have the country defined as a field in your document
g
Thanks, so basically I need a way to find a tokenizer that would produce something {city} and then that would be detected by the dynamic filter. Does a filter can work with regexp ?
f
No, only with the prefix character
*
g
So
* {city}
would match anything ending with a city ?
• best sushi paris → paris = city • cheap restaurants lyon → lyon = city • pizza marseille → marseille = city • tapas bar barcelona → barcelona = city • breakfast nice → nice = city • where to eat toulouse → toulouse = city • rooftop dinner bordeaux → bordeaux = city • gastronomic restaurant lille → lille = city • indian food nantes → nantes = city • vegan lunch montpellier → montpellier = city
f
The prefix is only part of Filtering, not on curation overrides
g
Not sure how I get it
What would be the solution for the example provided ?
f
Create overrides for each query like:
best sushi {city}
etc
g
I have an infinite number
I just now that people will finish with the city
f
Just
{city}
in a
contains
override will work then. But what do you intend to do with it? Filter by that city automatically?
g
yes
a
contain
? what is this ? sorry
f
https://typesense.org/docs/28.0/api/curation.html#dynamic-filtering The rule's
match
parameter can either be
contains
or
exact
g
I don’t get it. I only know that the final word might be a city
It might not be a city
Thanks for your help
f
The syntax basically says that if ANY word in the query has a city name inside it, then you can filter by that city name