Karthikeyan
Karthikeyan

Reputation: 2001

Elastic search error - was expecting double-quote to start field name

Am trying to create a mapping for my new index named as region. Please find my below mapping file.

PUT region
 {
    "mappings": {
      "doc": {
        "properties": {
          "catalog_product_id": {
            "type": "long",
          },
          "id": {
            "type": "long"
          },
          "region_id":{
          "type": "text"
          },
          "region_type":{
          "type" : "text"
          }
         }

        }
       }
      }
 }

While am trying to execute this mapping script am getting the below error

was expecting double-quote to start field name

Upvotes: 2

Views: 16223

Answers (1)

Enayat
Enayat

Reputation: 4042

I have double checked your mapping with my Kibana, and it seems that there is a parsing error on the JSON format. Remove , after "type": "long", and remove one of } from the end, as follows:

PUT region
 {
    "mappings": {
      "doc": {
        "properties": {
          "catalog_product_id": {
            "type": "long"
          },
          "id": {
            "type": "long"
          },
          "region_id":{
            "type": "text"
          },
          "region_type":{
            "type" : "text"
          }
        }
      }
    }
 }

Upvotes: 5

Related Questions