Reputation: 876
Is there a way how to filter multiple characters during analyzing in ElastisSearch? We would like to setup it so if user searches 'botled' then he get the documents that include 'bottled' or 'botttled', etc., i.e no matter double, tripple letters.
I have looking for solution in token filters https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-tokenfilters.html, but it seems that none of them matches our requirements.
Upvotes: 1
Views: 299
Reputation: 1062
by default elasticsearch text field is tokenized based on whitespace, i.e. only words are indexed and are searchable.
GET /_search
{
"query": {
"regexp": {
"user": {
"value": "b+o+t+t+l+e+d+"
}
}
}
}
b+ --> one or more occurrence of b
Upvotes: 1