Skip to content

Instantly share code, notes, and snippets.

@phirschybar
Created May 18, 2014 01:57
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 phirschybar/d3a2876ad367138e0b2d to your computer and use it in GitHub Desktop.
Save phirschybar/d3a2876ad367138e0b2d to your computer and use it in GitHub Desktop.
{
"index": "index_name",
"from": 0,
"size": 30,
"body": {
"min_score": 0.5,
"_source": {
"include": [
"id",
"name",
"image"
]
},
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"nested": {
"path": "stores",
"query": {
"term": {
"stores.id": {
"value": 500,
"boost": 2
}
}
}
}
},
{
"nested": {
"path": "stores",
"query": {
"term": {
"stores.id": {
"value": 1,
"boost": 2
}
}
}
}
},
{
"nested": {
"path": "stores",
"query": {
"term": {
"stores.id": {
"value": 2,
"boost": 2
}
}
}
}
},
{
"nested": {
"path": "stores",
"query": {
"term": {
"stores.id": {
"value": 4,
"boost": 2
}
}
}
}
},
{
"match_all": {
"boost": 1
}
}
]
}
},
"filter": {
"bool": {
"must_not": {
"missing": {
"field": "image",
"existence": true,
"null_value": true
}
}
}
}
}
},
"sort": {
"_score": {
"order": "desc"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment