# Help on putting together a java search

**URL:** <https://discuss.elastic.co/t/help-on-putting-together-a-java-search/4831>\
**Category:** Elasticsearch\
**Created:** [July 10, 2011, 10:14pm UTC](https://discuss.elastic.co/t/help-on-putting-together-a-java-search/4831 "2011-07-10T22:14:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgh1](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@dgh1](https://discuss.elastic.co/u/dgh1)\
**Post date:** [July 10, 2011, 10:14pm UTC](https://discuss.elastic.co/t/help-on-putting-together-a-java-search/4831/1 "2011-07-10T22:14:16Z")

</div>

Hi,

Using the elasticserach web I can do structured search and it generate the json as shown below. Also I can curl using below and get results. However, what I can not figure out is how to do the below using the java API.

I have tried the QueryBuilder but can not figure out how to string together the correct Java sequence of calls to do the same as the below.

If anybody could show me how to do this or point to "detailed" documentation other than the Javadocs and the java examples, which are to vague, it would be greatly appreciated.

Thanks in advance for any help.

-dgh1

{

```
query: {
    bool: {
        must: [
            {
                fuzzy: {
                    product: {
                        value: armchair
                        max_expansions: 5
                    }
                }
            }
        ]
        must_not: []
        should: []
    }
}
from: 0
size: 50
sort: []
facets: { }

```

}

---

<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 6, 2017, 4:01am UTC](https://discuss.elastic.co/t/help-on-putting-together-a-java-search/4831/2 "2017-07-06T04:01:04Z")

</div>


