| 1 | package SWISH::Prog::Lucy; | ||
| 2 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 2 | our $VERSION = '0.25'; | |
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | SWISH::Prog::Lucy - Swish3 Apache Lucy backend | ||
| 10 | |||
| 11 | =head1 SYNOPSIS | ||
| 12 | |||
| 13 | # create an index | ||
| 14 | use SWISH::Prog; | ||
| 15 | my $indexer = SWISH::Prog->new( | ||
| 16 | invindex => 'path/to/index.swish', | ||
| 17 | aggregator => 'fs', | ||
| 18 | indexer => 'lucy', | ||
| 19 | config => 'path/to/swish.conf', | ||
| 20 | ); | ||
| 21 | |||
| 22 | $indexer->index('path/to/files'); | ||
| 23 | |||
| 24 | |||
| 25 | # then search the index | ||
| 26 | my $searcher = SWISH::Prog::Lucy::Searcher->new( | ||
| 27 | invindex => 'path/to/index.swish', | ||
| 28 | max_hits => 1000, | ||
| 29 | find_relevant_fields => 1, # default: 0 | ||
| 30 | nfs_mode => 1, # default: 0 | ||
| 31 | ); | ||
| 32 | my $results = $searcher->search('my query') | ||
| 33 | while ( my $result = $results->next ) { | ||
| 34 | printf("%s : %s\n", $result->score, $result->uri); | ||
| 35 | } | ||
| 36 | |||
| 37 | |||
| 38 | =head1 DESCRIPTION | ||
| 39 | |||
| 40 | B<STOP>: Read the L<SWISH::Prog> documentation before you use this | ||
| 41 | module. | ||
| 42 | |||
| 43 | SWISH::Prog::Lucy is an Apache Lucy based implementation of Swish3, | ||
| 44 | using the SWISH::3 bindings for libswish3. | ||
| 45 | |||
| 46 | See the L<SWISH::Prog> docs for more information about the class | ||
| 47 | hierarchy and history. | ||
| 48 | |||
| 49 | See the Swish3 development site at L<http://dev.swish-e.org/wiki/swish3>. | ||
| 50 | |||
| 51 | =head1 Why Not Use Lucy Directly? | ||
| 52 | |||
| 53 | You can use Lucy directly. Using Lucy via SWISH::Prog::Lucy | ||
| 54 | offers a few advantages: | ||
| 55 | |||
| 56 | =over | ||
| 57 | |||
| 58 | =item Aggregators and Filters | ||
| 59 | |||
| 60 | You get to use all of SWISH::Prog's Aggregators and SWISH::Filter support. | ||
| 61 | So you can easily index all kinds of file formats | ||
| 62 | (email, .txt, .html, .xml, .pdf, .doc, .xls, etc) | ||
| 63 | without writing your own parser. | ||
| 64 | |||
| 65 | =item SWISH::3 | ||
| 66 | |||
| 67 | SWISH::3 offers fast and robust XML and HTML parsers | ||
| 68 | with an extensible configuration system, build on top of libxml2. | ||
| 69 | |||
| 70 | =item Simple now, complex later | ||
| 71 | |||
| 72 | You can index your content with SWISH::Prog::Lucy, | ||
| 73 | then build a more complex searching application directly | ||
| 74 | with Lucy. | ||
| 75 | |||
| 76 | =back | ||
| 77 | |||
| 78 | =head1 AUTHOR | ||
| 79 | |||
| 80 | Peter Karman, C<< <karman at cpan.org> >> | ||
| 81 | |||
| 82 | =head1 BUGS | ||
| 83 | |||
| 84 | Please report any bugs or feature requests to C<bug-swish-prog-lucy at rt.cpan.org>, or through | ||
| 85 | the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SWISH-Prog-Lucy>. I will be notified, and then you'll | ||
| 86 | automatically be notified of progress on your bug as I make changes. | ||
| 87 | |||
| 88 | =head1 SUPPORT | ||
| 89 | |||
| 90 | You can find documentation for this module with the perldoc command. | ||
| 91 | |||
| 92 | perldoc SWISH::Prog::Lucy | ||
| 93 | |||
| 94 | You can also look for information at: | ||
| 95 | |||
| 96 | =over 4 | ||
| 97 | |||
| 98 | =item * Mailing list | ||
| 99 | |||
| 100 | L<http://lists.swish-e.org/listinfo/users> | ||
| 101 | |||
| 102 | =item * RT: CPAN's request tracker | ||
| 103 | |||
| 104 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=SWISH-Prog-Lucy> | ||
| 105 | |||
| 106 | =item * AnnoCPAN: Annotated CPAN documentation | ||
| 107 | |||
| 108 | L<http://annocpan.org/dist/SWISH-Prog-Lucy> | ||
| 109 | |||
| 110 | =item * CPAN Ratings | ||
| 111 | |||
| 112 | L<http://cpanratings.perl.org/d/SWISH-Prog-Lucy> | ||
| 113 | |||
| 114 | =item * Search CPAN | ||
| 115 | |||
| 116 | L<http://search.cpan.org/dist/SWISH-Prog-Lucy/> | ||
| 117 | |||
| 118 | =back | ||
| 119 | |||
| 120 | =head1 COPYRIGHT & LICENSE | ||
| 121 | |||
| 122 | Copyright 2009 Peter Karman. | ||
| 123 | |||
| 124 | This program is free software; you can redistribute it and/or modify it | ||
| 125 | under the terms of either: the GNU General Public License as published | ||
| 126 | by the Free Software Foundation; or the Artistic License. | ||
| 127 | |||
| 128 | See http://dev.perl.org/licenses/ for more information. | ||
| 129 | |||
| 130 | =head1 SEE ALSO | ||
| 131 | |||
| 132 | L<SWISH::Prog>, L<Lucy> | ||
| 133 | |||
| 134 | =cut | ||
| 135 | |||
| 136 | 2 | 1; | |