# Question about Java Search API and building the queries

**URL:** <https://discuss.elastic.co/t/question-about-java-search-api-and-building-the-queries/182270>\
**Category:** Elasticsearch\
**Created:** [May 22, 2019, 3:39pm UTC](https://discuss.elastic.co/t/question-about-java-search-api-and-building-the-queries/182270 "2019-05-22T15:39:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jurgen\_Debedts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jurgen_debedts/32/49335_2.png) [@Jurgen\_Debedts](https://discuss.elastic.co/u/Jurgen_Debedts)\
**Post date:** [May 22, 2019, 3:39pm UTC](https://discuss.elastic.co/t/question-about-java-search-api-and-building-the-queries/182270/1 "2019-05-22T15:39:07Z")

</div>

Hello,

I am trying to build an integration with a content management product and using Elastic as search engine for the documents in the system.  
The product can be configured quite a bit and gets as far as presenting me with a query in the following syntax:

"must":{"match\_phrase":{"Title":"test"}} ES\_AND "must":{"match\_phrase":{"Author":"admin"}}

The product works on per-field basis so this is what I get. I know the product expects fields to be grouped in the must operator.

What are my fastest options to get this into a correct Java API call. I think that the best option is to use the BoolQueryBuilder but rather than write a parsing that might already exist, I first wanted to ask the community for ideas.

JAVA HighLevelRestAPI / Elasticsearch v 7

Thanks,

Jurgen

---

<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:** [June 19, 2019, 3:39pm UTC](https://discuss.elastic.co/t/question-about-java-search-api-and-building-the-queries/182270/2 "2019-06-19T15:39:08Z")

</div>

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