When using SearchBar filters such as:
{
type: 'field_value_selection',
field: 'type',
name: 'Type',
multiSelect: 'or',
cache: 10000,
options
},
Or a query such as type:(elasticsearch or logstash) will generate ES Query DSL match query:
"bool": {
"must": [
{
"match": {
"type": {
"query": "elasticsearch logstash",
"operator": "or"
}
}
}
]
}
However the above query will not work if the type field is a keyword.
- Typically keywords are used as filters, since they are explicit
- The
keyword field analyzer won't tokenize elasticsearch logstash, and so the only valid match is exactly that.
I did notice that toESQuery has options.fieldValuesToAndQuery, which should provide a workaround
When using SearchBar filters such as:
Or a query such as
type:(elasticsearch or logstash)will generate ES Query DSLmatchquery:However the above query will not work if the
typefield is akeyword.keywordfield analyzer won't tokenizeelasticsearch logstash, and so the only valid match is exactly that.I did notice that
toESQueryhasoptions.fieldValuesToAndQuery, which should provide a workaround