Typesense supports the multi query like query1 &am...
# community-help
a
Typesense supports the multi query like query1 & query2 & query3...?
k
In filter_by clause? Can you please elaborate with an example?
a
client.multiSearch.perform({ 'searches': [ { 'q': 'North Carolina', 'query_by': 'state_name', }, { 'q': 'Sanford', 'query_by': 'city', } ] }, queryParams: { 'collection': 'report_header' }).then((values) { values.entries.forEach((element) { print(element); }); }).catchError((error) { print(error); });;
k
Got it. No, the queries in multi_search are executed in-parallel independently. There's no way to do an AND of them.
a
I want to get results where state_name='North Carolina' and city='Sanford' like sql query
k
For that you can set
q=*
and use the
filter_by
clause which supports the
&&
operator.
a
Thanks
yw 1
k
state_name: North Carolina && city: Sandord
will work
❤️ 1
a
Filter can include regular expression? for example , state_name: Nort && city: san result state: North city: Sanford
I want to get all results that String.contains(query String)
k
Filter does not support regexp. Filtering by default already works in contains mode.
a
{ 'q': 'North', 'query_by': 'order.appointment_address.state_name', 'filter_by': 'order.appointment_address.city: Sanfor', },
it is not working
'filter_by': 'order.appointment_address.city: Sanford',
This is working correclty
k
Filter does not do prefix search. When I mean by string contains, I mean at the word level not char level
a
Then, How can I do multi prefix search?
k
That's not possible.
Did you try
q=North Carolina Sanford
with
query_by=state_name,city
?
a
Then, result is query1 || query2
I want query1 && query2
k
If there is a record that contains all words
North Carolina Sanford
then that record will be returned first. That's not enough?