# Fragment\_size doesn't work with quoted phrase?

**URL:** <https://discuss.elastic.co/t/fragment-size-doesnt-work-with-quoted-phrase/4648>\
**Category:** Elasticsearch\
**Created:** [June 17, 2011, 8:59am UTC](https://discuss.elastic.co/t/fragment-size-doesnt-work-with-quoted-phrase/4648 "2011-06-17T08:59:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yark/32/3148_2.png) [@yark](https://discuss.elastic.co/u/yark)\
**Post date:** [June 17, 2011, 8:59am UTC](https://discuss.elastic.co/t/fragment-size-doesnt-work-with-quoted-phrase/4648/1 "2011-06-17T08:59:34Z")

</div>

I nave query with highight like this:

```
        'highlight' => array(
            //'fields' => array('_all' => new stdClass() )
            'fields' => array(
                //'_all' => new stdClass(),
                'title' => new stdClass(),
                'item.title' => array('number_of_fragments' => 1, "fragment_size" => 128),
                'item.description' => array('number_of_fragments' => 1, "fragment_size" => 128),
            )
        )

```

if i supply query:  
two words  
item.description returns only 128 chars, as expected. But if  
"two words»  
it returns the same 128 chars and all remainder of that field. Bit strange.  
Should I provide additional info?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 17, 2011, 4:27pm UTC](https://discuss.elastic.co/t/fragment-size-doesnt-work-with-quoted-phrase/4648/2 "2011-06-17T16:27:05Z")

</div>

Can you post a curl recreation? [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)

On Friday, June 17, 2011 at 11:59 AM, Ярослав Концевой wrote:

> I nave query with highight like this:
> 
> 'highlight' =\> array(  
> //'fields' =\> array('\_all' =\> new stdClass() )  
> 'fields' =\> array(  
> //'\_all' =\> new stdClass(),  
> 'title' =\> new stdClass(),  
> 'item.title' =\> array('number\_of\_fragments' =\> 1, "fragment\_size" =\> 128),  
> 'item.description' =\> array('number\_of\_fragments' =\> 1, "fragment\_size" =\> 128),  
> )  
> )
> 
> if i supply query:  
> two words  
> item.description returns only 128 chars, as expected. But if  
> "two words»  
> it returns the same 128 chars and all remainder of that field. Bit strange.  
> Should I provide additional info?
> 
> Attachments:
> 
> - smime.p7s

---

<div class="post-metadata">

**Author:** ![yark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yark/32/3148_2.png) [@yark](https://discuss.elastic.co/u/yark)\
**Post date:** [June 17, 2011, 8:34pm UTC](https://discuss.elastic.co/t/fragment-size-doesnt-work-with-quoted-phrase/4648/3 "2011-06-17T20:34:52Z")

</div>

Thanks for answer.  
Here is curl recreation [elasticsearch fragment\_size issue · GitHub](https://gist.github.com/1032233)  
Also issued result ( item4.description ) (you can see all doc also in \_source )  
and mapping.

Please tell, can I do the trick with highlight fields like ["item\*.title", "item\*.description"] in query fields?

I understand, it looks bit strange. I’m try to explain:  
All my docs contains 10 items with title and description (and so on, not important). I need to have 1 match per field, so my first version with just array of items wont work. If i setup number\_of\_fragments to 1 it returns _only_ 1 result for all 10 items. If i setup number\_of\_fragments to 0 it returns all description concatenated in 1 highlight. So solution is to make item1, item2 etc.  
Is it best solution?

17 черв. 2011, в 19:27, Shay Banon написал(а):

> Can you post a curl recreation? [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)  
> On Friday, June 17, 2011 at 11:59 AM, Ярослав Концевой wrote:
> 
> > I nave query with highight like this:
> > 
> > 'highlight' =\> array(  
> > //'fields' =\> array('\_all' =\> new stdClass() )  
> > 'fields' =\> array(  
> > //'\_all' =\> new stdClass(),  
> > 'title' =\> new stdClass(),  
> > 'item.title' ==3D\> array('number\_of\_fragments' =\> 1, "fragment\_size" =\> 128),  
> > 'item.description' =\> array('number\_of\_fragments' =\> 1, "fragment\_size" =\> 128),  
> > )  
> > )
> > 
> > if i supply query:  
> > two words  
> > item.description returns only 128 chars, as expected. But if  
> > "two words»  
> > it returns the same 128 chars and all remainder of that field. Bit strange.  
> > Should I provide additional info?
> > 
> > Attachments:
> > 
> > - smime.p7s

---

<div class="post-metadata">

**Author:** ![yark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yark/32/3148_2.png) [@yark](https://discuss.elastic.co/u/yark)\
**Post date:** [June 20, 2011, 4:19am UTC](https://discuss.elastic.co/t/fragment-size-doesnt-work-with-quoted-phrase/4648/4 "2011-06-20T04:19:11Z")

</div>

No ideas?

17 черв. 2011, в 23:34, Ярослав Концевой написал(а):

> Thanks for answer.  
> Here is curl recreation [elasticsearch fragment\_size issue · GitHub](https://gist.github.com/1032233)  
> Also issued result ( item4.description ) (you can see all doc also in \_source )  
> and mapping.
> 
> Please tell, can I do the trick with highlight fields like ["item\*.title", "item\*.description"] in query fields?
> 
> I understand, it looks bit strange. I’m try to explain:  
> All my docs contains 10 items with title and description (and so on, not important). I need to have 1 match per field, so my first version with just array of items wont work. If i setup number\_of\_fragments to 1 it returns _only_ 1 result for all 10 items. If i setup number\_of\_fragments to 0 it returns all description concatenated in 1 highlight. So solution is to make item1, item2 etc.  
> Is it best solution?
> 
> 17 черв. 2011, в 19:27, Shay Banon написал(а):
> 
> > Can you post a curl recreation? [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)  
> > On Friday, June 17, 2011 at 11:59 AM, Ярослав Концевой wrote:
> > 
> > > I nave query with highight like this:
> > > 
> > > 'highlight' =\> array(  
> > > //'fields' =\> array('\_all' =\> new stdClass() )  
> > > 'fields' =\> array(  
> > > //'\_all' =\> new stdClass(),  
> > > 'title' =\> new stdClass(),  
> > > 'item.title' ==3D\> array('number\_of\_fragments' =\> 1, "fragment\_size" =\> 128),  
> > > 'item.description' =\> array('number\_of\_fragments' =\> 1, "fragment\_size" =\> 128),  
> > > )  
> > > )
> > > 
> > > if i supply query:  
> > > two words  
> > > item.description returns only 128 chars, as expected. But if  
> > > "two words»  
> > > it returns the same 128 chars and all remainder of that field. Bit strange.  
> > > Should I provide additional info?
> > > 
> > > Attachments:
> > > 
> > > - smime.p7s

---

<div class="post-metadata">

**Author:** ![yark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yark/32/3148_2.png) [@yark](https://discuss.elastic.co/u/yark)\
**Post date:** [June 21, 2011, 8:30am UTC](https://discuss.elastic.co/t/fragment-size-doesnt-work-with-quoted-phrase/4648/5 "2011-06-21T08:30:27Z")

</div>

Please, say something 🙂 Is this bug in ES (v 0.16.0)?  
We ready to gonna production 😉

20 черв. 2011, в 07:19, Ярослав Концевой написал(а):

> No ideas?
> 
> 17 черв. 2011, в 23:34, Ярослав Концевой написал(а):
> 
> > Thanks for answer.  
> > Here is curl recreation [elasticsearch fragment\_size issue · GitHub](https://gist.github.com/1032233)  
> > Also issued result ( item4.description ) (you can see all doc also in \_source )  
> > and mapping.
> > 
> > Please tell, can I do the trick with highlight fields like ["item\*.title", "item\*.description"] in query fields?
> > 
> > I understand, it looks bit strange. I’m try to explain:  
> > All my docs contains 10 items with title and description (and so on, not important). I need to have 1 match per field, so my first version with just array of items wont work. If i setup number\_of\_fragments to 1 it returns _only_ 1 result for all 10 items. If i setup number\_of\_fragments to 0 it returns all description concatenated in 1 highlight. So solution is to make item1, item2 etc.  
> > Is it best solution?
> > 
> > 17 черв. 2011, в 19:27, Shay Banon написал(а):
> > 
> > > Can you post a curl recreation? [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)  
> > > On Friday, June 17, 2011 at 11:59 AM, Ярослав Концевой wrote:
> > > 
> > > > I nave query with highight like this:
> > > > 
> > > > 'highlight' =\> array(  
> > > > //'fields' =\> array('\_all' =\> new stdClass() )  
> > > > 'fields' =\> array(  
> > > > //'\_all' =\> new stdClass(),  
> > > > 'title' =\> new stdClass(),  
> > > > 'item.title' ==3D\> array('number\_of\_fragments' =\> 1, "fragment\_size" =\> 128),  
> > > > 'item.description' =\> array('number\_of\_fragments' =\> 1, "fragment\_size" =\> 128),  
> > > > )  
> > > > )
> > > > 
> > > > if i supply query:  
> > > > two words  
> > > > item.description returns only 128 chars, as expected. But if  
> > > > "two words»  
> > > > it returns the same 128 chars and all remainder of that field. Bit strange.  
> > > > Should I provide additional info?
> > > > 
> > > > Attachments:
> > > > 
> > > > - smime.p7s

---

<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 6, 2017, 4:03am UTC](https://discuss.elastic.co/t/fragment-size-doesnt-work-with-quoted-phrase/4648/6 "2017-07-06T04:03:01Z")

</div>


