# How to get keyword subfields from Open Search using SQL API

**URL:** <https://forum.opensearch.org/t/how-to-get-keyword-subfields-from-open-search-using-sql-api/7381>\
**Category:** SQL\
**Created:** [October 21, 2021, 1:22pm UTC](https://forum.opensearch.org/t/how-to-get-keyword-subfields-from-open-search-using-sql-api/7381 "2021-10-21T13:22:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TamilRaja](https://avatars.discourse-cdn.com/v4/letter/t/5f8ce5/32.png) [@TamilRaja](https://forum.opensearch.org/u/TamilRaja)\
**Post date:** [October 21, 2021, 1:22pm UTC](https://forum.opensearch.org/t/how-to-get-keyword-subfields-from-open-search-using-sql-api/7381/1 "2021-10-21T13:22:49Z")

</div>

Am using AWS Open Search server ,end point v1.0.0

I have created a sample table and declared the text columns with “keyword” type as below:

```auto
"mappings": {
            "properties": {
                "color": {
                    "type": "text",
                    "fields": {
                        "keyword": {
                            "type": "keyword",
                            "ignore_above": 256
                        }
                    }
                },
                "name": {
                    "type": "text",
                    "fields": {
                        "keyword": {
                            "type": "keyword",
                            "ignore_above": 256
                        }
                    }
                }
            }
        }
    }

```

In default mapping, you can see the type as both text and keyword.

But while retrieving column information using Open Search SQL API, only text type fields are returned from API like the below-mentioned image.

 ![MicrosoftTeams-image (30)](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/0/07a1e9258d520a6246017c1c204aaf146c02805d.png)

I need “.keyword” fields from the AWS Open Search server.

But the same case in Elastic search server return fields including the “.keyword” fields

Please share any idea to get “.keyword” fields from the AWS Open Search server

---

<div class="post-metadata">

**Author:** ![shivacharan](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@shivacharan](https://forum.opensearch.org/u/shivacharan)\
**Post date:** [September 28, 2022, 6:55pm UTC](https://forum.opensearch.org/t/how-to-get-keyword-subfields-from-open-search-using-sql-api/7381/2 "2022-09-28T18:55:07Z")

</div>

Hii @TamilRaja have you got answer to this.? Iam also facing the same issue
