Skip to content

Instantly share code, notes, and snippets.

@rsimon
Last active April 5, 2016 15:53
Show Gist options
  • Select an option

  • Save rsimon/770cfb3da5ad7a9046938f934ce2478b to your computer and use it in GitHub Desktop.

Select an option

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

rsimon commented Apr 5, 2016

Copy link
Copy Markdown
Author

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