Fragment_size doesn't work with quoted phrase?


(yark) #1

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?


(Shay Banon) #2

Can you post a curl recreation? 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

(yark) #3

Thanks for answer.
Here is curl recreation 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? 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

(yark) #4

No ideas?

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

Thanks for answer.
Here is curl recreation 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? 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

(yark) #5

Please, say something :slight_smile: Is this bug in ES (v 0.16.0)?
We ready to gonna production :wink:

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

No ideas?

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

Thanks for answer.
Here is curl recreation 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? 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

(system) #6