Failed to execute phase [query], all shards failed - ElasticSearch

1.2k Views Asked by At

I have a problem with elastic search, with query DSL 'mustNot'

Here my code :

$string = new Query\QueryString();
        $string->setQuery('*');
        $term = new Term();
        $term->setTerm($this->attribute,$this->value);
        $mustNot = new Bool();
        $mustNot->addMustNot($term);
        $query = new Query();
        $query->setQuery($string);
        $query->setPostFilter($mustNot);
        return $query;

And My result :

SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[qqgJrK0OTGCfXPX5Yd7X3A][data_from_mapper_3][2]: SearchParseException[[data_from_mapper_3][2]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":"*"}},"post_filter":{"bool":{"must_not":[{"term":{"_score":1}}]}}}]]]; nested: SearchParseException[[data_from_mapper_3][2]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [No parser for element [post_filter]]]; }{[qqgJrK0OTGCfXPX5Yd7X3A][data_from_mapper_3][1]: SearchParseException[[data_from_mapper_3][1]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":"*"}},"post_filter":{"bool":{"must_not":[{"term":{"_score":1}}]}}}]]]; nested: SearchParseException[[data_from_mapper_3][1]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [No parser for element [post_filter]]]; }{[qqgJrK0OTGCfXPX5Yd7X3A][data_from_mapper_3][4]: SearchParseException[[data_from_mapper_3][4]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":"*"}},"post_filter":{"bool":{"must_not":[{"term":{"_score":1}}]}}}]]]; nested: SearchParseException[[data_from_mapper_3][4]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [No parser for element [post_filter]]]; }{[qqgJrK0OTGCfXPX5Yd7X3A][data_from_mapper_3][3]: SearchParseException[[data_from_mapper_3][3]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":"*"}},"post_filter":{"bool":{"must_not":[{"term":{"_score":1}}]}}}]]]; nested: SearchParseException[[data_from_mapper_3][3]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [No parser for element [post_filter]]]; }{[qqgJrK0OTGCfXPX5Yd7X3A][data_from_mapper_3][0]: SearchParseException[[data_from_mapper_3][0]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"query_string":{"query":"*"}},"post_filter":{"bool":{"must_not":[{"term":{"_score":1}}]}}}]]]; nested: SearchParseException[[data_from_mapper_3][0]: query[ConstantScore(*:*)],from[-1],size[-1]: Parse Failure [No parser for element [post_filter]]]; }]
0

There are 0 best solutions below