Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticsearchStatusException contains unrecognized parameter: [ccs_minimize_roundtrips]]]

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();
        }
like image 615
meyy Avatar asked Apr 09 '19 22:04

meyy


1 Answers

Problem here is the movement of version, probably you were using elastic search 6.x.x and now using 7.x.x

You can definitely solve this by having your elastic search server of 7.x.x.

Elasticsearch 6.x.x used to have type of document 
(where you could give type to your documents)


but Elasticsearch 7.x.x onwards it has no type or 
default type _doc, so you need to have _doc as your type 
while creating mapping.
like image 79
Anshul Sharma Avatar answered Sep 28 '22 02:09

Anshul Sharma