Skip to content

Instantly share code, notes, and snippets.

@rsimon
Last active April 5, 2016 15:53
Show Gist options
  • Save rsimon/770cfb3da5ad7a9046938f934ce2478b to your computer and use it in GitHub Desktop.
Save rsimon/770cfb3da5ad7a9046938f934ce2478b to your computer and use it in GitHub Desktop.
{
"size" : 5,
"query" : {
"nested" : {
"path" : "is_conflation_of",
"query" : {
"bool": {
"should": [
{ "match" : { "is_conflation_of.title": "athenae" } },
{
"nested" : {
"path": "is_conflation_of.names",
"query": {
"match" : { "is_conflation_of.names.name": { "boost": 2, "query": "athenae" } }
}
}
},
{
"nested" : {
"path": "is_conflation_of.descriptions",
"query": {
"match" : { "is_conflation_of.descriptions.description": "athenae" }
}
}
}
]
}
}
}
},
"sort": {
"_script": {
"script": "_source.is_conflation_of.size()",
"order": "desc",
"type": "number"
}
}
}
@rsimon
Copy link
Author

rsimon commented Apr 5, 2016

Query that searches by place name (with double boost), title and description, sorting by number of gazetteers that hold the place. (Our future standard search query in Recogito?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment