elasticsearchelasticsearch-queryresthighlevelclient

Elasticsearch exception [type=parsing_exception, reason=[wildcard] query does not support [case_insensitive]]


I'm using 7.10.2 version of Maven-org-elasticsearch-client_elasticsearch-rest-high-level-client version and WildcardQueryBuilder should work with caseInsensitive property. Following is my code snippet and I'm getting "Elasticsearch exception [type=parsing_exception, reason=[wildcard] query does not support [case_insensitive]]" on executing my ES search request

private BoolQueryBuilder translateSearchFilter(final Filter filter) {
        final BoolQueryBuilder searchQuery = new BoolQueryBuilder();
        searchQuery.must(new WildcardQueryBuilder(filter.getDimension(), filter.getQuery().getValue())
                .caseInsensitive(!filter.getQuery().isCaseSensitive()));
        return searchQuery;
    }

Exception Logs

"exception": " ElasticsearchStatusException[Elasticsearch exception [type=x_content_parse_exception, reason=[1:102] [bool] failed to parse field [must]]]; nested: ElasticsearchException[Elasticsearch exception [type=parsing_exception, reason=[wildcard] query does not support [case_insensitive]]];\n\tat org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:187)\n\tat org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1911)\n\tat org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1888)\n\tat org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1645)\n\tat org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1602)\n\tat org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1572)\n\tat org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:1088)\n\tat com.amazon.atvomniaservice.elasticsearch.ElasticSearchClient.search(ElasticSearchClient.java:52)\n\tat com.amazon.atvomniaservice.elasticsearch.ElasticSearchQueryRunner.submit(ElasticSearchQueryRunner.java:30)\n\tat 

Solution

  • I strongly believe that the Java client version and your Cluster's version differ. The caseInsensitive query parameter was first introduced with Elasticsearch version 7.10.

    So I guess you're running an Elasticsearch cluster with a version below 7.10. The cluster does not know about this parameter "yet".

    I hope I could help you.