typesense / typesense

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences
https://typesense.org
GNU General Public License v3.0
21.12k stars 650 forks source link

[Feature Request] Federated Search Then Aggregate Data #381

Open ice-ares opened 3 years ago

ice-ares commented 3 years ago

Description

Our app has a feature where we want to search for (query_by) some fields across multiple collections then aggregate the results of all those collections into a "Best Matches Globally" result with best hits and highlights.

Is it possible to add a feature that adds the same logic and behaviour of GET ${TYPESENSE_HOST}/collections/:collection/documents/search to POST ${TYPESENSE_HOST}/multi_search ?

kishorenc commented 3 years ago

@victor-oancea-leftclick-io 👋

Thanks for suggesting this feature.

For now, you can merge the results on client side: the text_match score returned in the hits can be used to rank results across collections.

JZubero commented 2 years ago

Same situation here. While I agree with @kishorenc that result merging could be done on the client side by utilizing the text_match score, sorting and pagination can get painful, especially with large result sets.

@ice-ares May I ask how you have solved this for now?

marcopesani commented 6 months ago

+1

philefstat commented 5 months ago

this feature would be super useful - handing pagination etc. client side is v painful

jasonbosco commented 5 months ago

Here's a workaround to make this a bit easier: https://typesense.org/docs/guide/faqs.html#how-do-i-do-search-multiple-collections-and-combine-the-results-in-a-single-ranked-list (see 2nd paragraph)