Highlighting Question


(Neil) #1

If I have a multi-valued field with the following data

autoCompleteContainsCastActor: [
John Cena
Brian J White
Travis Davis
Brian DeCaro
Peter Navy Tuiasosopo
Kyle Clements
Nick Gomez
Aidan Gillen
Steve Harris
Gonzalo Menendez
Taylor Cole
Rosalind Rubin
Ashley Scott
]

And I choose to highlight this field in my search for "gomez"

I get 1 fragment whose value is this:

Nick <em>Gomez</em> Aidan Gillen Steve Harris Gonzalo Menendez
Taylor Cole Rosalind Rubin Ashley Scott

I'm not changing any defaults with fragment size or number of
fragments.

So why am I getting back the whole field and not just one entry for
"Nick Gomez"?

Thanks,

Neil


(Andy-3) #2

I'm really new to elastic search, so I'm not quite an expert. I
apologize in advance if something here is not quite right.

Default Highlighting config returns up to 5 fragments at 100
characters each. http://www.elasticsearch.org/guide/reference/api/search/highlighting.html
So your getting back 1 fragment of 100 characters, I think this has to
do with how you indexed the data.

I suspect your creating your index like this, where your passing in
one field of people, this text is all analyzed and parsed into terms.
{
"someobject" : {
"people" : "John Cena Brian J White Travis Davis"
}

I think you could try using an array type, like this, as demonstrated
here, http://www.elasticsearch.org/blog/2010/02/12/yourdatayoursearch.html
{
"someobject" : {
"people" : ["John Cena", "Brian J White", "Travis Davis"]
}

On Nov 11, 3:58 pm, Neil neilmatthewl...@gmail.com wrote:

If I have a multi-valued field with the following data

autoCompleteContainsCastActor: [
John Cena
Brian J White
Travis Davis
Brian DeCaro
Peter Navy Tuiasosopo
Kyle Clements
Nick Gomez
Aidan Gillen
Steve Harris
Gonzalo Menendez
Taylor Cole
Rosalind Rubin
Ashley Scott
]

And I choose to highlight this field in my search for "gomez"

I get 1 fragment whose value is this:

Nick <em>Gomez</em> Aidan Gillen Steve Harris Gonzalo Menendez
Taylor Cole Rosalind Rubin Ashley Scott

I'm not changing any defaults with fragment size or number of
fragments.

So why am I getting back the whole field and not just one entry for
"Nick Gomez"?

Thanks,

Neil


(Shay Banon) #3

Multiple values for the same fields will result in this behavior for
highlighting... . There is an issue open to try and support discrete
highlighting per value.

On Fri, Nov 11, 2011 at 11:58 PM, Neil neilmatthewlott@gmail.com wrote:

If I have a multi-valued field with the following data

autoCompleteContainsCastActor: [
John Cena
Brian J White
Travis Davis
Brian DeCaro
Peter Navy Tuiasosopo
Kyle Clements
Nick Gomez
Aidan Gillen
Steve Harris
Gonzalo Menendez
Taylor Cole
Rosalind Rubin
Ashley Scott
]

And I choose to highlight this field in my search for "gomez"

I get 1 fragment whose value is this:

Nick <em>Gomez</em> Aidan Gillen Steve Harris Gonzalo Menendez
Taylor Cole Rosalind Rubin Ashley Scott

I'm not changing any defaults with fragment size or number of
fragments.

So why am I getting back the whole field and not just one entry for
"Nick Gomez"?

Thanks,

Neil


(Neil) #4

Thanks. I looked for the specific issue number but could not find it.

Would you provide it when you have a chance?


(system) #5