On 28.06.2010 23:00 Ahmet Arslan wrote:

>> 1) I can get my docs in the index, but when I search, it
>> returns the entire document.  I'd love to have it only
>> return the line (or two) around the search term.
> 
> Solr can generate Google-like snippets as you describe. 
> http://wiki.apache.org/solr/HighlightingParameters

I didn't know this is possible and am also interested in this feature
but even after reading the given Wiki page I cannot make out which is
the parameter to use. The only paramter that could be similar is
'hl.maxAlternateFieldLength' where it is possible to give a length to
return but according to the description that is for the case "no match".
And there is "hl.fragmentsBuilder" but with no explanation (the refered
page SolrFragmentsBuilder does not yet exist).

Could you give an example?
E.g. lets say I have a field 'title' and a field 'fulltext' and my
search term is 'solr'. What would be the right set of parameters to get
back the whole title-field but only a sniplet of 50 words (or three
sentences or whatever the unit) from the fulltext field.


Thanks
-Michael

Reply via email to