I want to match both by wildcard and phrase_prefix in the _all field. But the queries below don't work for me.
{'query': {'multi_match': {'query': 'demen*', 'type': 'phrase_prefix', 'fields': ['_all']}}}
{'query': {'multi_match': {'query': 'demen', 'type': 'phrase_prefix', 'fields': ['_all']}}}
The queries above work if I specify fileds.
{'query': {'multi_match': {'query': 'demen*', 'type': 'phrase_prefix', 'fields': ['Diag', 'Text']}}}
{'query': {'multi_match': {'query': 'demen', 'type': 'phrase_prefix', 'fields': ['Diag', 'Text']}}}
My mappings:
...
"type": {
"_all": {
"analyzer": "stem_analyzer"
},
"properties": {
"field" : {
"type": "string",
"analyzer": "stem_analyzer"
}
}
}
...
"settings" : {
"index" : {
"creation_date" : "1470145125821",
"analysis" : {
"filter" : {
"stem_possessive_filter" : {
"name" : "possessive_english",
"type" : "stemmer"
}
},
"analyzer" : {
"stem_analyzer" : {
"filter" : [ "standard", "lowercase", "stem_possessive_filter" ],
"tokenizer" : "standard"
}
}
},
"number_of_shards" : "5",
"number_of_replicas" : "1",
"uuid" : "vKKmroWnTtS7JCIz6Zk6Ew",
"version" : {
"created" : "2030399"
}
}
}
Why wildcard and phrase_prefix don't work with the _all field? How can I make them work?