Hello <@U01PL2YSG8L> <@U01NZ4D0LDD> <@U076GF3T0HY>...
# community-help
u
Hello @Kishore Nallan @Jason Bosco @Fanis Tharropoulos I have one scenario. In which I have 2 terms. Suppose, 1. Spare parts 2. BMW X3 Now, there is a field in my typesense collection named as "text". Now I want only those results which contain exactly the above 2 terms anywhere in the text. So currently I tried something like this, q = * query_by = text include_fields = text filter_by = text: Spare parts && text: BMW X3 But it doesn't consider the exact texts, but does a word-level partial match on the text field, without taking the token position into account. So, how can we achieve this ?
f
Let's say you have a document with a text value of "spare parts for a bmw x3 from 2005". What you can do is
filter_by=text:*spare parts* && text:*bmw x3*
u
Yes
f
This query will match that document. Any document that includes those tokens in it
u
Yes. But I want to find these exact query terms in text. We can perform with single term in "q", but I want to do it with multiple query terms.
f
q
only supports phrase matching across continuous tokens. The filter_by I posted will find those as well , just not highlight them
u
The filter_by you suggested is also not performing matching in the exact order of tokens. I want to do phrase matching across the continuous tokens with multiple queries in a single request.
f
You can use exact match search when enclosing the query in
"
marks. e.g.
"spare parts bmw x3"