# Unknown key \[productid\] for create index

**URL:** <https://discuss.elastic.co/t/unknown-key-productid-for-create-index/236581>\
**Category:** Elasticsearch\
**Created:** [June 10, 2020, 8:54pm UTC](https://discuss.elastic.co/t/unknown-key-productid-for-create-index/236581 "2020-06-10T20:54:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hariskhalique](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@hariskhalique](https://discuss.elastic.co/u/hariskhalique)\
**Post date:** [June 10, 2020, 8:54pm UTC](https://discuss.elastic.co/t/unknown-key-productid-for-create-index/236581/1 "2020-06-10T20:54:49Z")

</div>

Hi following are my mapping

```
	{
  "dynamic" : "true",
  "_meta" : { },
  "_source" : {
    "includes" : [],
    "excludes" : []
  },
  "dynamic_date_formats" : [
    "strict_date_optional_time",
    "yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"
  ],
  "dynamic_templates" : [],
  "date_detection" : true,
  "numeric_detection" : false,
  "properties" : {
    "brand_tile" : {
      "type" : "text",
      "fields" : {
        "brand_tile" : {
          "type" : "keyword"
        }
      }
    },
    "dateStamp" : {
      "type" : "date"
    },
    "email" : {
      "type" : "keyword"
    },
    "event_title" : {
      "type" : "keyword",
      "fields" : {
        "event_title" : {
          "type" : "text"
        }
      }
    },
    "ip_address" : {
      "type" : "ip"
    },
    "location" : {
      "type" : "geo_point"
    },
    "order_number" : {
      "type" : "text",
      "fields" : {
        "order_number" : {
          "type" : "keyword"
        }
      }
    },
    "order_price" : {
      "type" : "float"
    },
    "product_name" : {
      "type" : "text",
      "fields" : {
        "product_name" : {
          "type" : "keyword"
        }
      }
    },
    "productid" : {
      "type" : "long"
    },
    "session_id" : {
      "type" : "text",
      "fields" : {
        "session_id" : {
          "type" : "keyword"
        }
      }
    },
    "userid" : {
      "type" : "long"
    },
    "variatns" : {
      "properties" : {
        "SKU" : {
          "type" : "keyword"
        },
        "color" : {
          "type" : "keyword"
        },
        "size" : {
          "type" : "keyword"
        }
      }
    }
  }}

```

I am trying to create index using dev tool here is how I am doing it

```
	PUT event-tracking
	{
	  "email": "referal_register_test10@yopmail.com",
	  "event_title": "register",
	  "ip_address": "::1",
	  "session_id": "cd9c12be-ba89-eac0-840c-1396a24d9d44",
	  "userid": 23453,
	  "brand_title": "",
	  "productid": 897,
	  "location": {}}

```

I am getting following error

> unknown key [productid] for create index

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Coinology](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Coinology](https://discuss.elastic.co/u/Coinology)\
**Post date:** [June 10, 2020, 11:36pm UTC](https://discuss.elastic.co/t/unknown-key-productid-for-create-index/236581/2 "2020-06-10T23:36:26Z")

</div>

> [@hariskhalique](#):
>
> `PUT event-tracking`

@hariskhalique Rather than this, try to use `POST /event-tracking/_doc/`

`PUT` requires an ID such as `PUT /event-tracking/_doc/1`

---

<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:** [July 8, 2020, 11:36pm UTC](https://discuss.elastic.co/t/unknown-key-productid-for-create-index/236581/3 "2020-07-08T23:36:27Z")

</div>

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