Hi I'm trying to run a multi request using the java api.
I have 2 queries which I would like to run them both on 2 different indexes. the problem is that apparently I'm unable to direct queries to different indexes as the multi search api suggests here: http://www.elasticsearch.org/guide/reference/api/multi-search/
When trying to run the queries I actually get result for query running the search on both indexes together...
when I use client.prepareSearch("index1", "index2") it just makes the queries search both indexes at the same time, resulting in getting overload of results.
Also tried putting putHeader("index", "index1") for the request before adding the request to the multi object, but it looks like it ignores it.
I'm not sure what's the difference between creating the multi object as:
MultiSearchRequestBuilder multi =new
MultiSearchRequestBuilder(ProfileReportRequestHandler.getClient());
or as:
MultiSearchRequestBuilder multi =
ProfileReportRequestHandler.getClient().prepareMultiSearch();
but only the second one executed the requests to the exact index that I
specified on request creation.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.