must: { term: { ... }}
fails but must: { match: { ... }}
has hits.
-
term
will only work fornot_analyzed
fields, correct? - How can I see if a field is
not_analyzed
?
must: { term: { ... }}
fails but must: { match: { ... }}
has hits.
term
will only work for not_analyzed
fields, correct?not_analyzed
?term will work without applying any analysis transformation to your request.
Which means that it can also work against a analyzed or not analyzed field.
For example, if you index with a standard analyzer the following text: BrOWN foX
and you search with a term query for fox
or brown
, it will find the doc.
If you search for BrOWN
it won't match.
GET index/_mapping
I performed this request:
GET /_all
From there I could see the field isn't analyzed as expected.
"request": {
"type": "string",
"norms": {
"enabled": false
},
"fielddata": {
"format": "disabled"
},
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 256
}
}
@dadoonet GET logstash-2016.07.04/_mapping
worked as well.
I'm not sure why must: { term: { ... }}
fails, but I suppose that's another question.
My guess is that your query is wrong.
If you send a full script to reproduce that, I can explain what is happening.
© 2020. All Rights Reserved - Elasticsearch
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.