Hey everyone We have 2 different collections we're...
# community-help
s
Hey everyone We have 2 different collections we're querying at the same time using multi_search. One collection has product info and the other has page info( all webpages of the site added to typesense with a web scraper). When a user searches for lets say "Software Help", an exact match for the page exists in pageinfo but not in productinfo. However, when a user searches for lets say "Apple iPhone 15", an exact match for this exists in productinfo but not in pageinfo. How do we define criteria for an exact match so that when it happens we can highlight that category of results(pageinfo or productinfo). So, we show both productinfo and pageinfo on the results page in their own sections with productinfo usually shown before pageinfo( 4 results only with a show all button redirecting to another page), but when an exact match for pageinfo is found, then we show pageinfo results first and subsequently the productinfo section.
f
You could check out the text_match_score of the first result for each, and depending on that, rearrange the collection order on the client
s
I could do that yes. However, I want productinfo to have priority everytime unless the top pageinfo result is not just more relevant than the top productinfo result, but most likely there's an exact page with the same title.
f
Even keeping track of the
q
parameter and checking if the first page result has a title that is matching the
q
parameter exactly could work then