# Elastic mapping not working

**URL:** <https://discuss.elastic.co/t/elastic-mapping-not-working/108513>\
**Category:** Elasticsearch\
**Created:** [November 21, 2017, 5:36am UTC](https://discuss.elastic.co/t/elastic-mapping-not-working/108513 "2017-11-21T05:36:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shekhar\_Pandey](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shekhar\_Pandey](https://discuss.elastic.co/u/Shekhar_Pandey)\
**Post date:** [November 21, 2017, 5:36am UTC](https://discuss.elastic.co/t/elastic-mapping-not-working/108513/1 "2017-11-21T05:36:31Z")

</div>

I have one mapping which details are given below:

```auto
PUT my_index
{
  "mappings": {
    "product": {
      "properties": {
        "search_data": {
          "type": "nested",
          "properties":{
            "string_facet":{
              "type":"nested",
              "properties":{
                "facet_name":{
                  "type":"text"
                },
                "facet_value":{
                  "type":"text"
                }
              }
            }
          }
        }
      }
    }
  }
}

```

And I want to put my this below json array data to above mapping so that...it will comes under the search\_data array...

```auto
PUT my_index/product/1
{
  "string_facet": [
        {
          "facet-name": "manufacturer",
          "facet-value": "Fortis"
        },
        {
          "facet-name": "hammer_weight",
          "facet-value": "1000"
        }
    ]
  
}

```

But after index...i got result like this...my json document is not going inside of the search\_data...can anyone tell me where my mapping is wrong.

```auto
"hits": {
    "total": 1,
    "max_score": 1,
    "hits": [
      {
        "_index": "my_index",
        "_type": "product",
        "_id": "1",
        "_score": 1,
        "_source": {
          "string_facet": [
            {
              "facet-name": "manufacturer",
              "facet-value": "Fortis"
            },
            {
              "facet-name": "hammer_weight",
              "facet-value": "1000"
            }
          ]
        }
      }
    ]
  }
}

```

Thank you.

---

<div class="post-metadata">

**Author:** ![Shekhar\_Pandey](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shekhar\_Pandey](https://discuss.elastic.co/u/Shekhar_Pandey)\
**Post date:** [November 21, 2017, 7:39am UTC](https://discuss.elastic.co/t/elastic-mapping-not-working/108513/2 "2017-11-21T07:39:03Z")

</div>

I got my error.....I corrected this problem....Thanks

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [November 21, 2017, 1:44pm UTC](https://discuss.elastic.co/t/elastic-mapping-not-working/108513/3 "2017-11-21T13:44:48Z")

</div>

Please share the solution so that future readers will know what the issue was.

---

<div class="post-metadata">

**Author:** ![Shekhar\_Pandey](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shekhar\_Pandey](https://discuss.elastic.co/u/Shekhar_Pandey)\
**Post date:** [November 22, 2017, 4:54am UTC](https://discuss.elastic.co/t/elastic-mapping-not-working/108513/4 "2017-11-22T04:54:28Z")

</div>

Hi jpountz!..

My error was , I not created any search\_data in the logstash but in mapping I am using that object name in mapping...so my mapping was not woking...but when i did my error correction in logstash like this..

```
mutate {
      rename => { "full_text" => "[search_data][full_text]" }
      rename => { "full_text_boosted" => "[search_data][full_text_boosted]" }
      rename => { "string_facet" => "[search_data][string_facet]" }
      }

```

Then its working...because now I am giving elasticsearch to command search\_data to index...in which my other data are there...and when they reach to elasticsearch for index, it match with mapping....and I am getting result like this...as I want...

```
 "search_data" : {
            "full_text_boosted" : "179520 10000003368 sony handycam hxr mc1500p Electronics SONY",
            "completion_terms" : [
              "sony",
              "handycam",
              "hxr",
              "mc1500p"
            ],
            "scores" : {
              "cat_score" : 0.8999999761581421
            },
            "full_text" : "",
            "string_facet" : [
              {
                "facet-value" : "Electronics",
                "facet-name" : "category"
              }
}

```

Hope this will useful for you and other people..

Thanks

---

<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:** [December 20, 2017, 4:55am UTC](https://discuss.elastic.co/t/elastic-mapping-not-working/108513/5 "2017-12-20T04:55:16Z")

</div>

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