On Mon, Jul 15, 2013 at 9:23 AM, Moritz Lenz <[email protected]> wrote:
> this might be slightly off-topic here, but still I'd like to thank all
> contributors for their amazing work on Lucy.
>
> Recently I've built a search feature for my web IRC logs with Lucy, and I
> found the (Perl-)API nice to use, and the error messages very helpful too.
> (Except that one time when I managed to make lucy + perl 5.10.1 segfault;
> sadly I didn't manage to reproduce it).
>
> So, please keep up the good work!

Thank you for the feedback -- I'm glad you've had a good experience!

> Some details:
>
> An example search can be found here:
> http://irclog.perlgeek.de/perl6/search/?nick=timtoady&q=threads
> The backend code is here:
> https://github.com/moritz/ilbot/blob/master/lib/Ilbot/Backend/Search.pm
>
> For the indexing I lump together all subsequent lines by the same nick into
> one document, and store the database IDs as a comma-separate value in a
> second field, and the day in a third field. Each IRC channel has a separate
> index.
>
> Then when displaying the search results, I retrieve all lines for that day
> and channel from the database or cache (which is fast enough, and much
> simpler than building complicated queries), and filter out the search
> results, plus a few lines before and afterward for context.
>
> So far I'm very happy with theses tradeoffs, and like the results.

It's a very nice interface.  Congratulations on a successful design. :)

I wonder whether you might consider making the "line" field stored and
highlightable.

      my $type = Lucy::Plan::FullTextType->new(
          analyzer => $polyanalyzer,
-         stored => 0,
+         highlightable => 1,
      );

I see that you've emboldened the relevant line, but you could go further and
use the Highlighter to emphasize the keywords that were searched for.

    http://lucy.apache.org/docs/perl/Lucy/Docs/Tutorial/Highlighter.html
    http://lucy.apache.org/docs/perl/Lucy/Highlight/Highlighter.html

By default, the Highlighter surrounds keywords with `<strong>` tags, but using
set_pre_tag() and set_post_tag() you can make it use a span with CSS, <blink>
tags, or whatever.

The tradeoff is that your indexes would take up more space.

Marvin Humphrey

Reply via email to