The Lucene Highlighter doesn't require that the text you want
highlighted be stored. In fact, you can pass in any arbitrary text to
the Highlighter.
See the various getBestFragments from the Highlighter class:
<http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/search/highlight/Highlighter.html
>
Erik
On Sep 29, 2009, at 7:01 AM, Yitzchak Schaffer wrote:
Hello,
Sorry for any cross-posting annoyance. I have a request for a
Greenstone collection I'm working on, to add context snippets to
search results; for example a search for "yak culture" might return
this in the list of results:
... addressing the fine points of <strong>yak culture</strong>, the
zoosociologists took into account ...
Sounds like a pretty basic feature, say our sponsors, and I agree.
(Ah, it's also an old Trac ticket at http://trac.greenstone.org/ticket/444)
I see that GS out-of-the-box is set *not* to store the fulltext in
the index, which seems to be a prerequisite for this kind of thing,
as in http://bit.ly/ljNkL . Has anyone modified the Lucene indexing
wrapper locally to do this?
Given that we don't have any Java coders on staff, I've started
porting the Lucene wrapper to PHP for use with a custombuilder.pl
and Zend_Search_Lucene. I already have a PHP frontend, so adjusting
that to display the results shouldn't be a problem; OTOH because the
frontend is PHP, I'm restricted to using buildtype lucene, or
something else with good PHP support.
Many thanks,
--
Yitzchak Schaffer
Systems Manager
Touro College Libraries
33 West 23rd Street
New York, NY 10010
Tel (212) 463-0400 x5230
Fax (212) 627-3197
Email [email protected]