# Get all field names / mappings for a specific query

**URL:** <https://discuss.elastic.co/t/get-all-field-names-mappings-for-a-specific-query/148655>\
**Category:** Elasticsearch\
**Created:** [September 14, 2018, 4:38pm UTC](https://discuss.elastic.co/t/get-all-field-names-mappings-for-a-specific-query/148655 "2018-09-14T16:38:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hello](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hello](https://discuss.elastic.co/u/hello)\
**Post date:** [September 14, 2018, 4:38pm UTC](https://discuss.elastic.co/t/get-all-field-names-mappings-for-a-specific-query/148655/1 "2018-09-14T16:38:32Z")

</div>

Say I have clothing types that each have shared and distinct mappings. I can get all of the field mappings using the get mapping API. It seems prior to ES 5, we used to be able to aggregate on \_field\_names in order to get mappings for a particular query. Since this is no longer possible, what is the best way to get this data?

I want to get the mappings for the following query:

```
{ "query": { "bool": { "filter": { "term": { "type": "shirt" } } } } }

```

What is the best way to go about accomplishing this?

Thanks

---

<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:** [October 25, 2018, 4:24am UTC](https://discuss.elastic.co/t/get-all-field-names-mappings-for-a-specific-query/148655/3 "2018-10-25T04:24:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
