Created
September 22, 2011 23:47
-
-
Save logie17/1236376 to your computer and use it in GitHub Desktop.
An example indexer using Lucy::Simple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env perl | |
# Example from https://metacpan.org/module/Lucy::Simple | |
use Lucy::Simple; | |
my $index = Lucy::Simple->new( | |
path => './index', | |
language => 'en', | |
); | |
my %source_docs = ( | |
'Foo' => 'I am a page about birds that fly high in the sky', | |
'Bar' => 'This is a page about whales that hold their breath in the sea' | |
); | |
while ( my ( $title, $content ) = each %source_docs ) { | |
$index->add_doc({ | |
page => $title, | |
content => $content, | |
}); | |
} | |
~ | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment