Skip to content

Instantly share code, notes, and snippets.

@agounaris
Last active August 29, 2015 14:14
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 agounaris/f8619189b582b891d0ad to your computer and use it in GitHub Desktop.
Save agounaris/f8619189b582b891d0ad to your computer and use it in GitHub Desktop.
Elasticsearch score matching
{
"from": 0,
"query": {
"function_score": {
"functions": [
{
"weight": 1.5,
"filter": {
"term": {
"_type": "store"
}
}
},
{
"weight": 4.5,
"filter": {
"term": {
"_type": "product"
}
}
}
],
"query": {
"bool": {
"must": {
"query_string": {
"fields": [
"title^5",
"description^2",
"street"
],
"query": "place"
}
},
"should": []
}
}
}
},
"size": 50
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment