Elasticsearch query must not match text from field -
i want results not match "statuscode": 200
in order match text field use
get index01/_search?pretty { "query":{ "match":{ "statuscode": 200 } } }
i tried this:
get ucs_heartbeat/_search?pretty { "query":{ "match":{ "statuscode":{ "query": 200, "operator": "must_not" } } } }
according to: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html
try instead
get ucs_heartbeat/_search?pretty { "query": { "bool": { "must_not": [ { "term": { "statuscode": 200 } } ] } } }
Comments
Post a Comment