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

Multi tool use


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.
region
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
1 Answer
1
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:
,
"type": "long",
}
PUT region
{
"mappings": {
"doc": {
"properties": {
"catalog_product_id": {
"type": "long"
},
"id": {
"type": "long"
},
"region_id":{
"type": "text"
},
"region_type":{
"type" : "text"
}
}
}
}
}
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
try to check your json for validity of any online service and you will find an error
– Oleg SH
8 hours ago