Skip to content

Instantly share code, notes, and snippets.

@robyoung
Created May 11, 2012 11:00
Show Gist options
  • Save robyoung/2658979 to your computer and use it in GitHub Desktop.
Save robyoung/2658979 to your computer and use it in GitHub Desktop.
Elasticsearch Autocomplete Query
curl -X GET "http://localhost:9200/licence-finder/_search?pretty=true" -d '{"query":{"query_string":{"query":"title.autocomplete:organ*"}},"sort":[{"title.sortable":"asc"}]}'
{
"took" : 72,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : null,
"hits" : [ {
"_index" : "licence-finder",
"_type" : "sector",
"_id" : "VOLib5RGSwqY7x9dGvSUHw",
"_score" : null, "_source" : {"type":"sector","public_id":1000359,"title":"Event organisation and management"},
"sort" : [ "event organisation and management" ]
} ]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment