How can I combine two elasticsearch responses into one?

(Jesse Russell) #1

I am currently stuck with a result response from a multi-search that
returns an array of responses for each query I add, but I need the
responses to be combined so that the relevancy to determine their order.
Getting back two separated lists of hits isn't great for creating a unified
search results page.

My current code for searching is:

SearchRequestBuilder srb1 = client.prepareSearch(category)

SearchRequestBuilder srb2 = client.prepareSearch(category+"_pdfs")
MultiSearchResponse sr = client.prepareMultiSearch()

Thanks for any help you all can give!

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit

(system) #2