# Mapping an object field in order to show in the Kibana discover

**URL:** https://discuss.elastic.co/t/mapping-an-object-field-in-order-to-show-in-the-kibana-discover/336843
**Category:** Kibana
**Tags:** discover
**Created:** [June 25, 2023, 4:33pm UTC](https://discuss.elastic.co/t/mapping-an-object-field-in-order-to-show-in-the-kibana-discover/336843 "2023-06-25T16:33:58Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![JasonREC](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@JasonREC](https://discuss.elastic.co/u/JasonREC)
#### Post date: [June 25, 2023, 4:33pm UTC](https://discuss.elastic.co/t/mapping-an-object-field-in-order-to-show-in-the-kibana-discover/336843/1 "2023-06-25T16:33:58Z")

</div>

HI, I have a field called "unqiue\_db\_tag" in my document.

somehow it does not show on the table but only on JSON

I looked at other discussion says it could be due to this field is not yet dont the mapping since I add this field by enrich processor.

If I would like to map this field so that It will show up on the discover left search bar and on the table.

Is my below mapping correct?

this is the field:  
 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/4/1/41a954bf84d860572f0caa9f9ec70def262d9636.png)

PUT index/\_mapping  
{

```
"properties": {
  "unqiue_db_tag": {
    "type": "object",
    "properties": {
      "codeNumCount": {
        "type": "long"
      },
      "brandIdCount": {
        "type": "long"
      },
      "region": {
        "type": "keyword"
      },
      "deviceId": {
        "type": "long"
      },
      "db_tag": {
        "type": "keyword"
      }
    }
  }
}

```

}

 ![only](https://us1.discourse-cdn.com/elastic/original/3X/5/0/50dabb70848b0c223e16a3ff8427142f33ba4edf.png)

 ![unique_db_field](https://us1.discourse-cdn.com/elastic/original/3X/0/5/0582367a83392ca0048eefda11139cf00d471868.png)

could anyone help?

---

<div class="post-metadata">

### Author: ![Sunile\_Manjee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunile_manjee/32/111461_2.png) [@Sunile\_Manjee](https://discuss.elastic.co/u/Sunile_Manjee)
#### Post date: [June 30, 2023, 4:39am UTC](https://discuss.elastic.co/t/mapping-an-object-field-in-order-to-show-in-the-kibana-discover/336843/2 "2023-06-30T04:39:20Z")

</div>

I'm not entirely sure about that comment that if you added a field to your json doc via enrich processor that the field won't show up in the mapping. Either way if you don't see the object in your mapping, does it exist in \_source? if so, you can create a runtime field in Kibana from source.

Here is an example of runtime field on source

```auto
get myindex/_search
{
  "runtime_mappings": {
    "codeNumCount": {
      "type": "long",
      "script": """
          emit(params._source.unqiue_db_tag.codeNumCount);
          """
    }
  },
  "query": {
    "match_all": {}
  },
  "fields": ["codeNumCount"],
  "_source": false
}

```

---

<div class="post-metadata">

### Author: ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)
#### Post date: [July 10, 2023, 9:37am UTC](https://discuss.elastic.co/t/mapping-an-object-field-in-order-to-show-in-the-kibana-discover/336843/3 "2023-07-10T09:37:11Z")

</div>

Hi @JasonREC,

What is your current value for `discover:searchFieldsFromSource` on Advanced Settings page? And does JSON view include `unqiue_db_tag....` values in `fields` section?

Also it could be that `unqiue_db_tag.*` were set to be excluded based on settings on Stack Management \> Data view \> Field filters page.

---

<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: [August 7, 2023, 9:37am UTC](https://discuss.elastic.co/t/mapping-an-object-field-in-order-to-show-in-the-kibana-discover/336843/4 "2023-08-07T09:37:31Z")

</div>

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