# Getting string-out-of\_bound exception while using highlight

**URL:** <https://discuss.elastic.co/t/getting-string-out-of-bound-exception-while-using-highlight/164890>\
**Category:** Elasticsearch\
**Created:** [January 19, 2019, 10:13am UTC](https://discuss.elastic.co/t/getting-string-out-of-bound-exception-while-using-highlight/164890 "2019-01-19T10:13:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smile-sunsshine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smile-sunsshine/32/11470_2.png) [@smile-sunsshine](https://discuss.elastic.co/u/smile-sunsshine)\
**Post date:** [January 19, 2019, 10:13am UTC](https://discuss.elastic.co/t/getting-string-out-of-bound-exception-while-using-highlight/164890/1 "2019-01-19T10:13:40Z")

</div>

Hi, all:  
i have something confusing on highlight query.

i have an index named book1,and it has two fields,bookid and bookcontent. And the mapping type of bookcontent is text,  
there is some docs data in it.When i do fulltext-search,i got the first page data with highlight fragment query, i get 48 records as total,then i started get next page(pagesize is 10)...when i got the last page ,ES returns as follow:

"reason":  
{  
"type": "string\_index\_out\_of\_bounds\_exception",  
"reason": "String index out of range: 142"  
}

when i decrease the value of 'fragment\_size ' and ‘number\_of\_fragments ’ in query, there is no failure appear.

can anybody give me some tips? my es version is 5.5.1

Thanks!

---

<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 16, 2019, 10:13am UTC](https://discuss.elastic.co/t/getting-string-out-of-bound-exception-while-using-highlight/164890/2 "2019-02-16T10:13:43Z")

</div>

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