I'm working on migrating from 1.7 to 5.3 and I must be missing something because my query_string query doesn't behave as it did in 1.7.
My simple query:
POST /scanning-v5-2/history/_search
{
"from": 0,
"size": 10,
"query": {
"query_string": {
"query": "fname.fname_search:test"
}
}
}
The query returns both documents instead of only one.
PUT /scanning-v5-2
{
"settings": {
"index": {
"number_of_shards": "3",
"number_of_replicas": "0",
"analysis": {
"normalizer": {
"ci_normalizer": {
"type": "custom",
"filter": [
"lowercase"
]
}
},
"filter": {
"ngram": {
"type": "nGram",
"min_gram": "2",
"max_gram": "15"
}
},
"analyzer": {
"my_nGram_analyzer": {
"filter": [
"lowercase",
"ngram"
],
"tokenizer": "keyword"
}
}
}
}
},
"mappings": {
"history": {
"properties": {
"fname": {
"normalizer": "ci_normalizer",
"type": "keyword",
"fields": {
"fname_search": {
"analyzer": "my_nGram_analyzer",
"type": "text"
}
}
}
}
}
}
}
PUT scanning-v5-2/history/1
{
"fname": "Test this file.pdf"
}
PUT scanning-v5-2/history/2
{
"fname": "What a structured file.pdf"
}