Skip to content

Instantly share code, notes, and snippets.

@ilirhushi
Last active March 25, 2019 17:14
Show Gist options
  • Save ilirhushi/283f2fc655eae4335ea3b3a72b3214ff to your computer and use it in GitHub Desktop.
Save ilirhushi/283f2fc655eae4335ea3b3a72b3214ff to your computer and use it in GitHub Desktop.
Elastic Search - JSON structure to filter best matching Candidate from Characters
{
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"match": {
"criteria.criteriaId": "7IC1m5neYb3RicUIrmUV"
}
},
{
"term": {
"criteria.selection": {
"value": "No",
"boost": 2.0
}
}
}
]
}
},
{
"bool": {
"should": [
{
"match": {
"criteria.criteriaId": "1OLMSeyzTpPG63MCKqcx"
}
},
{
"range" : {
"criteria.selection" : {
"gte" : 19,
"lte" : 34,
"boost" : 2.0
}
}
}
]
}
},
{
"bool": {
"should": [
{
"match": {
"criteria.criteriaId": "KoBgVBRjuE4kE4xbw5Ae"
}
},
{
"term": {
"criteria.selection": {
"value": "Chinese, Danish, Dutch, Filipino, French",
"boost": 2.0
}
}
}
]
}
}
],
"must_not": [
],
"should": [
]
}
},
"from": 0,
"size": 20
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment