On 8/28/06, Jean-Christophe Michel <[EMAIL PROTECTED]> wrote: > Hi, > > Le 28 août 06, à 12:22, Jens Kraemer a écrit : > > in Ferret 0.10 there's a highlight method in the Searcher class. Maybe > > that does what you want ? > > > > http://ferret.davebalmain.com/api/classes/Ferret/Search/ > > Searcher.html#M000223 > > Seems good, will be perfect if your truncate respects multi-byte chars. > My ruby helper does it, see how it works on > http://symetrie.com/fr/search > (it highlights only the first occurence of each word currently).
Hi Jean-Christophe, Are you saying the highlight doesn't respect multi-byte characters? If so, could you give an example? The highlighter uses the byte boundaries returned by the analyzer during indexing so I can't see any reason multi-byte characters wouldn't be respected. Also, it's quite a bit more advanced then your version (and the version in Lucene contrib for that matter). It highlights only the terms that match the query. So if you search for the phrase "red truck" the terms "red" and "truck" will only be highlighted if they appear together. If you search for "red truck"~1 then the phrase "red fire truck" will be highlighted. It also uses a pretty clever algorithm to find the excerpts with the most matching information. It's still quite experimental though so I need people to try it out and send in their suggestions. Cheers, Dave _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

