Hi, This is a part of source in elasticsearch index. "_source": { "InvoiceId": "a", "InvoiceNum": "b", "LastUpdatedBy": "FINUSER1", "SetOfBooksId": "1", "LastUpdateDate": "2015-03-20 18:31:16.592", "VendorId": "5", "InvoiceAmount": "1200", "InvoiceCurrencyCode": "USD", "AmountPaid": "NotFound", "PaymentCurrencyCode": "USD", } I need to query on multiple inputs using the JAVA API, for example say I have provided "InvoiceId" "InvoiceNum" as "a" and "b" . How can I query using these multiple inputs? I want a single response for this. One thing I came across was
MultiSearchResponse sr = client.prepareMultiSearch().add(srb1).add(srb2).execute().actionGet(); where SearchRequestBuilder srb1 = client.prepareSearch("dbdata2").setTypes("invoices2").setQuery(QueryBuilders.matchQuery("InvoiceId", "a")); SearchRequestBuilder srb2 = client.prepareSearch("dbdata2").setTypes("invoices2").setQuery(QueryBuilders.matchQuery("InvoiceNum","b")); but these return individual results. Is there any way I can get a single output? -- 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 elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4105c392-462a-4902-a762-c92dc92663ea%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.