in reply to Context search term highlighting - Perl is too slow
Here's why: swish-e creates a reverse index. It parses documents, extracts out "words" and creates an index. On a search, swish finds the words or phrases you are searching for, and lists the doucments where they are found.
I won't pretend that I understood everything in your explanation about how SWISH-E builds it's index, or how exactly you currently do highlighting, but I do have a general suggestion for simplifying your highlighting process:
As long as all you are doing is "prettying" up the output, then I don't think it's all that important that your highlighting logic EXACTLY match your indexing logic. Looping over each search $word and doing a s/$word/$beg_hl$word$end_hl/g may result in words being highlighted that didn't accutally contribute to the acctual relevance of the document -- but that isn't neccessarily a bad thing.
If I were in your shoes, I would focus on the fact that you are doing two very different things:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Context search term highlighting - Perl is too slow
by moseley (Acolyte) on Dec 20, 2001 at 04:23 UTC |