Last active
March 25, 2019 17:14
-
-
Save ilirhushi/283f2fc655eae4335ea3b3a72b3214ff to your computer and use it in GitHub Desktop.
Elastic Search - JSON structure to filter best matching Candidate from Characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode 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