Skip to content

Instantly share code, notes, and snippets.

@baio
Created April 8, 2014 06:28
Show Gist options
  • Save baio/10096968 to your computer and use it in GitHub Desktop.
Save baio/10096968 to your computer and use it in GitHub Desktop.
POST /subjects/person/_search
{
"size": 20,
"sort": {
"_score": {
"order": "desc"
}
},
"query": {
"bool": {
"must": [
{
"term": {
"owner": {
"value": 394
}
}
},
{
"function_score": {
"script_score": {
"script": "_score * (_source._doc == _source.doc ? 3.0 : 0.1)"
},
"query": {
"query_string": {
"query": "val.autocomplete:new~0.7"
}
}
}
}
]
}
},
"highlight": {
"fields": {
"val.autocomplete": {}
}
}
}
{
"size": 20,
"sort": {
"val": {
"order": "desc"
}
},
"highlight": {
"fields": {
"val.autocomplete": {}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment