Skip to content

Instantly share code, notes, and snippets.

@mkrajc
Last active July 31, 2020 11:38
Show Gist options
  • Save mkrajc/5ac57fbb08f680ff5d338c43991fd02a to your computer and use it in GitHub Desktop.
Save mkrajc/5ac57fbb08f680ff5d338c43991fd02a to your computer and use it in GitHub Desktop.
Query for familyName:Malik givenName:Ranjit Singh
{
"version": true,
"query": {
"function_score": {
"query": {
"bool": {
"must_not": [{
"term": {
"publisher": {
"value": "Spaactor GmbH"
}
}
}, {
"term": {
"publisher": {
"value": "Mediaclipping GmbH"
}
}
}],
"filter": [{
"bool": {
"should": [{
"match_phrase": {
"text": {
"query": "Malik Ranjit Singh"
}
}
}, {
"match_phrase": {
"text": {
"query": "Ranjit Singh Malik"
}
}
}]
}
}, {
"range": {
"publicationTime": {
"gte": 1420070400000,
"lt": 1422748800000
}
}
}, {
"range": {
"wordCount": {
"lte": 10000
}
}
}]
}
},
"score_mode": "sum",
"boost_mode": "replace",
"functions": [{
"field_value_factor": {
"field": "rankingScore"
}
}, {
"weight": 1.0,
"filter": {
"bool": {
"should": [{
"match_phrase": {
"riskyEntities": {
"query": "Malik"
}
}
}]
}
}
}]
}
},
"size": 500,
"stored_fields": ["rowKey"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment