Skip to content

Instantly share code, notes, and snippets.

@loretoparisi
Created September 20, 2021 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loretoparisi/dc1cdd4dea29a83e326a81a00fae2775 to your computer and use it in GitHub Desktop.
Save loretoparisi/dc1cdd4dea29a83e326a81a00fae2775 to your computer and use it in GitHub Desktop.
Elastic Search Auto Complete Analyzer
{
"aliases": {},
"mappings": {
"properties": {
"text": {
"type": "text",
"analyzer": "autocomplete"
}
}
},
"settings": {
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "ngram",
"min_gram": 1,
"max_gram": 60
}
},
"analyzer": {
"autocomplete": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"autocomplete_filter"
]
}
}
},
"index.max_ngram_diff": 60
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment