# Mapping conflict between object, text, & keyword

**URL:** <https://discuss.elastic.co/t/mapping-conflict-between-object-text-keyword/321343>\
**Category:** Elasticsearch\
**Created:** [December 15, 2022, 7:52pm UTC](https://discuss.elastic.co/t/mapping-conflict-between-object-text-keyword/321343 "2022-12-15T19:52:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![datdoo](https://avatars.discourse-cdn.com/v4/letter/d/ba8739/32.png) [@datdoo](https://discuss.elastic.co/u/datdoo)\
**Post date:** [December 15, 2022, 7:52pm UTC](https://discuss.elastic.co/t/mapping-conflict-between-object-text-keyword/321343/1 "2022-12-15T19:52:01Z")

</div>

I have this mapping currently

```auto
"response": {
          "properties": {
            "body": {
              "properties": {
                "id": {
                  "type": "long"
                },
                "jsonrpc": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                },
                "result": {
                  "properties": {
                    "isBootstrapped": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }

```

The response.body.result is sometimes an object that looks like this

```auto
{
    "jsonrpc": "2.0",
    "result": {
        "isBootstrapped": true
    },
    "id": 1
}

```

Other times the response.body.result is Text/keyword which looks like this.

```auto
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x16951ef"
}

```

Because of this, when Filebeat tries to index some calls an error occurs on this field "object mapping for [response.body.result] tried to parse field [result] as object, but found a concrete value".

How to update mapping to allow all response.body.result logs to be indexed? Both objects and text for this particular field.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 15, 2022, 8:05pm UTC](https://discuss.elastic.co/t/mapping-conflict-between-object-text-keyword/321343/2 "2022-12-15T20:05:51Z")

</div>

That is not possible. You will need to change the structure of your documents of index data with different mappings into different indices.

---

<div class="post-metadata">

**Author:** ![datdoo](https://avatars.discourse-cdn.com/v4/letter/d/ba8739/32.png) [@datdoo](https://discuss.elastic.co/u/datdoo)\
**Post date:** [December 15, 2022, 8:39pm UTC](https://discuss.elastic.co/t/mapping-conflict-between-object-text-keyword/321343/3 "2022-12-15T20:39:59Z")

</div>

Would something like this help in my case just for the response.body.result field?

```auto
{
  "mappings": {
    "properties": {
      "result": {
        "type": "object",
        "enabled": false
      }
    }
  }
}

```

I understand that Kibana won't be able to filter or search for this field but would it help with the error I am seeing in Filebeat?

Also what you said is an interesting solution. Can you please provide some documentation that I can learn more about this method?

---

<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 12, 2023, 8:40pm UTC](https://discuss.elastic.co/t/mapping-conflict-between-object-text-keyword/321343/4 "2023-01-12T20:40:11Z")

</div>

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