I'm working with ES 1.6 to find all the licenses of a particular type, however, I've found that term means contains, not equal to, so I pick up the license objects I want for that type, along with the ones I don't want. If the person has one license it works fine, the problem is when one person has multiple license types.
Here is a partial similar list of what I have for the mapping:
"LICENSES": {
"type": "nested",
"include_in_parent": true,
"doc_values": true,
"properties": {
"LICENSE_TYPE": {
"type": "string",
"index": "not_analyzed",
"doc_values": true
},
"START_DATE": {
"type": "date",
"format": "dateOptionalTime",
"doc_values": true
},
"END_DATE": {
"type": "date",
"format": "dateOptionalTime",
"doc_values": true
},
"LICENSE_NUMBER": {
"type": "string",
"index": "not_analyzed",
"doc_values": true
},
...
},
What is the correct way to just return all the drivers LICENSES that have a LICENSE_TYPE of Commercial Class B, and exclude Class A, Class, C, CDL, Motorcycle, etc... where a person can have multiple license types?