elasticsearch - Filtered Query in Elastic Search -


filtered query query not working in elastic search. gives error query parsing exception filter malformed, no field after start_object

{ "query": {   "filtered": {     "query": {       "match_all": {}     },     "filter": {       "bool": {         "must": [],         "should": [           {             "_expires": null           },           {             "_expires": {               "gte": 1433947304884             }           }         ],         "must_not": [           {             "term": {               "age": 19             }           }         ]       }     }   } }, "size": 10, "from": 0 } 

can me this?

your shoulds should using filter. yours have "_expires": null. not filter.

for example, try:

        {           "missing": {             "field": "_expires"           }         },         {           "range": {             "_expires": {               "gte": 1433947304884             }           }         } 

Comments

Popular posts from this blog

xslt - Substring before throwing error -

Google Cloud Bigtable Durability/Availability Guarantees -

Android M doze mode and "native" posix socket freezing up -