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], 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()))