Elastic Search Query for Distinct Nested Values
问题 I am using the High Level REST Client for Elastic Search 6.2.2. Suppose that I have two documents in index "DOCUMENTS" with type "DOCUMENTS" that are { "_id": 1, "Name": "John", "FunFacts": { "FavColor": "Green", "Age": 32 } }, { "_id": 2, "Name": "Amy", "FunFacts": { "FavFood": "Pizza", "Age": 33 } } I want to find out all of the distinct fun facts and their distinct values, ultimately returning an end result of { "FavColor": ["Green"], "Age": [32, 33], "FavFood": ["Pizza"] } It is ok for