Skip to content

Instantly share code, notes, and snippets.

@davidbkemp
Last active October 12, 2016 06:11
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 davidbkemp/b2e3cf6bd661624aeca4311ab819588e to your computer and use it in GitHub Desktop.
Save davidbkemp/b2e3cf6bd661624aeca4311ab819588e to your computer and use it in GitHub Desktop.
Example of how to use Elasticsesarch's Completion Suggesters for address auto-complete
{
"suggest": {
"output": "5/1-3 Abby Court, West Moonah, Tas 7009",
"input": [
"5/1-3 Abby Court, West Moonah, Tas 7009",
"Abby Court, West Moonah, Tas 7009",
"1-3 Abby Court, West Moonah, Tas 7009",
"1 Abby Court, West Moonah, Tas 7009",
"3 Abby Court, West Moonah, Tas 7009",
"5/1 Abby Court, West Moonah, Tas 7009",
"5/3 Abby Court, West Moonah, Tas 7009"
]
}
}
{
"suggestions" : {
"text" : "5/1 Ab",
"completion" : {
"field" : "suggest"
}
}
}
{
"nonfuzzy-suggestions": {
"text": "5/1 Axb",
"completion": {
"field": "suggest"
}
},
"fuzzy-suggestions": {
"text": "5/1 Axb",
"completion": {
"field": "suggest",
"fuzzy": {}
}
}
}
{
"address": {
"properties": {
"suggest" : {
"type" : "completion"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment