94.8. MultiSearch 예
특정 필드에서 MultiSearching 및 value는 Operation 'MultiSearch'를 사용합니다. MultiSearchRequest 인스턴스에 전달
from("direct:multiSearch") .to("elasticsearch-rest://elasticsearch?operation=MultiSearch");
<route> <from uri="direct:multiSearch" /> <to uri="elasticsearch-rest://elasticsearch?operation=MultiSearch"/> </route>
특정 필드에 대한 MultiSearch
SearchRequest req = new SearchRequest(); req.indices("twitter"); req.types("tweet"); SearchRequest req1 = new SearchRequest(); req.indices("twitter"); req.types("tweets"); MultiSearchRequest request = new MultiSearchRequest().add(req1).add(req); Item[] response = template.requestBody("direct:search", request, Item[].class);