Reputation: 1138
In my elasticsearch I had data "New York", I want to query and match "NewYork" (please note no space in query string). How can I achieve this? Is there any analyzer that can help here?
Upvotes: 3
Views: 3543
Reputation: 130
Here is an example of how to use the Shingle Token Filter to obtain the desired result.
Hope this helps.
Upvotes: 0
Reputation: 1684
I think you can apply to Shingle Token Filter. The shingle filter will create new tokens by concatenating adjacent terms. A part of your query can look like as:
...
"my_shingle":{
"type":"shingle",
"max_shingle_size":5,
"min_shingle_size":2,
"output_unigrams":"true",
token_separator: ""
}
Upvotes: 7