Question: Given JSON in ES index in the following format:

```
{
    "pin": {
        "id": 123,
        "location": {
            "lat": 456,
            "lon":-789
        }
    }
}

```

The following gets the document matching the `id` field:

```
client.prepareSearch("index_name")
        .setTypes("pin")
        .setQuery(QueryBuilders.termQuery("id", 123))
        .execute()
        .actionGet();

```

Instead, I 'm trying to match multiple fields, ie. (`location.lat`, `location.lon`).

```
QueryBuilders.termQuery(); // accepts only a single term

```

Tried few alternatives but none of it seems to work, eg:

```
QueryBuilder queryBuilder = QueryBuilders.boolQuery()
        .must(QueryBuilders.termQuery("location.lat", 456))
        .must(QueryBuilders.termQuery("location.lon", -789));

client.prepareSearch("index_name")
        .setTypes("pin")
        .setQuery(queryBuilder)
        .execute()
        .actionGet();

```

Answer: 
```
QueryBuilder qb = boolQuery()
    .must(termsQuery("content", Arrays.asList("test1", "test4"))); 

```

<https://www.elastic.co/guide/en/elasticsearch/guide/current/_finding_multiple_exact_values.html>
You can use QueryBuilders.multiMatchQuery instead of QueryBuilders.termQuery