.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Lucy 3pm" .TH Lucy 3pm "2017-08-02" "perl v5.26.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Lucy \- Apache Lucy search engine library. .SH "VERSION" .IX Header "VERSION" 0.3.3 .SH "SYNOPSIS" .IX Header "SYNOPSIS" First, plan out your index structure, create the index, and add documents: .PP .Vb 1 \& # indexer.pl \& \& use Lucy::Index::Indexer; \& use Lucy::Plan::Schema; \& use Lucy::Analysis::PolyAnalyzer; \& use Lucy::Plan::FullTextType; \& \& # Create a Schema which defines index fields. \& my $schema = Lucy::Plan::Schema\->new; \& my $polyanalyzer = Lucy::Analysis::PolyAnalyzer\->new( \& language => \*(Aqen\*(Aq, \& ); \& my $type = Lucy::Plan::FullTextType\->new( \& analyzer => $polyanalyzer, \& ); \& $schema\->spec_field( name => \*(Aqtitle\*(Aq, type => $type ); \& $schema\->spec_field( name => \*(Aqcontent\*(Aq, type => $type ); \& \& # Create the index and add documents. \& my $indexer = Lucy::Index::Indexer\->new( \& schema => $schema, \& index => \*(Aq/path/to/index\*(Aq, \& create => 1, \& ); \& while ( my ( $title, $content ) = each %source_docs ) { \& $indexer\->add_doc({ \& title => $title, \& content => $content, \& }); \& } \& $indexer\->commit; .Ve .PP Then, search the index: .PP .Vb 1 \& # search.pl \& \& use Lucy::Search::IndexSearcher; \& \& my $searcher = Lucy::Search::IndexSearcher\->new( \& index => \*(Aq/path/to/index\*(Aq \& ); \& my $hits = $searcher\->hits( query => "foo bar" ); \& while ( my $hit = $hits\->next ) { \& print "$hit\->{title}\en"; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The Apache Lucy search engine library delivers high-performance, modular full-text search. .SS "Features" .IX Subsection "Features" .IP "\(bu" 4 Extremely fast. A single machine can handle millions of documents. .IP "\(bu" 4 Scalable to multiple machines. .IP "\(bu" 4 Incremental indexing (addition/deletion of documents to/from an existing index). .IP "\(bu" 4 Configurable near-real-time index updates. .IP "\(bu" 4 Unicode support. .IP "\(bu" 4 Support for boolean operators \s-1AND, OR,\s0 and \s-1AND NOT\s0; parenthetical groupings; prepended +plus and \-minus. .IP "\(bu" 4 Algorithmic selection of relevant excerpts and highlighting of search terms within excerpts. .IP "\(bu" 4 Highly customizable query and indexing APIs. .IP "\(bu" 4 Customizable sorting. .IP "\(bu" 4 Phrase matching. .IP "\(bu" 4 Stemming. .IP "\(bu" 4 Stoplists. .SS "Getting Started" .IX Subsection "Getting Started" Lucy::Simple provides a stripped down \s-1API\s0 which may suffice for many tasks. .PP Lucy::Docs::Tutorial demonstrates how to build a basic \s-1CGI\s0 search application. .PP The tutorial spends most of its time on these five classes: .IP "\(bu" 4 Lucy::Plan::Schema \- Plan out your index. .IP "\(bu" 4 Lucy::Plan::FieldType \- Define index fields. .IP "\(bu" 4 Lucy::Index::Indexer \- Manipulate index content. .IP "\(bu" 4 Lucy::Search::IndexSearcher \- Search an index. .IP "\(bu" 4 Lucy::Analysis::PolyAnalyzer \- A one-size-fits-all parser/tokenizer. .SS "Delving Deeper" .IX Subsection "Delving Deeper" Lucy::Docs::Cookbook augments the tutorial with more advanced recipes. .PP For creating complex queries, see Lucy::Search::Query and its subclasses TermQuery, PhraseQuery, ANDQuery, ORQuery, NOTQuery, RequiredOptionalQuery, MatchAllQuery, and NoMatchQuery, plus Lucy::Search::QueryParser. .PP For distributed searching, see LucyX::Remote::SearchServer, LucyX::Remote::SearchClient, and LucyX::Remote::ClusterSearcher. .SS "Backwards Compatibility Policy" .IX Subsection "Backwards Compatibility Policy" Lucy will spin off stable forks into new namespaces periodically. The first will be named \*(L"Lucy1\*(R". Users who require strong backwards compatibility should use a stable fork. .PP The main namespace, \*(L"Lucy\*(R", is an API-unstable development branch (as hinted at by its 0.x.x version number). Superficial interface changes happen frequently. Hard file format compatibility breaks which require reindexing are rare, as we generally try to provide continuity across multiple releases, but we reserve the right to make such changes. .SH "CLASS METHODS" .IX Header "CLASS METHODS" The Lucy module itself does not have a large interface, providing only a single public class method. .SS "error" .IX Subsection "error" .Vb 1 \& my $instream = $folder\->open_in( file => \*(Aqfoo\*(Aq ) or die Lucy\->error; .Ve .PP Access a shared variable which is set by some routines on failure. It will always be either a Lucy::Object::Err object or undef. .SH "SUPPORT" .IX Header "SUPPORT" The Apache Lucy homepage, where you'll find links to our mailing lists and so on, is . Please direct support questions to the Lucy users mailing list. .SH "BUGS" .IX Header "BUGS" Not thread-safe. .PP Some exceptions leak memory. .PP If you find a bug, please inquire on the Lucy users mailing list about it, then report it on the Lucy issue tracker once it has been confirmed: . .SH "COPYRIGHT" .IX Header "COPYRIGHT" Apache Lucy is distributed under the Apache License, Version 2.0, as described in the file \f(CW\*(C`LICENSE\*(C'\fR included with the distribution.