Have a look at the tokens.
I think you have indexed John Wick
.
At index time (autocomplete
), you indexed: joh
, john
, wic
, wick
.
At search time (autocomplete_search
), you are searching for:
- For
John.Wick
:john.wick
- For
John Wick
:john
,wick
That's the reason it does not match for John.Wick
.
You need to change your analyzer so it will produce the right tokens when searching with a name which has a dot.
I have no idea of what your "tokenizer" : "autocomplete"
is. But I think you should look at it and may be use something similar instead of "tokenizer" : "standard"
.
Note that autocomplete suggests that you want to search for sub terms...
Here you have the full terms...
Why about combining multiple searches using a bool
/ should
array of match
queries?
If you can't make it work, please provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.
A full reproduction script is something anyone can copy and paste in Kibana dev console, click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.