On 1-Jun-07, at 9:37 AM, Xuesong Luo wrote:

Hi, there,

I have a question about how to use the highlight field(hl.fl), below is
my test result. As you can see, if I don't use hl.fl in the query, the
highlighting element in the result only shows the id information. I have
to add the field name (hl.fl=TITLE) to the query to see the field
information. Is that the correct behavior? If there are multiple fields
that could contain the search string, I have to add all of them to
hl.fl?

Highlighting uses the following fields:

1. hl.fl, if present, will define all fields to be highlighted. You can highlight fields that were not part of the query (as you demonstrate below) 2. if hl.fl is absent and qt=standard, the default search field is highlighted (set in schema.xml or df= parameter
3. if hl.fl is absent and qt=dismax, the query fields are used (qf=)

Note that every field to be highlighted must be stored. If not, it will not be present in the output (perhaps that is what you are seeing in your example).

Finally, all terms are highlighted in all highlight fields. If you query searches for different terms in different fields and you want this exactitude to carry forth in your highlighting, specify hl.requireFieldMatch=true.

-Mike

Reply via email to