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

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -