Search Tech Design - liuninglin/pandama-ext GitHub Wiki
Reasons for Choosing Elasticsearch
- Not to add more complexities to our project.
- Best community support.
- Widely used for autocomplete search.
Reasons for Choosing Elasticsearch Edge N-Grams
- More practical for autocomplete search cases compared with Bi-Grams and Tri-Grams
- Match from the most left letter to the most right letter.
Diff Between Bi-Grams, Tri-Grams, and Edge N-Grams

Steps of Development:
- Define an edge n-grams analyzer in an existing mapping, and attach it to some fields
{
"settings": {
"analysis": {
"analyzer": {
"autocomplete": {
"tokenizer": "autocomplete",
"filter": [
"lowercase"
]
},
"autocomplete_search": {
"tokenizer": "lowercase"
}
},
"tokenizer": {
"autocomplete": {
"type": "edge_ngram",
"min_gram": 2,
"max_gram": 10,
"token_chars": [
"letter"
]
}
}
}
},
"mappings": {
"properties": {
"title": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "autocomplete_search"
}
}
}
}
- recreate indices for the product mapping
- change query logic
- change UI stuff