# ES Field Capabilities API does not return non-indexed/disabled fields when include\_unmapped=true

**URL:** <https://discuss.elastic.co/t/es-field-capabilities-api-does-not-return-non-indexed-disabled-fields-when-include-unmapped-true/320810>\
**Category:** Elasticsearch\
**Created:** [December 8, 2022, 4:34pm UTC](https://discuss.elastic.co/t/es-field-capabilities-api-does-not-return-non-indexed-disabled-fields-when-include-unmapped-true/320810 "2022-12-08T16:34:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alsheh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alsheh/32/36799_2.png) [@Alsheh](https://discuss.elastic.co/u/Alsheh)\
**Post date:** [December 8, 2022, 4:34pm UTC](https://discuss.elastic.co/t/es-field-capabilities-api-does-not-return-non-indexed-disabled-fields-when-include-unmapped-true/320810/1 "2022-12-08T16:34:45Z")

</div>

Hi,

I'm trying to list all fields in a certain index, indexed and non-indexed fields. I'm using the ES Field capabilities API: `GET <index-name>/_field_caps?fields=*&include_unmapped=true`. However, the API is not returning non-indexed fields. Is there a way to make the API return both indexed and non-indexed fields?

Elasticsearch version: `7.16.2`

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [December 8, 2022, 6:47pm UTC](https://discuss.elastic.co/t/es-field-capabilities-api-does-not-return-non-indexed-disabled-fields-when-include-unmapped-true/320810/2 "2022-12-08T18:47:38Z")

</div>

Hi @Alsheh

I did the test below (ES 7.16.2):

```auto
PUT idx_fields
{
  "mappings": {
    "properties": {
      "name": {
        "type": "text"
      },
      "name_not_index":{
        "type": "text", 
        "index": false
      }
    }
  }
}

POST idx_fields/_doc
{
  "unmapped_name": "any"
}

GET idx_fields/_field_caps?include_unmapped=true&fields=*

```

Return all fields:

```auto
   "name_not_index" : {
      "text" : {
        "type" : "text",
        "metadata_field" : false,
        "searchable" : false,
        "aggregatable" : false
      }
    },
    "name" : {
      "text" : {
        "type" : "text",
        "metadata_field" : false,
        "searchable" : true,
        "aggregatable" : false
      }
    },
    "unmapped_name" : {
      "text" : {
        "type" : "text",
        "metadata_field" : false,
        "searchable" : true,
        "aggregatable" : false
      }
    }

```

---

<div class="post-metadata">

**Author:** ![Alsheh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alsheh/32/36799_2.png) [@Alsheh](https://discuss.elastic.co/u/Alsheh)\
**Post date:** [December 9, 2022, 2:33pm UTC](https://discuss.elastic.co/t/es-field-capabilities-api-does-not-return-non-indexed-disabled-fields-when-include-unmapped-true/320810/3 "2022-12-09T14:33:31Z")

</div>

@RabBit_BR Thanks for your response! I'm hoping to also include fields inside disabled objects but those don't show up:

```auto
PUT idx_fields
{
  "mappings": {
    "properties": {
      "name": {
        "type": "text"
      },
      "object_not_index":{
        "type": "object", 
        "enabled": false
      }
    }
  }
}
POST idx_fields/_doc
{
  "unmapped_name": "any",
  "object_not_index": {
    "a": 1
  }
}
GET idx_fields/_field_caps?include_unmapped=true&fields=*

```

`object_not_index.a` is missing from the response:

```auto
{
  "indices" : [
    "idx_fields"
  ],
  "fields" : {
   ...
   "name" : {
      "text" : {
        "type" : "text",
        "metadata_field" : false,
        "searchable" : true,
        "aggregatable" : false
      }
    },
    "unmapped_name" : {
      "text" : {
        "type" : "text",
        "metadata_field" : false,
        "searchable" : true,
        "aggregatable" : false
      }
    },
    "unmapped_name.keyword" : {
      "keyword" : {
        "type" : "keyword",
        "metadata_field" : false,
        "searchable" : true,
        "aggregatable" : true
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [December 9, 2022, 8:07pm UTC](https://discuss.elastic.co/t/es-field-capabilities-api-does-not-return-non-indexed-disabled-fields-when-include-unmapped-true/320810/4 "2022-12-09T20:07:21Z")

</div>

Maybe there is this limitation.

---

<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:** [January 6, 2023, 8:07pm UTC](https://discuss.elastic.co/t/es-field-capabilities-api-does-not-return-non-indexed-disabled-fields-when-include-unmapped-true/320810/5 "2023-01-06T20:07:40Z")

</div>

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