# How to search by any word in any field with ElasticSearch rest high-level client? Also add aggregation on same query

**URL:** <https://discuss.elastic.co/t/how-to-search-by-any-word-in-any-field-with-elasticsearch-rest-high-level-client-also-add-aggregation-on-same-query/166523>\
**Category:** Elasticsearch\
**Created:** [January 31, 2019, 10:08am UTC](https://discuss.elastic.co/t/how-to-search-by-any-word-in-any-field-with-elasticsearch-rest-high-level-client-also-add-aggregation-on-same-query/166523 "2019-01-31T10:08:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunilgjagtap](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@sunilgjagtap](https://discuss.elastic.co/u/sunilgjagtap)\
**Post date:** [January 31, 2019, 10:08am UTC](https://discuss.elastic.co/t/how-to-search-by-any-word-in-any-field-with-elasticsearch-rest-high-level-client-also-add-aggregation-on-same-query/166523/1 "2019-01-31T10:08:46Z")

</div>

I have to search a any word in any field with elasticSearch rest high-level client and also apply aggregation on query so get source bucket.

Please suggest proper way.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 31, 2019, 10:31am UTC](https://discuss.elastic.co/t/how-to-search-by-any-word-in-any-field-with-elasticsearch-rest-high-level-client-also-add-aggregation-on-same-query/166523/2 "2019-01-31T10:31:26Z")

</div>

Try the simple query string query or the multimatch query.

For the aggregation part, I'm not sure I understood the question. On which field you want to aggregate ? What kind of aggregation you want to run?

---

<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:** [February 28, 2019, 10:31am UTC](https://discuss.elastic.co/t/how-to-search-by-any-word-in-any-field-with-elasticsearch-rest-high-level-client-also-add-aggregation-on-same-query/166523/3 "2019-02-28T10:31:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
