When trying to add term facets, I face the issue that the terms get tokenized into separate words. For example, if an attribute (field) Kind
has values medium kind of shirt
and large kind of shirt
, the terms become - medium
, large
, kind
, of
, shirt
.
To fix this, it was suggested that I change the mapping to include "index": "not_analyzed"
for each attribute field. The problem is that the mapping is generated dynamically, for example -:
"attributes": {
"properties": {
"kind": {
"type": "string"
},
"color": {
"type": "string"
},
"size": {
"type": "string"
}
}
}
Simply setting the "not_analyzed"
bit inside "attributes"
will not do. Is there a way to set the index attribute for each sub-field inside the attributes
field?