3

I upgraded Elasticsearch version 5.4 to 7.1. I have a query work on 5.4 version, but the same query on 7.1 throws an exception.

query malformed, empty clause found

Query :

{
    "query": {"match_all": {}}
    ,"aggs": {
       "price": {
           "aggs": {
              "tt": {
                  "terms": {
                     "field": "platformType"
                  }
              }
           },
           "filter": {

           }
       }
    }
}

The filter is empty because I use condition less term query. Is there any solution?

Thank you in advance.

4
  • What do you expect with an empty filter section? Commented Oct 4, 2019 at 11:37
  • I dont expect anything in many case filter not empty like this { "query": {"match_all": {}} ,"aggs": { "price": { "aggs": { "tt": { "terms": { "field": "platformType" } } }, "filter": { "term": { "isActive": "true" } } } } } ı put ın filter request data but ın some case data comes null Commented Oct 4, 2019 at 11:47
  • If you use the filter aggregation, you must always have something in it, math_all or anything Commented Oct 4, 2019 at 12:00
  • thank you @Val for your suggestion, I'll try it Commented Oct 4, 2019 at 12:33

1 Answer 1

5

Empty Clauses were deprecated. Use match_all just like you do in your query clause.

{
    "query": {"match_all": {}}
    ,"aggs": {
       "price": {
           "aggs": {
              "tt": {
                  "terms": {
                     "field": "platformType"
                  }
              }
           },
           "filter": {
                   "match_all": {}
           }
       }
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.