Here is the mapping for this field:
"username": {
"type": "text",
"norms": false,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
I have a field that occasionally has the value of "-":
I clicked "filter for value" and this is the filter it created:
But when I do searches for this value it says not results found.
How do I escape the "-"?
I tried "\\-" but no dice
I tried check if the value "exists" as suggested but this also returns 0 results:
Also tried !(_exists_:"username")
in the kibana search bar and that also returns 0 results.
Also running (_exists_:"username")
included docs with and without a value for the username field
I also tried this which returns 0 results:
(_missing_:"username")
As your username
field is of text
type and analyzed with standard analyzer , the inverted index will have no tokens for username
where as username.keyword
is of keyword
type it will have the exact value -
in inverted index.
You can search it in following ways:
From Kibana search bar:
username.keyword: "-"
From Kibana filter:
{ "term": { "username.keyword": "-" } }
From Sense plugin:
GET _search { "query": { "term": { "username.keyword": "-" } } }
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.