# Issue/bugs with High Level Rest Client

**URL:** <https://discuss.elastic.co/t/issue-bugs-with-high-level-rest-client/116828>\
**Category:** Elasticsearch\
**Created:** [January 24, 2018, 8:44am UTC](https://discuss.elastic.co/t/issue-bugs-with-high-level-rest-client/116828 "2018-01-24T08:44:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manish\_Bansal](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@Manish\_Bansal](https://discuss.elastic.co/u/Manish_Bansal)\
**Post date:** [January 24, 2018, 8:44am UTC](https://discuss.elastic.co/t/issue-bugs-with-high-level-rest-client/116828/1 "2018-01-24T08:44:16Z")

</div>

Hi There,  
I am new to Elasticsearch and this forum as well, I am facing a strange issue with my hello world example with Elasticsearch High level Rest API Java Client.  
this might be an issue with the API or I may not be setting it correctly.

I am getting below error Message:

> Exception in thread "main" ElasticsearchStatusException[Elasticsearch exception [type=parsing\_exception, reason=[match] query does not support [auto\_generate\_synonyms\_phrase\_query]]]

> Suppressed: org.elasticsearch.client.ResponseException: method [GET], host [[http://eqtpsfqa15.nam.nsroot.net:9200](http://eqtpsfqa15.nam.nsroot.net:9200)], URI [/\_search?typed\_keys=true&ignore\_unavailable=false&expand\_wildcards=open&allow\_no\_indices=true&search\_type=query\_then\_fetch&batched\_reduce\_size=512], status line [HTTP/1.1 400 Bad Request]  
> {"error":{"root\_cause":[{"type":"parsing\_exception","reason":"[match] query does not support [auto\_generate\_synonyms\_phrase\_query]","line":1,"col":215}],"type":"parsing\_exception","reason":"[match] query does not support [auto\_generate\_synonyms\_phrase\_query]","line":1,"col":215},"status":400}

Here is my code. (please bare with me, its Kotlin)

```
fun main(args: Array<String>) {
    val restClient = RestHighLevelClient(RestClient.builder(HttpHost("my hostname here ", 9200, "http")))
    val searchRequest: SearchRequest = SearchRequest()
    searchRequest.source(SearchSourceBuilder().query(MatchQueryBuilder("message", "string to be searhed in message")))
    val searchResponse = restClient.search(searchRequest)
    val searchHits = searchResponse.hits.getHits()
    for (hit in searchHits) {
        println(hit.sourceAsString)
    }

}

```

I have tested connection and other this it works if I am replacing MatchQueryBuilder to MatchAllQueryBuilder  
`searchRequest.source(SearchSourceBuilder().query(MatchAllQueryBuilder()))`

---

<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 24, 2018, 8:57am UTC](https://discuss.elastic.co/t/issue-bugs-with-high-level-rest-client/116828/2 "2018-01-24T08:57:14Z")

</div>

I think you are using a Rest Client 6.1 on a cluster running 5.x or something like this...

---

<div class="post-metadata">

**Author:** ![Manish\_Bansal](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@Manish\_Bansal](https://discuss.elastic.co/u/Manish_Bansal)\
**Post date:** [February 9, 2018, 12:55pm UTC](https://discuss.elastic.co/t/issue-bugs-with-high-level-rest-client/116828/3 "2018-02-09T12:55:12Z")

</div>

Hi David,  
thanks for the reply, yes that was the issue and I have moved back to older rest client API and it is working now,  
but since I am new I am looking forward for some more help, may be i am not able to find the right examples in the documentation.

I purpose is to use this API for log searching, using mutiple data combination. with AND , OR, and NOT condition for the given Beat name/ hostname  
I also want to use timestamp condition with grater then or less then.

with the above example I am only able to find messages with single key.

```
searchRequest.source(SearchSourceBuilder().query(MatchQueryBuilder("message", "string to be searhed in message")))

```

Can you please suggest

---

<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:** [February 9, 2018, 1:07pm UTC](https://discuss.elastic.co/t/issue-bugs-with-high-level-rest-client/116828/4 "2018-02-09T13:07:48Z")

</div>

That's another question. Please open another thread.

Better to first start with just Kibana dev console then when ok move to java code.

---

<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:** [March 9, 2018, 1:08pm UTC](https://discuss.elastic.co/t/issue-bugs-with-high-level-rest-client/116828/5 "2018-03-09T13:08:31Z")

</div>

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