As stated here a field in Elasticsearch, defined as type "completion" together with a certain analyzer + tokenizer, is first split up according to the underlying logic of those parts and then "stitched" together again. However I'm verry unhappy with this behaviour.
This is my current mapping setup (excerpt):
"mappings": {
"movie": {
"properties": {
"title": {
"analyzer": "standard",
"fields": {
"autocomplete": {
"type": "completion"
"analyzer": "whitespace",
}
},
"type": "string"
}
}
}
}
Let's take a movie with the title Harry Potter for example:
When I enter the prefix Har I get the suggestion Harry Potter . When I enter Pot instead, I get no result at all, because the individual tokens Harry and Potter were stitched together to Harry Potter immediately after analyzing/tokenizing.
Now what I would like is the following behaviour: When I enter Pot I'd want the Completion Suggester to return Potter . Not Harry Potter , but simply Potter . Is this somehow possible? Caution: I don't even need the reference to the document which created the suggestion. So if it's somehow possible to throw all generated tokens in a pot and then retrieve suggestions from there, that would be awesome (due to some other stuff I have to do).