We have an index with documents which have the value "-" in a field "referrer". However when we try to exclude these values in Kibana, the documents are not filtered out. Digging deeper we see that ElasticSearch does not respect the query:
The query NOT referrer: \"-\" returns a document with referrer = -.
NOT referrer: \"-\" is not querying on existence of the field but comparing its content. Here you indexed no content. And you are searching for nothing.
Here is an example that shows this:
DELETE test
PUT test/_doc/1
{
"foo": "bar"
}
PUT test/_doc/2
{
"foo": "-"
}
GET test/_search
{
"query": {
"query_string": {
"query": "NOT foo:\"-\""
}
}
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.