TLDR Roman asked if there was a way to prioritize searches in 'foo' over 'bar' in Typesense. Jason clarified that only sequential searches would satisfy this. Yoann suggested batching the requests.
Hi all, say I have `query_by=foo,bar`, is there a way to first evaluate search against `foo` *only* first and if nothing is found there (and only then), query `bar` field?
This is how Typesense's default search mechanism works by default... Fields mentioned in query_by are used in priority order
I mean not include stuff matched by `bar` at all if there are any matches in `foo`
That's not possible to do out of the box. So you would have to first send a search query with just `query_by=foo` and then depending on the results, conditionally send another search request for `query_by=bar`
I see, thank you
You could probably batch the two requests in a multi-search
Indexed 3051 threads
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI