Distinct multi search result

Hi Guys,

I use Elasticsearch 2.2 and when using Multi Search API, it's possible to distinct the result between the first search and the second search??
I have multi search query dsl like this

{"query": {"filtered": {"filter": {"bool": {"must": [{"terms": {"mtart": ["roh"]}},{"terms": {"werks": ["f230","f232"]}}]}},"query": {"query_string": {"query": "roh"}}}}}

The result for the first search is 12 hits and the second is 39 hits. But there is duplicate value between first search and second search. And I want to distinct all the hits and get the unique documents. It is possible to do it??

Thanks a lot

Not using the APIs, no.
You'd need to do that external to ES, in your own code.

Thanks Mark.

It there any possibility to use multisearch query string on JAVA API?? like setExtraSource function?
I just need to input query string to the function and I can get the result.
If I use for loop to create SearchBuilder, how to add to esClient.prepareMultiSearch().add(searchBuilder) function?

Thanks a lot

I have the same problem. But the version of elasticsearch which I used is 5.2.2.