# Is there a way to get indexed data?

**URL:** <https://forum.opensearch.org/t/is-there-a-way-to-get-indexed-data/15414>\
**Category:** OpenSearch\
**Created:** [August 4, 2023, 12:32am UTC](https://forum.opensearch.org/t/is-there-a-way-to-get-indexed-data/15414 "2023-08-04T00:32:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuryf-bq](https://avatars.discourse-cdn.com/v4/letter/y/c4cdca/32.png) [@yuryf-bq](https://forum.opensearch.org/u/yuryf-bq)\
**Post date:** [August 4, 2023, 12:32am UTC](https://forum.opensearch.org/t/is-there-a-way-to-get-indexed-data/15414/1 "2023-08-04T00:32:51Z")

</div>

Hello! Is there a way to request a field in a normalized form?  
For example, for a mapping `{"mappings" : { "properties" : { "fieldA" : "integer"} } }` and indexed documents `{ "fieldA" : "42" }` and `{ "fieldA" : 43 }`, how can I get values of `fieldA` in both documents as an integer?

---

<div class="post-metadata">

**Author:** ![gaobinlong](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/gaobinlong/32/5242_2.png) [@gaobinlong](https://forum.opensearch.org/u/gaobinlong)\
**Post date:** [August 4, 2023, 2:13am UTC](https://forum.opensearch.org/t/is-there-a-way-to-get-indexed-data/15414/2 "2023-08-04T02:13:30Z")

</div>

You can use `script_fields` to achieve that:

```auto
GET test11/_search
{
  "script_fields": {
    "a": {
      "script": {
        "lang": "expression",
        "source": "doc['fieldA']"
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![yuryf-bq](https://avatars.discourse-cdn.com/v4/letter/y/c4cdca/32.png) [@yuryf-bq](https://forum.opensearch.org/u/yuryf-bq)\
**Post date:** [August 4, 2023, 2:29am UTC](https://forum.opensearch.org/t/is-there-a-way-to-get-indexed-data/15414/3 "2023-08-04T02:29:27Z")

</div>

Thanks @gaobinlong !

---

<div class="post-metadata">

**Author:** ![yuryf-bq](https://avatars.discourse-cdn.com/v4/letter/y/c4cdca/32.png) [@yuryf-bq](https://forum.opensearch.org/u/yuryf-bq)\
**Post date:** [August 4, 2023, 2:37am UTC](https://forum.opensearch.org/t/is-there-a-way-to-get-indexed-data/15414/4 "2023-08-04T02:37:28Z")

</div>

Unfortunately, this doesn’t work with `geo_point`.

---

<div class="post-metadata">

**Author:** ![yuryf-bq](https://avatars.discourse-cdn.com/v4/letter/y/c4cdca/32.png) [@yuryf-bq](https://forum.opensearch.org/u/yuryf-bq)\
**Post date:** [August 4, 2023, 2:48am UTC](https://forum.opensearch.org/t/is-there-a-way-to-get-indexed-data/15414/5 "2023-08-04T02:48:05Z")

</div>

I spent a lot of time of googling before, but today I got a very easy working solution:

```json
{
  "fields" : [
    "fieldA"
  ],
  "_source" : false
}

```

This works with both integer and geo\_point types.  
Anyway I much appreciate your time.
