The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Search::Mousse::Writer - Writer for Search::Mousse databases

SYNOPSIS

  my $mousse = Search::Mousse::Writer->new(
    directory => $directory,
    name      => 'recipes',
  );
  $mousse->add("Borscht", $recipe, "borscht beet soup russian");
  $mousse->write;
  

DESCRIPTION

Search::Mousse::Writer creates a Search::Mousse database.

Use Search::Mousse to query a database.

The default stemmer is:

  sub {
    my $words = lc shift;
    return uniq(split / /, $words);
  }

CONSTRUCTOR

new

The constructor takes a few arguments: the directory to store files in, and a name for the database. If you have a custom stemmer, also pass it in:

  my $mousse = Search::Mousse::Writer->new(
    directory => $directory,
    name      => 'recipes',
  );
  
  my $mousse2 = Search::Mousse::Writer->new(
    directory => $directory,
    name      => 'photos',
    stemmer   => \&stemmer,
  );

METHODS

add

Adds a document to the database. A document has a key, a value (which can be a Perl data structure or an object) and some keywords:

  $mousse->add("Borscht", $recipe, "borscht beet soup russian");

write

After adding all the documents, you must call the write() method:

  $mousse->write;

SEE ALSO

Search::Mousse::Writer

AUTHOR

Leon Brocard, <acme@astray.com>

COPYRIGHT

Copyright (C) 2005, Leon Brocard

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.