#community-help

Combining and Sorting Search Results from Two Collections

TLDR Toyin asked about combining and sorting search results from two collections. Kishore Nallan confirmed that text_match could be used for this purpose.

Powered by Struct AI
3
30mo
Solved
Join the chat
Jun 12, 2021 (30 months ago)
Toyin
Photo of md5-48f64f1dbc5721f6757a3564febfa030
Toyin
07:31 AM
hi, i've got a question about "_text_match" and trying to combine search results from two collections that are in a federated search.

i'm doing a federated search of two different collections and i get the data back listed as results from collection1 and then results from collection2. i'm trying to avoid combining them into one collection at the moment, so i thought maybe if i put the results together, i could get the value of _text_match from all the results and programmatically sort the results of the federated search that way
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
07:50 AM
Yes text_match is exposed as a field in the results.
Toyin
Photo of md5-48f64f1dbc5721f6757a3564febfa030
Toyin
09:38 PM
Thanks!