#community-help

Multi-search Query for Separate Strings

TLDR bnfd inquired about searching for different strings in one query. Jason suggested multi-search but clarified that it would require de-duplication on the client side.

Powered by Struct AI

1

8
24mo
Solved
Join the chat
Nov 05, 2021 (24 months ago)
bnfd
Photo of md5-ca6495d5be926db80e09aabf066f4b8b
bnfd
04:53 PM
Is it possible to search for "foo", "bar", "baz" separately in one query?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:38 PM
Could you elaborate on what you mean "search separately"?
05:39
Jason
05:39 PM
bnfd
Photo of md5-ca6495d5be926db80e09aabf066f4b8b
bnfd
06:07 PM
For example if searching for "foo" returns doc1,doc2 and "bar" returns doc2, doc4 the combined search should return their union (doc1, doc2, doc4).
06:14
bnfd
06:14 PM
They are part of the same collection. Multi search seems to be what I need, will it return duplicates (doc2 two times)?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
06:15 PM
Yeah it will return duplicate results, it just a way to wrap multiple search requests in a single HTTP call
06:15
Jason
06:15 PM
So you'd have to de-duplicate and aggregate on the client side
bnfd
Photo of md5-ca6495d5be926db80e09aabf066f4b8b
bnfd
06:16 PM
Great, thanks!

1