# Failed to parse mapping via JS, but not via Curl

**URL:** <https://discuss.elastic.co/t/failed-to-parse-mapping-via-js-but-not-via-curl/62212>\
**Category:** Elasticsearch\
**Created:** [October 4, 2016, 7:42pm UTC](https://discuss.elastic.co/t/failed-to-parse-mapping-via-js-but-not-via-curl/62212 "2016-10-04T19:42:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee\_Gee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lee_gee/32/1217_2.png) [@Lee\_Gee](https://discuss.elastic.co/u/Lee_Gee)\
**Post date:** [October 4, 2016, 7:42pm UTC](https://discuss.elastic.co/t/failed-to-parse-mapping-via-js-but-not-via-curl/62212/1 "2016-10-04T19:42:36Z")

</div>

When I send my schema via JS, I get:

```
 Failed to parse mapping [posting]: analyzer [toy_analyzer] not found for field [message]

```

When I have the script print out the schema, and copy it into a curl request, I get:

```
{"acknowledged" : true}

```

I've been looking at this for too long to see any error — please help!

The mapping is below, and pretty much came from the ES site.

The code to send it worked until I added filters earlier...

```
 client.indices.create({ index: $index, body: $schemaBody });

```

$schemaBody =  
{  
"settings": {  
"number\_of\_shards": 1,  
"number\_of\_replicas": 0,  
"index": {  
"analysis": {  
"filter": {  
"english\_stop": {  
"type": "stop",  
"stopwords": "_english_"  
},  
"english\_stemmer": {  
"type": "stemmer",  
"language": "english"  
},  
"english\_possessive\_stemmer": {  
"type": "stemmer",  
"language": "possessive\_english"  
}  
},  
"analyzer": {  
"toy\_analyzer": {  
"tokenizer": "standard",  
"filter": [  
"asciifolding",  
"english\_possessive\_stemmer",  
"lowercase",  
"english\_stop",  
"english\_stemmer"  
]  
}  
}  
}  
}  
},  
"mappings": {  
"user": {  
"properties": {  
"id": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false  
},  
"source": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false  
},  
"idfromsite": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false  
},  
"location": {  
"type": "string",  
"analyzer": "toy\_analyzer",  
"include\_in\_all": true  
}  
}  
},  
"posting": {  
"properties": {  
"id": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false  
},  
"userid": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false  
},  
"source": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false  
},  
"idfromsite": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false  
},  
"type": {  
"type": "string",  
"index": "not\_analyzed",  
"include\_in\_all": false  
},  
"created": {  
"type": "date",  
"index": "not\_analyzed",  
"include\_in\_all": false  
},  
"message": {  
"type": "string",  
"analyzer": "toy\_analyzer",  
"include\_in\_all": true  
},  
"story": {  
"type": "string",  
"analyzer": "toy\_analyzer",  
"include\_in\_all": true  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![Lee\_Gee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lee_gee/32/1217_2.png) [@Lee\_Gee](https://discuss.elastic.co/u/Lee_Gee)\
**Post date:** [October 5, 2016, 8:00am UTC](https://discuss.elastic.co/t/failed-to-parse-mapping-via-js-but-not-via-curl/62212/2 "2016-10-05T08:00:19Z")

</div>

I deleted and re-entered the code, and now it seems to work — I guess it was just a typo.

How can I delete this post?

TIA  
Lee

---

<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 5, 2017, 10:14pm UTC](https://discuss.elastic.co/t/failed-to-parse-mapping-via-js-but-not-via-curl/62212/3 "2017-07-05T22:14:53Z")

</div>


