I've got a nested type for identifiers (e.g. full name, given name, surname, etc.) on which i'd like to return the unique values for a nested field. The data is like the following:
{ "entityType" : "Person", "identifier" : [ { "idType" : "Full Name", "value" : "Smith, John" }, { "idType" : "Given Name", "value" : " John" }, { "idType" : "Surname", "value" : "Smith" }, { "idType" : "AKA", "value" : "John the Great" } ] }
What would be the most effective way to return the distinct values for identifier.value for entityType = "Person" AND idType = "Full Name"? Note that idType = "Full Name" could also be for docs other than Person; e.g. idType = "Organization".
BTW, I'm using elasticsearch 1.7.1.
Thoughts?