# BUG: Ignore unmapped is not working in geo polygon query (ES 8.15.5)

**URL:** <https://discuss.elastic.co/t/bug-ignore-unmapped-is-not-working-in-geo-polygon-query-es-8-15-5/382878>\
**Category:** Elasticsearch\
**Created:** [October 22, 2025, 9:48am UTC](https://discuss.elastic.co/t/bug-ignore-unmapped-is-not-working-in-geo-polygon-query-es-8-15-5/382878 "2025-10-22T09:48:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ma\_br](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ma_br/32/145465_2.png) [@ma\_br](https://discuss.elastic.co/u/ma_br)\
**Post date:** [October 22, 2025, 9:48am UTC](https://discuss.elastic.co/t/bug-ignore-unmapped-is-not-working-in-geo-polygon-query-es-8-15-5/382878/1 "2025-10-22T09:48:05Z")

</div>

my goal is to replace some deprecated geo\_polygon queries with geo\_shape queries. And because some of the geo shape can get big, i want to use indexed shapes

**old** query:

```auto
GET /entity_*/_search
{
  "query": {
    "nested": {
      "query": {
        "bool": {
          "must": [
            {
              "geo_polygon": {
                "DU.location_position": {
                  "points": [
                    [
                      -169.40208435058594,
                      -3.1404058933258057
                    ],
                    [
                      -169.40208435058594,
                      83.99121856689453
                    ],
                    [
                      20.51266860961914,
                      83.99121856689453
                    ],
                    [
                      20.51266860961914,
                      -3.1404058933258057
                    ],
                    [
                      -169.40208435058594,
                      -3.1404058933258057
                    ]
                  ]
                },
                "ignore_unmapped": true
              }
            }
          ]
        }
      },
      "path": "DU"
    }
  }
}

```

This is how my **new** query looks like:

```auto
GET /entity_*/_search
{
  "query": {
    "nested": {
      "query": {
        "bool": {
          "must": [
            {
              "geo_shape": {
                "DU.location_position": {
                  "indexed_shape": {
                    "id": "1",
                    "index": "cached_polygon",
                    "path": "shape"
                  },
                  "relation": "within"
                },
                "ignore_unmapped": true
              }
            }
          ]
        }
      },
      "path": "DU"
    }
  }
}

```

for all index where the field "DU.location\_position" **not** exists i got an error

```auto
"reason": {
          "type": "query_shard_exception",
          "reason": "failed to find type for field [DU.location_position]",
          "index_uuid": "m2vv83hVRWOIoPc_8bqXfQ",
          "index": "entity_xyz"
        }

```

Remarks:

- in the old query version with “geo\_polygon” the failures are only happening if i set ignore unmapped to false. if i set it to true the failures go away
- i would expect setting “ignore\_unmapped” to true would ignore unmapped in the new “geo\_shape” like in the old “geo\_polygon“

ES version: 8.15.5

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [October 22, 2025, 10:27am UTC](https://discuss.elastic.co/t/bug-ignore-unmapped-is-not-working-in-geo-polygon-query-es-8-15-5/382878/2 "2025-10-22T10:27:33Z")

</div>

Thanks for flagging @ma_br! Welcome to the community. Have you raised a GitHub issue for this bug?

Let me know!

---

<div class="post-metadata">

**Author:** ![ma\_br](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ma_br/32/145465_2.png) [@ma\_br](https://discuss.elastic.co/u/ma_br)\
**Post date:** [October 22, 2025, 12:30pm UTC](https://discuss.elastic.co/t/bug-ignore-unmapped-is-not-working-in-geo-polygon-query-es-8-15-5/382878/3 "2025-10-22T12:30:59Z")

</div>

> <https://github.com/elastic/elasticsearch/issues/136954>
>
> \### Elasticsearch Version
> 
> 8.15.5
> 
> \### Installed Plugins
> 
> \_No response\_
> 
> \### Jav…a Version
> 
> \_bundled\_
> 
> \### OS Version
> 
> kubernetes ("name": "Linux","pretty\_name": "Ubuntu 20.04.6 LTS","arch": "amd64","version": "5.15.0-156-generic")
> 
> \### Problem Description
> 
> \*\*Index setup:\*\*
> we have multiple index inside the system and all have a nested "DU" inside of it, but not all DU have the field "DU.location\_position"
> 
> Example mapping
> \`\`\`
> {
> "entity\_xyz": {
> "mappings": {
> "DU.location\_position": {
> "full\_name": "DU.location\_position",
> "mapping": {
> "location\_position": {
> "type": "geo\_point"
> }
> }
> }
> }
> }
> }
> \`\`\`
> 
> 
> my goal is to replace some deprecated geo\_polygon queries with geo\_shape queries. And because some of the geo shape can get big, i want to use indexed shapes
> 
> 
> \*\*old query:\*\*
> 
> \`\`\`
> GET /entity\_\*/\_search
> {
> "query": {
> "nested": {
> "query": {
> "bool": {
> "must": \[
> {
> "geo\_polygon": {
> "DU.location\_position": {
> "points": \[
> \[
> -169.40208435058594,
> -3.1404058933258057
> \],
> \[
> -169.40208435058594,
> 83.99121856689453
> \],
> \[
> 20.51266860961914,
> 83.99121856689453
> \],
> \[
> 20.51266860961914,
> -3.1404058933258057
> \],
> \[
> -169.40208435058594,
> -3.1404058933258057
> \]
> \]
> },
> \*\*"ignore\_unmapped": true\*\*
> }
> }
> \]
> }
> },
> "path": "DU"
> }
> }
> }
> \`\`\`
> 
> \*\*This is how my new query looks like:\*\*
> 
> \`\`\`
> GET /entity\_\*/\_search
> {
> "query": {
> "nested": {
> "query": {
> "bool": {
> "must": \[
> {
> "geo\_shape": {
> "DU.location\_position": {
> "indexed\_shape": {
> "id": "1",
> "index": "cached\_polygon",
> "path": "shape"
> },
> "relation": "within"
> },
> \*\*"ignore\_unmapped": true\*\*
> }
> }
> \]
> }
> },
> "path": "DU"
> }
> }
> }
> \`\`\`
> 
> for all index where the field "DU.location\_position" not exists i got an error
> 
> \`\`\`
> "reason": {
> "type": "query\_shard\_exception",
> "reason": "failed to find type for field \[DU.location\_position\]",
> "index\_uuid": "m2vv83hVRWOIoPc\_8bqXfQ",
> "index": "entity\_xyz"
> }
> \`\`\`
> 
> \*\*Remarks:\*\*
> \- in the old query version with “geo\_polygon” the failures are only happening if i set ignore unmapped to false. if i set it to true the failures go away
> \- i would expect setting “ignore\_unmapped” to true would ignore unmapped in the new “geo\_shape” like in the old “geo\_polygon“
> \- maybe the problem is triggered because of the "nested" part?
> 
> ES version: 8.15.5
> 
> \### Steps to Reproduce
> 
> 1. create index\_name1 with a nested document and inside a field of type geo\_point
> 2. create index\_name2 with a nested document and the field is missing
> 3. execute a geo\_shape search over both index (e.g. index\_\*)
> 
> \### Logs (if relevant)
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [October 22, 2025, 3:27pm UTC](https://discuss.elastic.co/t/bug-ignore-unmapped-is-not-working-in-geo-polygon-query-es-8-15-5/382878/4 "2025-10-22T15:27:08Z")

</div>

It is indeed a bug. I opened [Fix ignore\_unmapped setting when using geo\_shape query with a pre-indexed shape by iverase · Pull Request #136961 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/pull/136961)
