Controlling highlight fragments


(pzelnip) #1

I think this is currently already an open issue (http://github.com/
elasticsearch/elasticsearch/issues/#issue/307), but I want to make
sure I'm not missing something that is currently available in
ElasticSearch.

Is it possible to control how a highlight's fragments are created? As
I read it, the API only allows one to specify the fragment size (in
characters), but there's no ability to specify where in a source field
that fragment should start or end (say for example at the start or end
of a sentence in a document).

Or am I missing something?


(Lukáš Vlček) #2

You are correct. It is not possible now. However, there is new feature in
master that allows retrieval of whole field content with highlighted tags.

Dne 2010 9 22 21:02 "Adam Parkin" pzelnip@gmail.com napsal(a):

I think this is currently already an open issue (http://github.com/
elasticsearch/elasticsearch/issues/#issue/307), but I want to make
sure I'm not missing something that is currently available in
ElasticSearch.

Is it possible to control how a highlight's fragments are created? As
I read it, the API only allows one to specify the fragment size (in
characters), but there's no ability to specify where in a source field
that fragment should start or end (say for example at the start or end
of a sentence in a document).

Or am I missing something?


(pzelnip) #3

And how do I do that (retrieve whole field with highlighted tags)?

Thanks!

On Sep 22, 12:08 pm, Lukáš Vlček lukas.vl...@gmail.com wrote:

You are correct. It is not possible now. However, there is new feature in
master that allows retrieval of whole field content with highlighted tags.

Dne 2010 9 22 21:02 "Adam Parkin" pzel...@gmail.com napsal(a):

I think this is currently already an open issue (http://github.com/
elasticsearch/elasticsearch/issues/#issue/307), but I want to make
sure I'm not missing something that is currently available in
ElasticSearch.

Is it possible to control how a highlight's fragments are created? As
I read it, the API only allows one to specify the fragment size (in
characters), but there's no ability to specify where in a source field
that fragment should start or end (say for example at the start or end
of a sentence in a document).

Or am I missing something?


(Lukáš Vlček) #4

By setting number_of_fragments to 0. You can check javaDoc in the following
commit


It is also possible to override highlight settings at each field level
differently. HTH.
Regards,
Lukas

Dne 2010 9 22 21:26 "Adam Parkin" pzelnip@gmail.com napsal(a):
And how do I do that (retrieve whole field with highlighted tags)?

Thanks!

On Sep 22, 12:08 pm, Lukáš Vlček lukas.vl...@gmail.com wrote:

You are correct. It is not possi...
Dne 2010 9 22 21:02 "Adam Parkin" pzel...@gmail.com napsal(a):

I think this is currently already an open issue (http://github.com/
elasticsearch/elastics...


(system) #5