and i want to go over all the info types and create the following:
Kuku: [123, 678]
Kuku2: [213]
I wanted to ask if its possible to create this with one query?
A query that will go over all the info types and each time take the name field and add the id field to a list by its name field
While it doesn't give you a flat table, a terms aggregation nested in another terms aggregation would give you what you want in a single request. Assuming the name and id fields are mapped as type keyword, or have fielddata enabled, the following request:
Some things to be aware of here: because of the "size": 100 you will only get the 100 most common names and IDs. You can change the size parameter if you need more or less values. Also, The values are ranked by popularity (how common they are - based on the doc_count). If you want, you can order the results differently.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.