# Match the query String with multiple fields of elasticsearch index and merge all result through java API

**URL:** <https://discuss.elastic.co/t/match-the-query-string-with-multiple-fields-of-elasticsearch-index-and-merge-all-result-through-java-api/54507>\
**Category:** Elasticsearch\
**Created:** [July 1, 2016, 6:40am UTC](https://discuss.elastic.co/t/match-the-query-string-with-multiple-fields-of-elasticsearch-index-and-merge-all-result-through-java-api/54507 "2016-07-01T06:40:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apratapi](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@apratapi](https://discuss.elastic.co/u/apratapi)\
**Post date:** [July 1, 2016, 6:40am UTC](https://discuss.elastic.co/t/match-the-query-string-with-multiple-fields-of-elasticsearch-index-and-merge-all-result-through-java-api/54507/1 "2016-07-01T06:40:36Z")

</div>

I have a elasticsearch index with multiple fields, i want to match a string with all the fields (if this string present in any of the field then get the field data as result) and gather the result , has to to done by Java API.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 4, 2016, 8:00am UTC](https://discuss.elastic.co/t/match-the-query-string-with-multiple-fields-of-elasticsearch-index-and-merge-all-result-through-java-api/54507/2 "2016-07-04T08:00:09Z")

</div>

Hey,

please see our java documentation [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-search.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-search.html) and if there are problems please ask concrete questions with code samples.

--Alex

---

<div class="post-metadata">

**Author:** ![apratapi](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@apratapi](https://discuss.elastic.co/u/apratapi)\
**Post date:** [July 4, 2016, 3:58pm UTC](https://discuss.elastic.co/t/match-the-query-string-with-multiple-fields-of-elasticsearch-index-and-merge-all-result-through-java-api/54507/3 "2016-07-04T15:58:42Z")

</div>

Thanks Alex.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:38pm UTC](https://discuss.elastic.co/t/match-the-query-string-with-multiple-fields-of-elasticsearch-index-and-merge-all-result-through-java-api/54507/4 "2017-07-05T22:38:29Z")

</div>


