Hi, I am newbie for Xapian. Now I want to play to use Xapian to index some codebase, and provide search feature. I wonder is there any lib/plugin to support snippet and highlight? Now I am trying to do the snippet like this: For each file (cfile, pl, rb and py file), create one vector to store lines and serialize to string as document data. Using line no as term position. When search and hit, extract document data, calculate the final snippet from/to, using stem words to highlight (string.find to get the column of each query stem word). Does Xapian have any built-in support, or is there another way to implement it? Thank you! Yunpeng.
On Fri, Sep 07, 2007 at 02:23:17AM +0800, Yong Wang wrote:> I wonder is there any lib/plugin to support snippet and highlight?Not currently. Omega has code to do highlighting of terms matching a stem but it uses a fixed sample of text at the moment. It's been discussed on the list a few times, most recently here: http://thread.gmane.org/gmane.comp.search.xapian.general/5011/focus=5034 It's definitely a feature I'd like to have. Cheers, Olly
On 9/6/07 1:23 PM, Yong Wang wrote:> Does Xapian have any built-in support, or is there another way to > implement it? >If you use the Search::Xapian Perl bindings, you might want to check out http://search.cpan.org/~karman/Search-Tools-0.10/lib/Search/Tools/Snipper.pm -- Peter Karman . peter@peknet.com . http://www.peknet.com/