# Error creating a document with pinyin-plugin in es 6.0.0

**URL:** <https://discuss.elastic.co/t/error-creating-a-document-with-pinyin-plugin-in-es-6-0-0/116788>\
**Category:** Elasticsearch\
**Created:** [January 24, 2018, 2:57am UTC](https://discuss.elastic.co/t/error-creating-a-document-with-pinyin-plugin-in-es-6-0-0/116788 "2018-01-24T02:57:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![idiotslkp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idiotslkp/32/28553_2.png) [@idiotslkp](https://discuss.elastic.co/u/idiotslkp)\
**Post date:** [January 24, 2018, 2:57am UTC](https://discuss.elastic.co/t/error-creating-a-document-with-pinyin-plugin-in-es-6-0-0/116788/1 "2018-01-24T02:57:25Z")

</div>

When I use es 6.0.0 creating a document with pinyin-puigin,it will cause error:  
{  
"error": {  
"root\_cause": [  
{  
"type": "illegal\_argument\_exception",  
"reason": "startOffset must be non-negative, and endOffset must be \>= startOffset, and offsets must not go backwards startOffset=0,endOffset=27,lastStartOffset=25 for field 'standardName.pinyin'"  
}  
],  
"type": "illegal\_argument\_exception",  
"reason": "startOffset must be non-negative, and endOffset must be \>= startOffset, and offsets must not go backwards startOffset=0,endOffset=27,lastStartOffset=25 for field 'standardName.pinyin'"  
},  
"status": 400  
}

And the pinyin-plugin address:

> **[medcl/elasticsearch-analysis-pinyin](https://github.com/medcl/elasticsearch-analysis-pinyin/tree/v6.0.0)**
>
> elasticsearch-analysis-pinyin - This Pinyin Analysis plugin is used to do conversion between Chinese characters and Pinyin.

my testing mapping is:  
PUT test  
{  
"index": {  
"analysis": {  
"analyzer": {  
"pinyin\_analyzer": {  
"tokenizer": "my\_pinyin"  
}  
},  
"tokenizer": {  
"my\_pinyin": {  
"type": "pinyin",  
"keep\_separate\_first\_letter": false,  
"keep\_full\_pinyin": true,  
"keep\_original": true,  
"limit\_first\_letter\_length": 16,  
"lowercase": true,  
"remove\_duplicated\_term": true  
}  
}  
}  
}  
}

POST test/test\_type/\_mapping  
{  
"test\_type": {  
"properties": {  
"standardName": {  
"type": "keyword",  
"fields": {  
"pinyin": {  
"type": "text",  
"store": false,  
"term\_vector": "with\_offsets",  
"analyzer": "pinyin\_analyzer",  
"boost": 10  
}  
}  
}  
}  
}  
}

Now,when I post following data more than 5,the error will occur:  
POST test/test\_type  
{  
"standardName": "居住区大气中苯、甲苯和二甲苯卫生检验标准方法气相色谱法"  
}

---

<div class="post-metadata">

**Author:** ![idiotslkp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idiotslkp/32/28553_2.png) [@idiotslkp](https://discuss.elastic.co/u/idiotslkp)\
**Post date:** [January 24, 2018, 4:10am UTC](https://discuss.elastic.co/t/error-creating-a-document-with-pinyin-plugin-in-es-6-0-0/116788/2 "2018-01-24T04:10:04Z")

</div>

I solve this problom when I use es 6.0.1 and use pinyin-plugin 6.0.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:** [February 21, 2018, 4:10am UTC](https://discuss.elastic.co/t/error-creating-a-document-with-pinyin-plugin-in-es-6-0-0/116788/3 "2018-02-21T04:10:22Z")

</div>

Closed on February 21, 2018, 4:10am UTC

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