Skip to content

Instantly share code, notes, and snippets.

@mishudark
Created November 23, 2014 02:43
Show Gist options
  • Save mishudark/2366b1ac0475e1d5cc90 to your computer and use it in GitHub Desktop.
Save mishudark/2366b1ac0475e1d5cc90 to your computer and use it in GitHub Desktop.
indexer autocomplete
curl -XPUT "http://127.0.0.1:9200/cronologias" -d '
{
"settings": {
"number_of_shards": 1,
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 20
}
},
"analyzer": {
"autocomplete": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"autocomplete_filter",
"asciifolding"
]
}
}
}
}
}
'
curl -XPUT "http://127.0.0.1:9200/cronologias/_mapping/crono" -d '
{
"crono": {
"properties": {
"title": {
"type": "string",
"analyzer": "autocomplete"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment