ElasticsearchStatusException contains unrecognized parameter: [ccs_minimize_roundtrips]]]

meyy picture meyy · Apr 10, 2019 · Viewed 14.8k times · Source

I am trying to do a simple search on ElasticSearch server and getting teh following error

ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=request [/recordlist1/_search] contains unrecognized parameter: [ccs_minimize_roundtrips]]]

The query String : {"query":{"match_all":{"boost":1.0}}}

I am using : elasticsearch-rest-high-level-client (maven artifact)

SearchRequest searchRequest = new SearchRequest(INDEX);
        
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(QueryBuilders.matchAllQuery());
        searchRequest.source(searchSourceBuilder);
        
        try 
        {
            
            
            System.out.print(searchRequest.source());
            SearchResponse response = getConnection().search(searchRequest,RequestOptions.DEFAULT);
            SearchHit[]  results=response.getHits().getHits();
            for(SearchHit hit : results)
            {
                String sourceAsString = hit.getSourceAsString();
                System.out.println( gson.fromJson(sourceAsString, Record.class).year);
            }
            
        } 
        catch(ElasticsearchException e) 
        {
            e.getDetailedMessage();
            e.printStackTrace();
        } 
        catch (java.io.IOException ex)
        {
            ex.getLocalizedMessage();
            ex.printStackTrace();
        }

Answer

YetAnotherBot picture YetAnotherBot · Apr 12, 2019

This usually occurs on porting from elastic-search version 6.X.X to 7.X.X.

You should reduce the elastic-search version to 6.7.1 and try running it.

Since you are using maven you should make sure your dependencies should be like:

<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>6.7.1</version>
</dependency>