Rajaie
02/13/2025, 8:00 AMtitle:`hello world` || title:`foo bar`
When I try that now, I get back documents with title like hello welcome to my world
But I only want documents like
• hello world
• introduction hello world welcome
• welcome to hello world
If if it's not possible, how would I achieve the above? I know I could do q="hello world"
and query_by:title
, but then I can't do the ||
Fanis Tharropoulos
02/13/2025, 8:54 AM:=
. That way, you won't get results back that don't match the exact string. You can use this in conjunction with prefix filtering to add the star at the end of the filter string :=hello world*
to find matches that start with that. Although, there's no postfix filtering to get results for welcome to my world
for example. I'd also advise taking a look at the newly added Union feature for federated / multi search to concat the tuple of results into a single one, so you can send as many search requests as the OR operands in the filter_by clause you had
https://github.com/typesense/typesense-website/blob/v28.0/docs-site/content/28.0/api/federated-multi-search.md#union-searchRajaie
02/13/2025, 9:07 AM:=
, but that wouldn't give me results where hello world
is just a part of the title. The prefix filtering would give me half what I need, but I'd still be missing the postfix filtering as you suggested. Essentially I need something like title:=*hello world
.*
I came across multi-search and think it can satisfy my use case if I do something like
searches: [
{q: '"hello world"'}, {q: '"foo bar"'}
]
But I would have to manage pagination and offsets on the client side due to this, so I was hoping I could achieve what I wanted using the native filter_by
functionalityRajaie
02/13/2025, 9:11 AMFanis Tharropoulos
02/13/2025, 12:22 PMRajaie
02/13/2025, 2:51 PMtitle:`hello world` || title:`foo bar`
any ideas on how I'd be able to implement something like this though?
(title:`hello world` || title:`foo bar`) && (description:`hello world` || description:`foo bar`)
Multi-search seems to be acting as an OR, but in this case we also want to AND two results. Would the only solution here to be manually union (client side) the results of the left and right?