# Need to get all the columns with the same name

**URL:** <https://discuss.elastic.co/t/need-to-get-all-the-columns-with-the-same-name/14168>\
**Category:** Elasticsearch\
**Created:** [October 30, 2013, 10:09am UTC](https://discuss.elastic.co/t/need-to-get-all-the-columns-with-the-same-name/14168 "2013-10-30T10:09:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul1/32/46819_2.png) [@paul1](https://discuss.elastic.co/u/paul1)\
**Post date:** [October 30, 2013, 10:09am UTC](https://discuss.elastic.co/t/need-to-get-all-the-columns-with-the-same-name/14168/1 "2013-10-30T10:09:00Z")

</div>

I need to get all the "progName"for a given institute below is sample data  
in my ES

"programs":[  
{  
"totBachelorsProgs":"10",  
"subs":[  
{  
"totBachelorsProgs":"7",  
"subs":[  
{  
"totBachelorsProgs":"7",  
"subs":[

```
                 ],
                 "totAssociateProgs":"-",
                 "progName":"Drawing"
              }
           ],
           "totAssociateProgs":"-",
           "progName":"Fine Arts"
        },
        {
           "totBachelorsProgs":"3",
           "subs":[
              {
                 "totBachelorsProgs":"3",
                 "subs":[

                 ],
                 "totAssociateProgs":"-",
                 "progName":"Music History and Literature"
              }
           ],
           "totAssociateProgs":"-",
           "progName":"Music"
        }
     ],
     "totAssociateProgs":"-",
     "progName":"Arts"
  },
  {
     "totBachelorsProgs":"39",
     "subs":[
        {
           "totBachelorsProgs":"39",
           "subs":[
              {
                 "totBachelorsProgs":"39",
                 "subs":[

                 ],
                 "totAssociateProgs":"-",
                 "progName":"Biology and Biological Sciences"
              }
           ],
           "totAssociateProgs":"-",
           "progName":"Biology"
        }
     ],
     "totAssociateProgs":"-",
     "progName":"Biological Sciences"
  }

```

]

the below works when i know the object structure

{  
"query": {  
"match": {  
"progName": "Architecture"  
}  
},  
"partial\_fields": {  
"partial1": {  
"include": [  
"programs.progName",  
"programs.subs.progName",  
"programs.subs.subs.progName",  
]  
}  
}  
}

but if one more "subs" section comes up in the data i have to change the  
query. is there i way to get all the field with the same name.without  
traversing into the structure.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:09am UTC](https://discuss.elastic.co/t/need-to-get-all-the-columns-with-the-same-name/14168/2 "2017-07-06T02:09:52Z")

</div>

Closed on July 6, 2017, 2:09am UTC


