Java API to match multiple fields in elasticsearch

Currently I query ES for a single key value pair like this:

String query_key = "abc";
String query_val = "def";

searchRequestBuilder.setQuery(QueryBuilders.matchQuery(query_key, query_val)).execute().actionGet();

Now, instead of single key-value pair, I have the following key-value pair
map: Map<String,String> query_list

How do I modify the same for this?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f35f1751-48cf-4958-b83b-613b951bc468%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

May be this could help:

QueryBuilder qb = multiMatchQuery(
"joe smith england",
"name.first",
"name.last",
"address.country");

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

Le 2 déc. 2014 à 13:47, prachicsa@gmail.com a écrit :

Currently I query ES for a single key value pair like this:

String query_key = "abc";
String query_val = "def";

searchRequestBuilder.setQuery(QueryBuilders.matchQuery(query_key, query_val)).execute().actionGet();
Now, instead of single key-value pair, I have the following key-value pair map: Map<String,String> query_list

How do I modify the same for this?

--
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+unsubscribe@googlegroups.com mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f35f1751-48cf-4958-b83b-613b951bc468%40googlegroups.com https://groups.google.com/d/msgid/elasticsearch/f35f1751-48cf-4958-b83b-613b951bc468%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/DC000BEF-E296-4B22-9351-97443E3E2FE1%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.