Error when combining queries using bool

myindex/_search?scroll=10m
    {
      "size": 5000,
      "query" :
          "bool": {
              "must": [
             {     "query_string" : { "query":" name:bob " }  },
             {
                  "range":{
                       "@timestamp":{
                           "gte":  1519015696225,
                           "lte": 1519030096225
                       }
                   }
             }
                       ]
          }
    }

{u'status': 400, u'error': {u'line': 4, u'root_cause': [{u'reason': u'Unknown key for a VALUE_STRING in [query].', u'type': u'parsing_exception', u'line': 4, u'col': 7}], u'type': u'parsing_exception', u'reason': u'Unknown key for a VALUE_STRING in [query].', u'col': 7}}

What am I doing wrong?

Invalid JSON. Try https://jsonlint.com/

Thanks for the quick reply Mark!

Yes I made a typo and missed out a bracket. It works now!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.