I use PUT mapping to add sku.exact to the user field, but didn't read docs carefully enough for this function. It appears my mapping is just fine, I just had to reindex against new mapping.
Problem before realizing I didn't read the docs:
I'm trying to search on user.exact for "testing.mydomain.com", but am getting zero results. This should be so simple, but I've fouled the mapping up apparently and I can't seem to fix it. Any pointers would be much appreciated.
Query:
GET _search
{
"query": {
"bool": {
"filter": {
"term": {
"user.exact": "testing.mydomain.com"
}
}
}
}
}
Example Source:
{
"user": "testing.mydomain.com"
}
Mapping:
{
"index": "testing",
"body": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1,
"analysis": {
"filter": {
"name_ngrams": {
"side": "front",
"max_gram": "10",
"min_gram": 1,
"type": "edgeNGram"
}
},
"analyzer": {
"full_name": {
"filter": [
"standard",
"lowercase"
],
"type": "custom",
"tokenizer": "standard"
},
"partial_name": {
"filter": [
"standard",
"lowercase",
"name_ngrams"
],
"type": "custom",
"tokenizer": "standard"
},
"sortable": {
"filter": [
"lowercase"
],
"type": "custom",
"tokenizer": "keyword"
}
}
}
},
"mappings": {
"test": {
"_all": {
"enabled": false
},
"properties": {
"user": {
"fields": {
"exact": {
"type": "string",
"index": "not_analyzed"
},
"partial": {
"search_analyzer": "full_name",
"analyzer": "partial_name",
"type": "string"
},
"user": {
"type": "string",
"analyzer": "full_name"
},
"sortable": {
"type": "string",
"analyzer": "sortable"
}
},
"type": "multi_field"
}
}
}
}
}
}