# Simple index using word delimiter resulting in startOffset error

**URL:** <https://discuss.elastic.co/t/simple-index-using-word-delimiter-resulting-in-startoffset-error/125774>\
**Category:** Elasticsearch\
**Created:** [March 27, 2018, 2:16pm UTC](https://discuss.elastic.co/t/simple-index-using-word-delimiter-resulting-in-startoffset-error/125774 "2018-03-27T14:16:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![devday](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@devday](https://discuss.elastic.co/u/devday)\
**Post date:** [March 27, 2018, 2:16pm UTC](https://discuss.elastic.co/t/simple-index-using-word-delimiter-resulting-in-startoffset-error/125774/1 "2018-03-27T14:16:22Z")

</div>

Hi All,

I am trying to upgrade from Elastic 5 to Elastic 6.  
I have a very simple index which uses shingles, word\_delimiter and edge.

My example is noted below, I am trying to index "Bat man is cool".  
I want to be able to allow customers to search for "batman" so I am using word delimiter and if they enter "batm" I want to be able to match this, so I also use edge grams.

The below works in ES5, but in ES6, it no longer works.

PUT /test  
{  
"settings": {  
"analysis": {  
"filter": {  
"word\_joiner": {  
"type": "word\_delimiter",  
"catenate\_all": true  
},  
"edge": {  
"type": "edge\_ngram",  
"min\_gram": 1,  
"max\_gram": 10  
},  
"remove\_plurals": {  
"type": "stemmer",  
"name": "minimal\_english"  
},  
"shingles": {  
"type": "shingle",  
"max\_shingle\_size": 5,  
"min\_shingle\_size": 2,  
"output\_unigrams": "true"  
}  
},  
"analyzer": {  
"default": {  
"tokenizer": "standard",  
"filter": [  
"lowercase",  
"shingles",  
"word\_joiner",  
"edge"  
]  
}  
}  
}  
},  
"mappings": {  
"test": {  
"properties": {  
"field1": {  
"type": "text",  
"analyzer": "default"  
}  
}  
}  
}  
}

POST /\_bulk  
{ "update" : { "\_index" : "test", "\_type" : "test", "\_id" : "1" } }  
{ "doc": { "field1" : "Bat man is cool"}, "doc\_as\_upsert": true}

Error:  
startOffset must be non-negative, and endOffset must be \>= startOffset, and offsets must not go backwards startOffset=0,endOffset=3,lastStartOffset=4 for field 'field1'

Can anyone suggest a reason or help?  
You can enter the code above (the PUT and POST) on ES6 and recreate the issue very quickly.

Thank you for your help in advance,

Dev

---

<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:** [April 24, 2018, 2:16pm UTC](https://discuss.elastic.co/t/simple-index-using-word-delimiter-resulting-in-startoffset-error/125774/2 "2018-04-24T14:16:37Z")

</div>

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