In 2-Oct-07, at 12:52 AM, Ravish Bhagdev wrote:
> I have tried very hard to follow documentation and
forums that try to
> answer questions about how to return snippets with
highlights for
> relevant searched term using Solr (as nutch does with
such ease).
>
> I will be really grateful if someone can guide me with
basics, i have
> made sure that the field to be highlighted is
"stored" in index etc.
> Still I can't figure out why it doesn't return the
snippet and instead
> returns the whole document.
>
> I have tried all different highlight parameters with
variations, but
> no idea what's happening. Can I test highlighting
using given
> application using "full search interface"
option? How, it just
> returns xml with full document between field tag at the
moment.
Note that the highlighting data is _not_ returned in the
<doc>
section of the response. Getting the whole document back is
probably
due to asking for all fields (coupled with having stored the
main
text field).
You can play with the highlighting in the admin ui. Besides
having a
few parameters directly present, the others can be added
directly to
the url for testing.
The minimum required for highlighting is:
1. hl=true
2. hl.fl=myfield
_If_ that field matches one of the query terms, you should
see
snippets in the generated response. EVen if not, you should
see a
<highlighting> section of the response (it will be
empty).
regards,
-Mike
|