I am trying to query for an empty string and am having little luck. I have a set of logs with the field 'CharacterId', some of which have a value and others that do not. [http://i.imgur.com/xMmxKFZ.png]Here is an example.(http://i.imgur.com/xMmxKFZ.png). Basically I need to differentiate between the two for visualization purposes but am unable to filter them in this manner. I have tried:
CharacterId:""
CharacterId: " "
-CharacterId:""
"CharacterId:"""
CharacterId:[]
CharacterId:
_exists_:CharacterId
!(_exists_:CharacterId)
Any tips on how to filter by this field being empty or not?
in order to be able to perform that kind of query, the field has to be indexed as the keyword type. Otherwise it would be analyzed by Elasticsearch's full-text analyzer, which tokenizes the string, and therefore makes queries for whitespace impossible. For fields of type keyword the query field:"" should match all documents with an empty string in that field.
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.