You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by bu...@apache.org on 2012/03/31 05:36:27 UTC
[lucy-commits] svn commit: r810789 [14/16] - in /websites/staging/lucy/trunk/content: ./
css/ docs/ docs/0.1.0/ docs/0.1.0/perl/ docs/0.1.0/perl/Lucy/
docs/0.1.0/perl/Lucy/Analysis/ docs/0.1.0/perl/Lucy/Docs/
docs/0.1.0/perl/Lucy/Docs/Cookbook/ docs/0.1.0/perl/Lucy/D...
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/DataWriter.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/DataWriter.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/DataWriter.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,144 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::DataWriter - Write data to an index.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> # Abstract base class.</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>DataWriter is an abstract base class for writing index data, generally in segment-sized chunks. Each component of an index -- e.g. stored fields, lexicon, postings, deletions -- is represented by a DataWriter/<a href="../../Lucy/Index/DataReader.html">DataReader</a> pair.</p>
+
+<p>Components may be specified per index by subclassing <a href="../../Lucy/Plan/Architecture.html">Architecture</a>.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-labeled-params-">new( <i>[labeled params]</i> )</h2>
+
+<pre><code> my $writer = MyDataWriter->new(
+ snapshot => $snapshot, # required
+ segment => $segment, # required
+ polyreader => $polyreader, # required
+ );</code></pre>
+
+<ul>
+
+<li><p><b>snapshot</b> - The Snapshot that will be committed at the end of the indexing session.</p>
+
+</li>
+<li><p><b>segment</b> - The Segment in progress.</p>
+
+</li>
+<li><p><b>polyreader</b> - A PolyReader representing all existing data in the index. (If the index is brand new, the PolyReader will have no sub-readers).</p>
+
+</li>
+</ul>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="add_inverted_doc-labeled-params-">add_inverted_doc( <i>[labeled params]</i> )</h2>
+
+<p>Process a document, previously inverted by <code>inverter</code>.</p>
+
+<ul>
+
+<li><p><b>inverter</b> - An Inverter wrapping an inverted document.</p>
+
+</li>
+<li><p><b>doc_id</b> - Internal number assigned to this document within the segment.</p>
+
+</li>
+</ul>
+
+<h2 id="add_segment-labeled-params-">add_segment( <i>[labeled params]</i> )</h2>
+
+<p>Add content from an existing segment into the one currently being written.</p>
+
+<ul>
+
+<li><p><b>reader</b> - The SegReader containing content to add.</p>
+
+</li>
+<li><p><b>doc_map</b> - An array of integers mapping old document ids to new. Deleted documents are mapped to 0, indicating that they should be skipped.</p>
+
+</li>
+</ul>
+
+<h2 id="finish-">finish()</h2>
+
+<p>Complete the segment: close all streams, store metadata, etc.</p>
+
+<h2 id="format-">format()</h2>
+
+<p>Every writer must specify a file format revision number, which should increment each time the format changes. Responsibility for revision checking is left to the companion DataReader.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="delete_segment-reader-">delete_segment(reader)</h2>
+
+<p>Remove a segment's data. The default implementation is a no-op, as all files within the segment directory will be automatically deleted. Subclasses which manage their own files outside of the segment system should override this method and use it as a trigger for cleaning up obsolete data.</p>
+
+<ul>
+
+<li><p><b>reader</b> - The SegReader containing content to merge, which must represent a segment which is part of the the current snapshot.</p>
+
+</li>
+</ul>
+
+<h2 id="merge_segment-labeled-params-">merge_segment( <i>[labeled params]</i> )</h2>
+
+<p>Move content from an existing segment into the one currently being written.</p>
+
+<p>The default implementation calls add_segment() then delete_segment().</p>
+
+<ul>
+
+<li><p><b>reader</b> - The SegReader containing content to merge, which must represent a segment which is part of the the current snapshot.</p>
+
+</li>
+<li><p><b>doc_map</b> - An array of integers mapping old document ids to new. Deleted documents are mapped to 0, indicating that they should be skipped.</p>
+
+</li>
+</ul>
+
+<h2 id="metadata-">metadata()</h2>
+
+<p>Arbitrary metadata to be serialized and stored by the Segment. The default implementation supplies a Hash with a single key-value pair for "format".</p>
+
+<h2 id="get_snapshot-">get_snapshot()</h2>
+
+<p>Accessor for "snapshot" member var.</p>
+
+<h2 id="get_segment-">get_segment()</h2>
+
+<p>Accessor for "segment" member var.</p>
+
+<h2 id="get_polyreader-">get_polyreader()</h2>
+
+<p>Accessor for "polyreader" member var.</p>
+
+<h2 id="get_schema-">get_schema()</h2>
+
+<p>Accessor for "schema" member var.</p>
+
+<h2 id="get_folder-">get_folder()</h2>
+
+<p>Accessor for "folder" member var.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::DataWriter isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/DeletionsWriter.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/DeletionsWriter.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/DeletionsWriter.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,79 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::DeletionsWriter - Abstract base class for marking documents as deleted.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $polyreader = $del_writer->get_polyreader;
+ my $seg_readers = $polyreader->seg_readers;
+ for my $seg_reader (@$seg_readers) {
+ my $count = $del_writer->seg_del_count( $seg_reader->get_seg_name );
+ ...
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>Subclasses of DeletionsWriter provide a low-level mechanism for declaring a document deleted from an index.</p>
+
+<p>Because files in an index are never modified, and because it is not practical to delete entire segments, a DeletionsWriter does not actually remove documents from the index. Instead, it communicates to a search-time companion DeletionsReader which documents are deleted in such a way that it can create a Matcher iterator.</p>
+
+<p>Documents are truly deleted only when the segments which contain them are merged into new ones.</p>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="delete_by_term-labeled-params-">delete_by_term( <i>[labeled params]</i> )</h2>
+
+<p>Delete all documents in the index that index the supplied term.</p>
+
+<ul>
+
+<li><p><b>field</b> - The name of an indexed field. (If it is not spec'd as <code>indexed</code>, an error will occur.)</p>
+
+</li>
+<li><p><b>term</b> - The term which identifies docs to be marked as deleted. If <code>field</code> is associated with an Analyzer, <code>term</code> will be processed automatically (so don't pre-process it yourself).</p>
+
+</li>
+</ul>
+
+<h2 id="delete_by_query-query-">delete_by_query(query)</h2>
+
+<p>Delete all documents in the index that match <code>query</code>.</p>
+
+<ul>
+
+<li><p><b>query</b> - A <a href="../../Lucy/Search/Query.html">Query</a>.</p>
+
+</li>
+</ul>
+
+<h2 id="updated-">updated()</h2>
+
+<p>Returns true if there are updates that need to be written.</p>
+
+<h2 id="seg_del_count-seg_name-">seg_del_count(seg_name)</h2>
+
+<p>Return the number of deletions for a given segment.</p>
+
+<ul>
+
+<li><p><b>seg_name</b> - The name of the segment.</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::DeletionsWriter isa <a href="../../Lucy/Index/DataWriter.html">Lucy::Index::DataWriter</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/DocReader.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/DocReader.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/DocReader.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,53 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::DocReader - Retrieve stored documents.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $doc_reader = $seg_reader->obtain("Lucy::Index::DocReader");
+ my $doc = $doc_reader->fetch_doc($doc_id);</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>DocReader defines the interface by which documents (with all stored fields) are retrieved from the index. The default implementation returns <a href="../../Lucy/Document/HitDoc.html">HitDoc</a> objects.</p>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="fetch_doc-doc_id-">fetch_doc(doc_id)</h2>
+
+<p>Retrieve the document identified by <code>doc_id</code>.</p>
+
+<p>Returns: a HitDoc.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="aggregator-labeled-params-">aggregator( <i>[labeled params]</i> )</h2>
+
+<p>Returns a DocReader which divvies up requests to its sub-readers according to the offset range.</p>
+
+<ul>
+
+<li><p><b>readers</b> - An array of DocReaders.</p>
+
+</li>
+<li><p><b>offsets</b> - Doc id start offsets for each reader.</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::DocReader isa <a href="../../Lucy/Index/DataReader.html">Lucy::Index::DataReader</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/IndexManager.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/IndexManager.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/IndexManager.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,119 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::IndexManager - Policies governing index updating, locking, and file deletion.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> use Sys::Hostname qw( hostname );
+ my $hostname = hostname() or die "Can't get unique hostname";
+ my $manager = Lucy::Index::IndexManager->new(
+ host => $hostname,
+ );
+
+ # Index time:
+ my $indexer = Lucy::Index::Indexer->new(
+ index => '/path/to/index',
+ manager => $manager,
+ );
+
+ # Search time:
+ my $reader = Lucy::Index::IndexReader->open(
+ index => '/path/to/index',
+ manager => $manager,
+ );
+ my $searcher = Lucy::Search::IndexSearcher->new( index => $reader );</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>IndexManager is an advanced-use class for controlling index locking, updating, merging, and deletion behaviors.</p>
+
+<p>IndexManager and <a href="../../Lucy/Plan/Architecture.html">Architecture</a> are complementary classes: Architecture is used to define traits and behaviors which cannot change for the life of an index; IndexManager is used for defining rules which may change from process to process.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-labeled-params-">new( <i>[labeled params]</i> )</h2>
+
+<pre><code> my $manager = Lucy::Index::IndexManager->new(
+ host => $hostname, # default: ""
+ );</code></pre>
+
+<ul>
+
+<li><p><b>host</b> - An identifier which should be unique per-machine.</p>
+
+</li>
+<li><p><b>lock_factory</b> - A LockFactory.</p>
+
+</li>
+</ul>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="make_write_lock-">make_write_lock()</h2>
+
+<p>Create the Lock which controls access to modifying the logical content of the index.</p>
+
+<h2 id="recycle-labeled-params-">recycle( <i>[labeled params]</i> )</h2>
+
+<p>Return an array of SegReaders representing segments that should be consolidated. Implementations must balance index-time churn against search-time degradation due to segment proliferation. The default implementation prefers small segments or segments with a high proportion of deletions.</p>
+
+<ul>
+
+<li><p><b>reader</b> - A PolyReader.</p>
+
+</li>
+<li><p><b>del_writer</b> - A DeletionsWriter.</p>
+
+</li>
+<li><p><b>cutoff</b> - A segment number which all returned SegReaders must exceed.</p>
+
+</li>
+<li><p><b>optimize</b> - A boolean indicating whether to spend extra time optimizing the index for search-time performance.</p>
+
+</li>
+</ul>
+
+<h2 id="set_folder-folder-">set_folder(folder)</h2>
+
+<p>Setter for <code>folder</code> member. Typical clients (Indexer, IndexReader) will use this method to install their own Folder instance.</p>
+
+<h2 id="get_folder-">get_folder()</h2>
+
+<p>Getter for <code>folder</code> member.</p>
+
+<h2 id="get_host-">get_host()</h2>
+
+<p>Getter for <code>host</code> member.</p>
+
+<h2 id="set_write_lock_timeout-timeout-">set_write_lock_timeout(timeout)</h2>
+
+<p>Setter for write lock timeout. Default: 1000 milliseconds.</p>
+
+<h2 id="get_write_lock_timeout-">get_write_lock_timeout()</h2>
+
+<p>Getter for write lock timeout.</p>
+
+<h2 id="set_write_lock_interval-timeout-">set_write_lock_interval(timeout)</h2>
+
+<p>Setter for write lock retry interval. Default: 100 milliseconds.</p>
+
+<h2 id="get_write_lock_interval-">get_write_lock_interval()</h2>
+
+<p>Getter for write lock retry interval.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::IndexManager isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/IndexReader.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/IndexReader.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/IndexReader.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,116 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::IndexReader - Read from an inverted index.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $reader = Lucy::Index::IndexReader->open(
+ index => '/path/to/index',
+ );
+ my $seg_readers = $reader->seg_readers;
+ for my $seg_reader (@$seg_readers) {
+ my $seg_name = $seg_reader->get_segment->get_name;
+ my $num_docs = $seg_reader->doc_max;
+ print "Segment $seg_name ($num_docs documents):\n";
+ my $doc_reader = $seg_reader->obtain("Lucy::Index::DocReader");
+ for my $doc_id ( 1 .. $num_docs ) {
+ my $doc = $doc_reader->fetch_doc($doc_id);
+ print " $doc_id: $doc->{title}\n";
+ }
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>IndexReader is the interface through which <a href="../../Lucy/Search/IndexSearcher.html">IndexSearcher</a> objects access the content of an index.</p>
+
+<p>IndexReader objects always represent a point-in-time view of an index as it existed at the moment the reader was created. If you want search results to reflect modifications to an index, you must create a new IndexReader after the update process completes.</p>
+
+<p>IndexReaders are composites; most of the work is done by individual <a href="../../Lucy/Index/DataReader.html">DataReader</a> sub-components, which may be accessed via fetch() and obtain(). The most efficient and powerful access to index data happens at the segment level via <a href="../../Lucy/Index/SegReader.html">SegReader</a>'s sub-components.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="open-labeled-params-">open( <i>[labeled params]</i> )</h2>
+
+<pre><code> my $reader = Lucy::Index::IndexReader->open(
+ index => '/path/to/index', # required
+ snapshot => $snapshot,
+ manager => $index_manager,
+ );</code></pre>
+
+<p>IndexReader is an abstract base class; open() returns the IndexReader subclass PolyReader, which channels the output of 0 or more SegReaders.</p>
+
+<ul>
+
+<li><p><b>index</b> - Either a string filepath or a Folder.</p>
+
+</li>
+<li><p><b>snapshot</b> - A Snapshot. If not supplied, the most recent snapshot file will be used.</p>
+
+</li>
+<li><p><b>manager</b> - An <a href="../../Lucy/Index/IndexManager.html">IndexManager</a>. Read-locking is off by default; supplying this argument turns it on.</p>
+
+</li>
+</ul>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="doc_max-">doc_max()</h2>
+
+<p>Return the maximum number of documents available to the reader, which is also the highest possible internal document id. Documents which have been marked as deleted but not yet purged from the index are included in this count.</p>
+
+<h2 id="doc_count-">doc_count()</h2>
+
+<p>Return the number of documents available to the reader, subtracting any that are marked as deleted.</p>
+
+<h2 id="del_count-">del_count()</h2>
+
+<p>Return the number of documents which have been marked as deleted but not yet purged from the index.</p>
+
+<h2 id="seg_readers-">seg_readers()</h2>
+
+<p>Return an array of all the SegReaders represented within the IndexReader.</p>
+
+<h2 id="offsets-">offsets()</h2>
+
+<p>Return an array with one entry for each segment, corresponding to segment doc_id start offset.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="fetch-api-">fetch(api)</h2>
+
+<p>Fetch a component, or return undef if the component can't be found.</p>
+
+<ul>
+
+<li><p><b>api</b> - The name of the DataReader subclass that the desired component must implement.</p>
+
+</li>
+</ul>
+
+<h2 id="obtain-api-">obtain(api)</h2>
+
+<p>Fetch a component, or throw an error if the component can't be found.</p>
+
+<ul>
+
+<li><p><b>api</b> - The name of the DataReader subclass that the desired component must implement.</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::IndexReader isa <a href="../../Lucy/Index/DataReader.html">Lucy::Index::DataReader</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Indexer.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Indexer.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Indexer.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,149 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::Indexer - Build inverted indexes.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $indexer = Lucy::Index::Indexer->new(
+ schema => $schema,
+ index => '/path/to/index',
+ create => 1,
+ );
+ while ( my ( $title, $content ) = each %source_docs ) {
+ $indexer->add_doc({
+ title => $title,
+ content => $content,
+ });
+ }
+ $indexer->commit;</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>The Indexer class is Apache Lucy's primary tool for managing the content of inverted indexes, which may later be searched using <a href="../../Lucy/Search/IndexSearcher.html">IndexSearcher</a>.</p>
+
+<p>In general, only one Indexer at a time may write to an index safely. If a write lock cannot be secured, new() will throw an exception.</p>
+
+<p>If an index is located on a shared volume, each writer application must identify itself by supplying an <a href="../../Lucy/Index/IndexManager.html">IndexManager</a> with a unique <code>host</code> id to Indexer's constructor or index corruption will occur. See <a href="../../Lucy/Docs/FileLocking.html">Lucy::Docs::FileLocking</a> for a detailed discussion.</p>
+
+<p>Note: at present, delete_by_term() and delete_by_query() only affect documents which had been previously committed to the index -- and not any documents added this indexing session but not yet committed. This may change in a future update.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-labeled-params-">new( <i>[labeled params]</i> )</h2>
+
+<pre><code> my $indexer = Lucy::Index::Indexer->new(
+ schema => $schema, # required at index creation
+ index => '/path/to/index', # required
+ create => 1, # default: 0
+ truncate => 1, # default: 0
+ manager => $manager # default: created internally
+ );</code></pre>
+
+<ul>
+
+<li><p><b>schema</b> - A Schema. Required when index is being created; if not supplied, will be extracted from the index folder.</p>
+
+</li>
+<li><p><b>index</b> - Either a filepath to an index or a Folder.</p>
+
+</li>
+<li><p><b>create</b> - If true and the index directory does not exist, attempt to create it.</p>
+
+</li>
+<li><p><b>truncate</b> - If true, proceed with the intention of discarding all previous indexing data. The old data will remain intact and visible until commit() succeeds.</p>
+
+</li>
+<li><p><b>manager</b> - An IndexManager.</p>
+
+</li>
+</ul>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="add_doc-...-">add_doc(...)</h2>
+
+<pre><code> $indexer->add_doc($doc);
+ $indexer->add_doc( { field_name => $field_value } );
+ $indexer->add_doc(
+ doc => { field_name => $field_value },
+ boost => 2.5, # default: 1.0
+ );</code></pre>
+
+<p>Add a document to the index. Accepts either a single argument or labeled params.</p>
+
+<ul>
+
+<li><p><b>doc</b> - Either a Lucy::Document::Doc object, or a hashref (which will be attached to a Lucy::Document::Doc object internally).</p>
+
+</li>
+<li><p><b>boost</b> - A floating point weight which affects how this document scores.</p>
+
+</li>
+</ul>
+
+<h2 id="add_index-index-">add_index(index)</h2>
+
+<p>Absorb an existing index into this one. The two indexes must have matching Schemas.</p>
+
+<ul>
+
+<li><p><b>index</b> - Either an index path name or a Folder.</p>
+
+</li>
+</ul>
+
+<h2 id="optimize-">optimize()</h2>
+
+<p>Optimize the index for search-time performance. This may take a while, as it can involve rewriting large amounts of data.</p>
+
+<h2 id="commit-">commit()</h2>
+
+<p>Commit any changes made to the index. Until this is called, none of the changes made during an indexing session are permanent.</p>
+
+<p>Calling commit() invalidates the Indexer, so if you want to make more changes you'll need a new one.</p>
+
+<h2 id="prepare_commit-">prepare_commit()</h2>
+
+<p>Perform the expensive setup for commit() in advance, so that commit() completes quickly. (If prepare_commit() is not called explicitly by the user, commit() will call it internally.)</p>
+
+<h2 id="delete_by_term-labeled-params-">delete_by_term( <i>[labeled params]</i> )</h2>
+
+<p>Mark documents which contain the supplied term as deleted, so that they will be excluded from search results and eventually removed altogether. The change is not apparent to search apps until after commit() succeeds.</p>
+
+<ul>
+
+<li><p><b>field</b> - The name of an indexed field. (If it is not spec'd as <code>indexed</code>, an error will occur.)</p>
+
+</li>
+<li><p><b>term</b> - The term which identifies docs to be marked as deleted. If <code>field</code> is associated with an Analyzer, <code>term</code> will be processed automatically (so don't pre-process it yourself).</p>
+
+</li>
+</ul>
+
+<h2 id="delete_by_query-query-">delete_by_query(query)</h2>
+
+<p>Mark documents which match the supplied Query as deleted.</p>
+
+<ul>
+
+<li><p><b>query</b> - A <a href="../../Lucy/Search/Query.html">Query</a>.</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::Indexer isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Lexicon.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Lexicon.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Lexicon.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,59 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::Lexicon - Iterator for a field's terms.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $lex_reader = $seg_reader->obtain('Lucy::Index::LexiconReader');
+ my $lexicon = $lex_reader->lexicon( field => 'content' );
+ while ( $lexicon->next ) {
+ print $lexicon->get_term . "\n";
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>A Lexicon is an iterator which provides access to all the unique terms for a given field in sorted order.</p>
+
+<p>If an index consists of two documents with a 'content' field holding "three blind mice" and "three musketeers" respectively, then iterating through the 'content' field's lexicon would produce this list:</p>
+
+<pre><code> blind
+ mice
+ musketeers
+ three</code></pre>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="seek-target-">seek(target)</h2>
+
+<p>Seek the Lexicon to the first iterator state which is greater than or equal to <code>target</code>. If <code>target</code> is undef, reset the iterator.</p>
+
+<h2 id="next-">next()</h2>
+
+<p>Proceed to the next term.</p>
+
+<p>Returns: true until the iterator is exhausted, then false.</p>
+
+<h2 id="get_term-">get_term()</h2>
+
+<p>Return the current term, or undef if the iterator is not in a valid state.</p>
+
+<h2 id="reset-">reset()</h2>
+
+<p>Reset the iterator. next() must be called to proceed to the first element.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::Lexicon isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/LexiconReader.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/LexiconReader.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/LexiconReader.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,49 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::LexiconReader - Read Lexicon data.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $lex_reader = $seg_reader->obtain("Lucy::Index::LexiconReader");
+ my $lexicon = $lex_reader->lexicon( field => 'title' );</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>LexiconReader reads term dictionary information.</p>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="lexicon-labeled-params-">lexicon( <i>[labeled params]</i> )</h2>
+
+<p>Return a new Lexicon for the given <code>field</code>. Will return undef if either the field is not indexed, or if no documents contain a value for the field.</p>
+
+<ul>
+
+<li><p><b>field</b> - Field name.</p>
+
+</li>
+<li><p><b>term</b> - Pre-locate the Lexicon to this term.</p>
+
+</li>
+</ul>
+
+<h2 id="doc_freq-labeled-params-">doc_freq( <i>[labeled params]</i> )</h2>
+
+<p>Return the number of documents where the specified term is present.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::LexiconReader isa <a href="../../Lucy/Index/DataReader.html">Lucy::Index::DataReader</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/PolyReader.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/PolyReader.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/PolyReader.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,37 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::PolyReader - Multi-segment implementation of IndexReader.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $polyreader = Lucy::Index::IndexReader->open(
+ index => '/path/to/index',
+ );
+ my $doc_reader = $polyreader->obtain("Lucy::Index::DocReader");
+ for my $doc_id ( 1 .. $polyreader->doc_max ) {
+ my $doc = $doc_reader->fetch_doc($doc_id);
+ print " $doc_id: $doc->{title}\n";
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>PolyReader conflates index data from multiple segments. For instance, if an index contains three segments with 10 documents each, PolyReader's doc_max() method will return 30.</p>
+
+<p>Some of PolyReader's <a href="../../Lucy/Index/DataReader.html">DataReader</a> components may be less efficient or complete than the single-segment implementations accessed via <a href="../../Lucy/Index/SegReader.html">SegReader</a>.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::PolyReader isa <a href="../../Lucy/Index/IndexReader.html">Lucy::Index::IndexReader</a> isa <a href="../../Lucy/Index/DataReader.html">Lucy::Index::DataReader</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/PostingList.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/PostingList.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/PostingList.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,80 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::PostingList - Term-Document pairings.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $posting_list_reader
+ = $seg_reader->obtain("Lucy::Index::PostingListReader");
+ my $posting_list = $posting_list_reader->posting_list(
+ field => 'content',
+ term => 'foo',
+ );
+ while ( my $doc_id = $posting_list->next ) {
+ say "Matching doc id: $doc_id";
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>PostingList is an iterator which supplies a list of document ids that match a given term.</p>
+
+<p>See <a href="../../Lucy/Docs/IRTheory.html">Lucy::Docs::IRTheory</a> for definitions of "posting" and "posting list".</p>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="next-">next()</h2>
+
+<p>Proceed to the next doc id.</p>
+
+<p>Returns: A positive doc id, or 0 once the iterator is exhausted.</p>
+
+<h2 id="get_doc_id-">get_doc_id()</h2>
+
+<p>Return the current doc id. Valid only after a successful call to next() or advance() and must not be called otherwise.</p>
+
+<h2 id="get_doc_freq-">get_doc_freq()</h2>
+
+<p>Return the number of documents that the PostingList contains. (This number will include any documents which have been marked as deleted but not yet purged.)</p>
+
+<h2 id="seek-target-">seek(target)</h2>
+
+<p>Prepare the PostingList object to iterate over matches for documents that match <code>target</code>.</p>
+
+<ul>
+
+<li><p><b>target</b> - The term to match. If undef, the iterator will be empty.</p>
+
+</li>
+</ul>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="advance-target-">advance(target)</h2>
+
+<p>Advance the iterator to the first doc id greater than or equal to <code>target</code>. The default implementation simply calls next() over and over, but subclasses have the option of doing something more efficient.</p>
+
+<ul>
+
+<li><p><b>target</b> - A positive doc id, which must be greater than the current doc id once the iterator has been initialized.</p>
+
+</li>
+</ul>
+
+<p>Returns: A positive doc id, or 0 once the iterator is exhausted.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::PostingList isa <a href="../../Lucy/Search/Matcher.html">Lucy::Search::Matcher</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/PostingListReader.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/PostingListReader.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/PostingListReader.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,49 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::PostingListReader - Read postings data.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $posting_list_reader
+ = $seg_reader->obtain("Lucy::Index::PostingListReader");
+ my $posting_list = $posting_list_reader->posting_list(
+ field => 'title',
+ term => 'foo',
+ );</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>PostingListReaders produce <a href="../../Lucy/Index/PostingList.html">PostingList</a> objects which convey document matching information.</p>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="posting_list-labeled-params-">posting_list( <i>[labeled params]</i> )</h2>
+
+<p>Returns a PostingList, or undef if either <code>field</code> is undef or <code>field</code> is not present in any documents.</p>
+
+<ul>
+
+<li><p><b>field</b> - A field name.</p>
+
+</li>
+<li><p><b>term</b> - If supplied, the PostingList will be pre-located to this term using seek().</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::PostingListReader isa <a href="../../Lucy/Index/DataReader.html">Lucy::Index::DataReader</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/SegReader.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/SegReader.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/SegReader.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,55 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::SegReader - Single-segment IndexReader.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $polyreader = Lucy::Index::IndexReader->open(
+ index => '/path/to/index',
+ );
+ my $seg_readers = $polyreader->seg_readers;
+ for my $seg_reader (@$seg_readers) {
+ my $seg_name = $seg_reader->get_seg_name;
+ my $num_docs = $seg_reader->doc_max;
+ print "Segment $seg_name ($num_docs documents):\n";
+ my $doc_reader = $seg_reader->obtain("Lucy::Index::DocReader");
+ for my $doc_id ( 1 .. $num_docs ) {
+ my $doc = $doc_reader->fetch_doc($doc_id);
+ print " $doc_id: $doc->{title}\n";
+ }
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>SegReader interprets the data within a single segment of an index.</p>
+
+<p>Generally speaking, only advanced users writing subclasses which manipulate data at the segment level need to deal with the SegReader API directly.</p>
+
+<p>Nearly all of SegReader's functionality is implemented by pluggable components spawned by <a href="../../Lucy/Plan/Architecture.html">Architecture</a>'s factory methods.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="get_seg_name-">get_seg_name()</h2>
+
+<p>Return the name of the segment.</p>
+
+<h2 id="get_seg_num-">get_seg_num()</h2>
+
+<p>Return the number of the segment.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::SegReader isa <a href="../../Lucy/Index/IndexReader.html">Lucy::Index::IndexReader</a> isa <a href="../../Lucy/Index/DataReader.html">Lucy::Index::DataReader</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/SegWriter.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/SegWriter.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/SegWriter.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,61 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::SegWriter - Write one segment of an index.</p>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>SegWriter is a conduit through which information fed to Indexer passes. It manages <a href="../../Lucy/Index/Segment.html">Segment</a> and Inverter, invokes the <a href="../../Lucy/Analysis/Analyzer.html">Analyzer</a> chain, and feeds low level <a href="../../Lucy/Index/DataWriter.html">DataWriters</a> such as PostingListWriter and DocWriter.</p>
+
+<p>The sub-components of a SegWriter are determined by <a href="../../Lucy/Plan/Architecture.html">Architecture</a>. DataWriter components which are added to the stack of writers via add_writer() have add_inverted_doc() invoked for each document supplied to SegWriter's add_doc().</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="add_doc-labeled-params-">add_doc( <i>[labeled params]</i> )</h2>
+
+<p>Add a document to the segment. Inverts <code>doc</code>, increments the Segment's internal document id, then calls add_inverted_doc(), feeding all sub-writers.</p>
+
+<h2 id="add_writer-writer-">add_writer(writer)</h2>
+
+<p>Add a DataWriter to the SegWriter's stack of writers.</p>
+
+<h2 id="register-labeled-params-">register( <i>[labeled params]</i> )</h2>
+
+<p>Register a DataWriter component with the SegWriter. (Note that registration simply makes the writer available via fetch(), so you may also want to call add_writer()).</p>
+
+<ul>
+
+<li><p><b>api</b> - The name of the DataWriter api which <code>writer</code> implements.</p>
+
+</li>
+<li><p><b>component</b> - A DataWriter.</p>
+
+</li>
+</ul>
+
+<h2 id="fetch-api-">fetch(api)</h2>
+
+<p>Retrieve a registered component.</p>
+
+<ul>
+
+<li><p><b>api</b> - The name of the DataWriter api which the component implements.</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::SegWriter isa <a href="../../Lucy/Index/DataWriter.html">Lucy::Index::DataWriter</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Segment.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Segment.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Segment.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,122 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::Segment - Warehouse for information about one segment of an inverted index.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> # Index-time.
+ package MyDataWriter;
+ use base qw( Lucy::Index::DataWriter );
+
+ sub finish {
+ my $self = shift;
+ my $segment = $self->get_segment;
+ my $metadata = $self->SUPER::metadata();
+ $metadata->{foo} = $self->get_foo;
+ $segment->store_metadata(
+ key => 'my_component',
+ metadata => $metadata
+ );
+ }
+
+ # Search-time.
+ package MyDataReader;
+ use base qw( Lucy::Index::DataReader );
+
+ sub new {
+ my $self = shift->SUPER::new(@_);
+ my $segment = $self->get_segment;
+ my $metadata = $segment->fetch_metadata('my_component');
+ if ($metadata) {
+ $self->set_foo( $metadata->{foo} );
+ ...
+ }
+ return $self;
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>Apache Lucy's indexes are made up of individual "segments", each of which is is an independent inverted index. On the file system, each segment is a directory within the main index directory whose name starts with "seg_": "seg_2", "seg_5a", etc.</p>
+
+<p>Each Segment object keeps track of information about an index segment: its fields, document count, and so on. The Segment object itself writes one file, <code>segmeta.json</code>; besides storing info needed by Segment itself, the "segmeta" file serves as a central repository for metadata generated by other index components -- relieving them of the burden of storing metadata themselves.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="add_field-field-">add_field(field)</h2>
+
+<p>Register a new field and assign it a field number. If the field was already known, nothing happens.</p>
+
+<ul>
+
+<li><p><b>field</b> - Field name.</p>
+
+</li>
+</ul>
+
+<p>Returns: the field's field number, which is a positive integer.</p>
+
+<h2 id="store_metadata-labeled-params-">store_metadata( <i>[labeled params]</i> )</h2>
+
+<p>Store arbitrary information in the segment's metadata Hash, to be serialized later. Throws an error if <code>key</code> is used twice.</p>
+
+<ul>
+
+<li><p><b>key</b> - String identifying an index component.</p>
+
+</li>
+<li><p><b>metadata</b> - JSON-izable data structure.</p>
+
+</li>
+</ul>
+
+<h2 id="fetch_metadata-key-">fetch_metadata(key)</h2>
+
+<p>Fetch a value from the Segment's metadata hash.</p>
+
+<h2 id="field_num-field-">field_num(field)</h2>
+
+<p>Given a field name, return its field number for this segment (which may differ from its number in other segments). Return 0 (an invalid field number) if the field name can't be found.</p>
+
+<ul>
+
+<li><p><b>field</b> - Field name.</p>
+
+</li>
+</ul>
+
+<h2 id="field_name-field_num-">field_name(field_num)</h2>
+
+<p>Given a field number, return the name of its field, or undef if the field name can't be found.</p>
+
+<h2 id="get_name-">get_name()</h2>
+
+<p>Getter for the object's seg name.</p>
+
+<h2 id="get_number-">get_number()</h2>
+
+<p>Getter for the segment number.</p>
+
+<h2 id="set_count-count-">set_count(count)</h2>
+
+<p>Setter for the object's document count.</p>
+
+<h2 id="get_count-">get_count()</h2>
+
+<p>Getter for the object's document count.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::Segment isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Similarity.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Similarity.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Similarity.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,59 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::Similarity - Judge how well a document matches a query.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> package MySimilarity;
+
+ sub length_norm { return 1.0 } # disable length normalization
+
+ package MyFullTextType;
+ use base qw( Lucy::Plan::FullTextType );
+
+ sub make_similarity { MySimilarity->new }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>After determining whether a document matches a given query, a score must be calculated which indicates how <i>well</i> the document matches the query. The Similarity class is used to judge how "similar" the query and the document are to each other; the closer the resemblance, they higher the document scores.</p>
+
+<p>The default implementation uses Lucene's modified cosine similarity measure. Subclasses might tweak the existing algorithms, or might be used in conjunction with custom Query subclasses to implement arbitrary scoring schemes.</p>
+
+<p>Most of the methods operate on single fields, but some are used to combine scores from multiple fields.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-">new()</h2>
+
+<pre><code> my $sim = Lucy::Index::Similarity->new;</code></pre>
+
+<p>Constructor. Takes no arguments.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="length_norm-num_tokens-">length_norm(num_tokens)</h2>
+
+<p>Dampen the scores of long documents.</p>
+
+<p>After a field is broken up into terms at index-time, each term must be assigned a weight. One of the factors in calculating this weight is the number of tokens that the original field was broken into.</p>
+
+<p>Typically, we assume that the more tokens in a field, the less important any one of them is -- so that, e.g. 5 mentions of "Kafka" in a short article are given more heft than 5 mentions of "Kafka" in an entire book. The default implementation of length_norm expresses this using an inverted square root.</p>
+
+<p>However, the inverted square root has a tendency to reward very short fields highly, which isn't always appropriate for fields you expect to have a lot of tokens on average.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::Similarity isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Snapshot.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Snapshot.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Index/Snapshot.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,99 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Index::Snapshot - Point-in-time index file list.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $snapshot = Lucy::Index::Snapshot->new;
+ $snapshot->read_file( folder => $folder ); # load most recent snapshot
+ my $files = $snapshot->list;
+ print "$_\n" for @$files;</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>A Snapshot is list of index files and folders. Because index files, once written, are never modified, a Snapshot defines a point-in-time view of the data in an index.</p>
+
+<p><a href="../../Lucy/Index/IndexReader.html">IndexReader</a> objects interpret the data associated with a single Snapshot.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-">new()</h2>
+
+<pre><code> my $snapshot = Lucy::Index::Snapshot->new;</code></pre>
+
+<p>Constructor. Takes no arguments.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="list-">list()</h2>
+
+<p>Return an array of all entries.</p>
+
+<h2 id="num_entries-">num_entries()</h2>
+
+<p>Return the number of entries (including directories).</p>
+
+<h2 id="add_entry-entry-">add_entry(entry)</h2>
+
+<p>Add a filepath to the snapshot.</p>
+
+<h2 id="delete_entry-entry-">delete_entry(entry)</h2>
+
+<p>Delete a filepath from the snapshot.</p>
+
+<p>Returns: true if the entry existed and was successfully deleted, false otherwise.</p>
+
+<h2 id="read_file-labeled-params-">read_file( <i>[labeled params]</i> )</h2>
+
+<p>Decode a snapshot file and initialize the object to reflect its contents.</p>
+
+<ul>
+
+<li><p><b>folder</b> - A Folder.</p>
+
+</li>
+<li><p><b>path</b> - The location of the snapshot file. If not supplied, the most recent snapshot file in the base directory will be chosen.</p>
+
+</li>
+</ul>
+
+<p>Returns: the object, allowing an assignment idiom.</p>
+
+<h2 id="write_file-labeled-params-">write_file( <i>[labeled params]</i> )</h2>
+
+<p>Write a snapshot file. The caller must lock the index while this operation takes place, and the operation will fail if the snapshot file already exists.</p>
+
+<ul>
+
+<li><p><b>folder</b> - A Folder.</p>
+
+</li>
+<li><p><b>path</b> - The path of the file to write. If undef, a file name will be chosen which supersedes the latest snapshot file in the index folder.</p>
+
+</li>
+</ul>
+
+<h2 id="set_path-path-">set_path(path)</h2>
+
+<p>Set the path to the file that the Snapshot object serves as a proxy for.</p>
+
+<h2 id="get_path-">get_path()</h2>
+
+<p>Get the path to the snapshot file. Initially undef; updated by read_file(), write_file(), and set_path().</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Index::Snapshot isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Object/BitVector.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Object/BitVector.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Object/BitVector.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,179 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Object::BitVector - An array of bits.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $bit_vec = Lucy::Object::BitVector->new( capacity => 8 );
+ my $other = Lucy::Object::BitVector->new( capacity => 8 );
+ $bit_vec->set($_) for ( 0, 2, 4, 6 );
+ $other->set($_) for ( 1, 3, 5, 7 );
+ $bit_vec->or($other);
+ print "$_\n" for @{ $bit_vec->to_array }; # prints 0 through 7.</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>BitVector is a growable array of bits. All bits are initially zero.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-labeled-params-">new( <i>[labeled params]</i> )</h2>
+
+<pre><code> my $bit_vec = Lucy::Object::BitVector->new(
+ capacity => $doc_max + 1, # default 0,
+ );</code></pre>
+
+<ul>
+
+<li><p><b>capacity</b> - The number of bits that the initial array should be able to hold.</p>
+
+</li>
+</ul>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="get-tick-">get(tick)</h2>
+
+<p>Return true if the bit at <code>tick</code> has been set, false if it hasn't (regardless of whether it lies within the bounds of the object's capacity).</p>
+
+<ul>
+
+<li><p><b>tick</b> - The requested bit.</p>
+
+</li>
+</ul>
+
+<h2 id="set-tick-">set(tick)</h2>
+
+<p>Set the bit at <code>tick</code> to 1.</p>
+
+<ul>
+
+<li><p><b>tick</b> - The bit to be set.</p>
+
+</li>
+</ul>
+
+<h2 id="clear-tick-">clear(tick)</h2>
+
+<p>Clear the indicated bit. (i.e. set it to 0).</p>
+
+<ul>
+
+<li><p><b>tick</b> - The bit to be cleared.</p>
+
+</li>
+</ul>
+
+<h2 id="clear_all-">clear_all()</h2>
+
+<p>Clear all bits.</p>
+
+<h2 id="and-other-">and(other)</h2>
+
+<p>Modify the BitVector so that only bits which remain set are those which 1) were already set in this BitVector, and 2) were also set in the other BitVector.</p>
+
+<ul>
+
+<li><p><b>other</b> - Another BitVector.</p>
+
+</li>
+</ul>
+
+<h2 id="or-other-">or(other)</h2>
+
+<p>Modify the BitVector, setting all bits which are set in the other BitVector if they were not already set.</p>
+
+<ul>
+
+<li><p><b>other</b> - Another BitVector.</p>
+
+</li>
+</ul>
+
+<h2 id="and_not-other-">and_not(other)</h2>
+
+<p>Modify the BitVector, clearing all bits which are set in the other.</p>
+
+<ul>
+
+<li><p><b>other</b> - Another BitVector.</p>
+
+</li>
+</ul>
+
+<h2 id="xor-other-">xor(other)</h2>
+
+<p>Modify the BitVector, performing an XOR operation against the other.</p>
+
+<ul>
+
+<li><p><b>other</b> - Another BitVector.</p>
+
+</li>
+</ul>
+
+<h2 id="flip-tick-">flip(tick)</h2>
+
+<p>Invert the value of a bit.</p>
+
+<ul>
+
+<li><p><b>tick</b> - The bit to invert.</p>
+
+</li>
+</ul>
+
+<h2 id="flip_block-labeled-params-">flip_block( <i>[labeled params]</i> )</h2>
+
+<p>Invert each bit within a contiguous block.</p>
+
+<ul>
+
+<li><p><b>offset</b> - Lower bound.</p>
+
+</li>
+<li><p><b>length</b> - The number of bits to flip.</p>
+
+</li>
+</ul>
+
+<h2 id="next_hit-tick-">next_hit(tick)</h2>
+
+<p>Returns the next set bit equal to or greater than <code>tick</code>, or -1 if no such bit exists.</p>
+
+<h2 id="to_array-">to_array()</h2>
+
+<p>Return an array where each element represents a set bit.</p>
+
+<h2 id="grow-capacity-">grow(capacity)</h2>
+
+<p>If the BitVector does not already have enough room to hold the indicated number of bits, allocate more memory so that it can.</p>
+
+<ul>
+
+<li><p><b>capacity</b> - Least number of bits the BitVector should accomodate.</p>
+
+</li>
+</ul>
+
+<h2 id="count-">count()</h2>
+
+<p>Return a count of the number of set bits.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Object::BitVector isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Object/Err.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Object/Err.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Object/Err.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,46 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Object::Err - Exception.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> use Scalar::Util qw( blessed );
+ my $bg_merger;
+ while (1) {
+ $bg_merger = eval {
+ Lucy::Index::BackgroundMerger->new( index => $index );
+ };
+ last if $bg_merger;
+ if ( blessed($@) and $@->isa("Lucy::Store::LockErr") ) {
+ warn "Retrying...\n";
+ }
+ else {
+ # Re-throw.
+ die "Failed to open BackgroundMerger: $@";
+ }
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>Most of the time when Lucy encounters an error, it tries to raise a Lucy::Object::Err exception with an error message and context information.</p>
+
+<p>At present, it is only safe to catch exceptions which are specifically documented as catchable; most times when an Err is raised, Lucy leaks memory.</p>
+
+<p>The Err module also provides access to a per-thread Err shared variable via set_error() and get_error(). It may be used to store an Err object temporarily, so that calling code may choose how to handle a particular error condition.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Object::Err isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Object/Obj.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Object/Obj.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Object/Obj.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,127 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Object::Obj - Base class for all Lucy objects.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> package MyObj;
+ use base qw( Lucy::Object::Obj );
+
+ # Inside-out member var.
+ my %foo;
+
+ sub new {
+ my ( $class, %args ) = @_;
+ my $foo = delete $args{foo};
+ my $self = $class->SUPER::new(%args);
+ $foo{$$self} = $foo;
+ return $self;
+ }
+
+ sub get_foo {
+ my $self = shift;
+ return $foo{$$self};
+ }
+
+ sub DESTROY {
+ my $self = shift;
+ delete $foo{$$self};
+ $self->SUPER::DESTROY;
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>All objects in the Lucy:: hierarchy descend from Lucy::Object::Obj. All classes are implemented as blessed scalar references, with the scalar storing a pointer to a C struct.</p>
+
+<h2 id="Subclassing">Subclassing</h2>
+
+<p>The recommended way to subclass Lucy::Object::Obj and its descendants is to use the inside-out design pattern. (See <a href="http://search.cpan.org/perldoc?Class::InsideOut">Class::InsideOut</a> for an introduction to inside-out techniques.)</p>
+
+<p>Since the blessed scalar stores a C pointer value which is unique per-object, <code>$$self</code> can be used as an inside-out ID.</p>
+
+<pre><code> # Accessor for 'foo' member variable.
+ sub get_foo {
+ my $self = shift;
+ return $foo{$$self};
+ }</code></pre>
+
+<p>Caveats:</p>
+
+<ul>
+
+<li><p>Inside-out aficionados will have noted that the "cached scalar id" stratagem recommended above isn't compatible with ithreads -- but Lucy doesn't support ithreads anyway, so it doesn't matter.</p>
+
+</li>
+<li><p>Overridden methods must not return undef unless the API specifies that returning undef is permissible. (Failure to adhere to this rule currently results in a segfault rather than an exception.)</p>
+
+</li>
+</ul>
+
+<h1 id="CONSTRUCTOR">CONSTRUCTOR</h1>
+
+<h2 id="new-">new()</h2>
+
+<p>Abstract constructor -- must be invoked via a subclass. Attempting to instantiate objects of class "Lucy::Object::Obj" directly causes an error.</p>
+
+<p>Takes no arguments; if any are supplied, an error will be reported.</p>
+
+<h1 id="DESTRUCTOR">DESTRUCTOR</h1>
+
+<h2 id="DESTROY">DESTROY</h2>
+
+<p>All Lucy classes implement a DESTROY method; if you override it in a subclass, you must call <code>$self->SUPER::DESTROY</code> to avoid leaking memory.</p>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="to_i64-">to_i64()</h2>
+
+<p>Convert the object to a 64-bit integer.</p>
+
+<h2 id="to_f64-">to_f64()</h2>
+
+<p>Convert the object to a double precision floating point number.</p>
+
+<h2 id="load-dump-">load(dump)</h2>
+
+<p>Create an object from the output of a call to dump(). Implementations must not reference the caller.</p>
+
+<ul>
+
+<li><p><b>dump</b> - The output of dump().</p>
+
+</li>
+</ul>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="to_string-">to_string()</h2>
+
+<p>Generic stringification: "ClassName@hex_mem_address".</p>
+
+<h2 id="equals-other-">equals(other)</h2>
+
+<p>Indicate whether two objects are the same. By default, compares the memory address.</p>
+
+<ul>
+
+<li><p><b>other</b> - Another Obj.</p>
+
+</li>
+</ul>
+
+<h2 id="dump-">dump()</h2>
+
+<p>Return a representation of the object using only scalars, hashes, and arrays. Some implementations support JSON serialization via dump() and its companion method, load(); for others, dump() is only a debugging aid. The default simply calls to_string().</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/Architecture.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/Architecture.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/Architecture.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,101 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Plan::Architecture - Configure major components of an index.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> package MyArchitecture;
+ use base qw( Lucy::Plan::Architecture );
+
+ use LucyX::Index::ZlibDocWriter;
+ use LucyX::Index::ZlibDocReader;
+
+ sub register_doc_writer {
+ my ( $self, $seg_writer ) = @_;
+ my $doc_writer = LucyX::Index::ZlibDocWriter->new(
+ snapshot => $seg_writer->get_snapshot,
+ segment => $seg_writer->get_segment,
+ polyreader => $seg_writer->get_polyreader,
+ );
+ $seg_writer->register(
+ api => "Lucy::Index::DocReader",
+ component => $doc_writer,
+ );
+ $seg_writer->add_writer($doc_writer);
+ }
+
+ sub register_doc_reader {
+ my ( $self, $seg_reader ) = @_;
+ my $doc_reader = LucyX::Index::ZlibDocReader->new(
+ schema => $seg_reader->get_schema,
+ folder => $seg_reader->get_folder,
+ segments => $seg_reader->get_segments,
+ seg_tick => $seg_reader->get_seg_tick,
+ snapshot => $seg_reader->get_snapshot,
+ );
+ $seg_reader->register(
+ api => 'Lucy::Index::DocReader',
+ component => $doc_reader,
+ );
+ }
+
+ package MySchema;
+ use base qw( Lucy::Plan::Schema );
+
+ sub architecture {
+ shift;
+ return MyArchitecture->new(@_);
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>By default, a Lucy index consists of several main parts: lexicon, postings, stored documents, deletions, and highlight data. The readers and writers for that data are spawned by Architecture. Each component operates at the segment level; Architecture's factory methods are used to build up <a href="../../Lucy/Index/SegWriter.html">SegWriter</a> and <a href="../../Lucy/Index/SegReader.html">SegReader</a>.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-">new()</h2>
+
+<pre><code> my $arch = Lucy::Plan::Architecture->new;</code></pre>
+
+<p>Constructor. Takes no arguments.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="register_doc_writer-writer-">register_doc_writer(writer)</h2>
+
+<p>Spawn a DataWriter and register() it with the supplied SegWriter, adding it to the SegWriter's writer stack.</p>
+
+<ul>
+
+<li><p><b>writer</b> - A SegWriter.</p>
+
+</li>
+</ul>
+
+<h2 id="register_doc_reader-reader-">register_doc_reader(reader)</h2>
+
+<p>Spawn a DocReader and register() it with the supplied SegReader.</p>
+
+<ul>
+
+<li><p><b>reader</b> - A SegReader.</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Plan::Architecture isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/BlobType.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/BlobType.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/BlobType.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,47 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Plan::BlobType - Default behaviors for binary fields.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $string_type = Lucy::Plan::StringType->new;
+ my $blob_type = Lucy::Plan::BlobType->new( stored => 1 );
+ my $schema = Lucy::Plan::Schema->new;
+ $schema->spec_field( name => 'id', type => $string_type );
+ $schema->spec_field( name => 'jpeg', type => $blob_type );</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>BlobType is an implementation of FieldType tuned for use with fields containing binary data, which cannot be indexed or searched -- only stored.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-labeled-params-">new( <i>[labeled params]</i> )</h2>
+
+<pre><code> my $blob_type = Lucy::Plan::BlobType->new(
+ stored => 1, # default: false
+ );</code></pre>
+
+<ul>
+
+<li><p><b>stored</b> - boolean indicating whether the field should be stored.</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Plan::BlobType isa <a href="../../Lucy/Plan/FieldType.html">Lucy::Plan::FieldType</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/FieldType.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/FieldType.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/FieldType.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,69 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Plan::FieldType - Define a field's behavior.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my @sortable;
+ for my $field ( @{ $schema->all_fields } ) {
+ my $type = $schema->fetch_type($field);
+ next unless $type->sortable;
+ push @sortable, $field;
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>FieldType is an abstract class defining a set of traits and behaviors which may be associated with one or more field names.</p>
+
+<p>Properties which are common to all field types include <code>boost</code>, <code>indexed</code>, <code>stored</code>, <code>sortable</code>, <code>binary</code>, and <code>similarity</code>.</p>
+
+<p>The <code>boost</code> property is a floating point scoring multiplier which defaults to 1.0. Values greater than 1.0 cause the field to contribute more to a document's score, lower values, less.</p>
+
+<p>The <code>indexed</code> property indicates whether the field should be indexed (so that it can be searched).</p>
+
+<p>The <code>stored</code> property indicates whether to store the raw field value, so that it can be retrieved when a document turns up in a search.</p>
+
+<p>The <code>sortable</code> property indicates whether search results should be sortable based on the contents of the field.</p>
+
+<p>The <code>binary</code> property indicates whether the field contains binary or text data. Unlike most other properties, <code>binary</code> is not settable.</p>
+
+<p>The <code>similarity</code> property is a <a href="../../Lucy/Index/Similarity.html">Similarity</a> object which defines matching and scoring behavior for the field. It is required if the field is <code>indexed</code>.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="get_boost-">get_boost()</h2>
+
+<p>Accessor for <code>boost</code>.</p>
+
+<h2 id="indexed-">indexed()</h2>
+
+<p>Accessor for <code>indexed</code>.</p>
+
+<h2 id="stored-">stored()</h2>
+
+<p>Accessor for <code>stored</code>.</p>
+
+<h2 id="sortable-">sortable()</h2>
+
+<p>Accessor for <code>sortable</code>.</p>
+
+<h2 id="binary-">binary()</h2>
+
+<p>Indicate whether the field contains binary data.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Plan::FieldType isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/FullTextType.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/FullTextType.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/FullTextType.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,85 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Plan::FullTextType - Full-text search field type.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
+ language => 'en',
+ );
+ my $type = Lucy::Plan::FullTextType->new(
+ analyzer => $polyanalyzer,
+ );
+ my $schema = Lucy::Plan::Schema->new;
+ $schema->spec_field( name => 'title', type => $type );
+ $schema->spec_field( name => 'content', type => $type );</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>Lucy::Plan::FullTextType is an implementation of <a href="../../Lucy/Plan/FieldType.html">Lucy::Plan::FieldType</a> tuned for "full text search".</p>
+
+<p>Full text fields are associated with an <a href="../../Lucy/Analysis/Analyzer.html">Analyzer</a>, which is used to tokenize and normalize the text so that it can be searched for individual words.</p>
+
+<p>For an exact-match, single value field type using character data, see <a href="../../Lucy/Plan/StringType.html">StringType</a>.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-labeled-params-">new( <i>[labeled params]</i> )</h2>
+
+<pre><code> my $type = Lucy::Plan::FullTextType->new(
+ analyzer => $analyzer, # required
+ boost => 2.0, # default: 1.0
+ indexed => 1, # default: true
+ stored => 1, # default: true
+ sortable => 1, # default: false
+ highlightable => 1, # default: false
+ );</code></pre>
+
+<ul>
+
+<li><p><b>analyzer</b> - An Analyzer.</p>
+
+</li>
+<li><p><b>boost</b> - floating point per-field boost.</p>
+
+</li>
+<li><p><b>indexed</b> - boolean indicating whether the field should be indexed.</p>
+
+</li>
+<li><p><b>stored</b> - boolean indicating whether the field should be stored.</p>
+
+</li>
+<li><p><b>sortable</b> - boolean indicating whether the field should be sortable.</p>
+
+</li>
+<li><p><b>highlightable</b> - boolean indicating whether the field should be highlightable.</p>
+
+</li>
+</ul>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="set_highlightable-highlightable-">set_highlightable(highlightable)</h2>
+
+<p>Indicate whether to store data required by <a href="../../Lucy/Highlight/Highlighter.html">Lucy::Highlight::Highlighter</a> for excerpt selection and search term highlighting.</p>
+
+<h2 id="highlightable-">highlightable()</h2>
+
+<p>Accessor for "highlightable" property.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Plan::FullTextType isa <a href="../../Lucy/Plan/TextType.html">Lucy::Plan::TextType</a> isa <a href="../../Lucy/Plan/FieldType.html">Lucy::Plan::FieldType</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/Schema.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/Schema.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/Schema.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,96 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Plan::Schema - User-created specification for an inverted index.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> use Lucy::Plan::Schema;
+ use Lucy::Plan::FullTextType;
+ use Lucy::Analysis::PolyAnalyzer;
+
+ my $schema = Lucy::Plan::Schema->new;
+ my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
+ language => 'en',
+ );
+ my $type = Lucy::Plan::FullTextType->new(
+ analyzer => $polyanalyzer,
+ );
+ $schema->spec_field( name => 'title', type => $type );
+ $schema->spec_field( name => 'content', type => $type );</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>A Schema is a specification which indicates how other entities should interpret the raw data in an inverted index and interact with it.</p>
+
+<p>Once an actual index has been created using a particular Schema, existing field definitions may not be changed. However, it is possible to add new fields during subsequent indexing sessions.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-">new()</h2>
+
+<pre><code> my $schema = Lucy::Plan::Schema->new;</code></pre>
+
+<p>Constructor. Takes no arguments.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="spec_field-labeled-params-">spec_field( <i>[labeled params]</i> )</h2>
+
+<p>Define the behavior of a field by associating it with a FieldType.</p>
+
+<p>If this method has already been called for the supplied <code>field</code>, it will merely test to verify that the supplied FieldType equals() the existing one.</p>
+
+<ul>
+
+<li><p><b>name</b> - The name of the field.</p>
+
+</li>
+<li><p><b>type</b> - A FieldType.</p>
+
+</li>
+</ul>
+
+<h2 id="num_fields-">num_fields()</h2>
+
+<p>Return the number of fields currently defined.</p>
+
+<h2 id="all_fields-">all_fields()</h2>
+
+<p>Return all the Schema's field names as an array.</p>
+
+<h2 id="fetch_type-field-">fetch_type(field)</h2>
+
+<p>Return the FieldType for the specified field. If the field can't be found, return undef.</p>
+
+<h2 id="fetch_sim-field-">fetch_sim(field)</h2>
+
+<p>Return the Similarity for the specified field, or undef if either the field can't be found or it isn't associated with a Similarity.</p>
+
+<h2 id="architecture-">architecture()</h2>
+
+<p>Factory method which creates an Architecture object for this index.</p>
+
+<h2 id="get_architecture-">get_architecture()</h2>
+
+<p>Return the Schema instance's internal Architecture object.</p>
+
+<h2 id="get_similarity-">get_similarity()</h2>
+
+<p>Return the Schema instance's internal Similarity object.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Plan::Schema isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/StringType.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/StringType.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Plan/StringType.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,57 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Plan::StringType - Non-tokenized text type.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $type = Lucy::Plan::StringType->new;
+ my $schema = Lucy::Plan::Schema->new;
+ $schema->spec_field( name => 'category', type => $type );</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>Lucy::Plan::StringType is used for "exact-match" strings.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-">new()</h2>
+
+<pre><code> my $type = Lucy::Plan::StringType->new(
+ boost => 0.1, # default: 1.0
+ indexed => 1, # default: true
+ stored => 1, # default: true
+ sortable => 1, # default: false
+ );</code></pre>
+
+<ul>
+
+<li><p><b>boost</b> - floating point per-field boost.</p>
+
+</li>
+<li><p><b>indexed</b> - boolean indicating whether the field should be indexed.</p>
+
+</li>
+<li><p><b>stored</b> - boolean indicating whether the field should be stored.</p>
+
+</li>
+<li><p><b>sortable</b> - boolean indicating whether the field should be sortable.</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Plan::StringType isa <a href="../../Lucy/Plan/TextType.html">Lucy::Plan::TextType</a> isa <a href="../../Lucy/Plan/FieldType.html">Lucy::Plan::FieldType</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/ANDQuery.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/ANDQuery.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/ANDQuery.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,53 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Search::ANDQuery - Intersect multiple result sets.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $foo_and_bar_query = Lucy::Search::ANDQuery->new(
+ children => [ $foo_query, $bar_query ],
+ );
+ my $hits = $searcher->hits( query => $foo_and_bar_query );
+ ...</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>ANDQuery is a composite <a href="../../Lucy/Search/Query.html">Query</a> which matches only when all of its children match, so its result set is the intersection of their result sets. Documents which match receive a summed score.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-labeled-params-">new( <i>[labeled params]</i> )</h2>
+
+<pre><code> my $foo_and_bar_query = Lucy::Search::ANDQuery->new(
+ children => [ $foo_query, $bar_query ],
+ );</code></pre>
+
+<ul>
+
+<li><p><b>children</b> - An array of child Queries.</p>
+
+</li>
+</ul>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="add_child-query-">add_child(query)</h2>
+
+<p>Add a child Query node.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Search::ANDQuery isa <a href="../../Lucy/Search/PolyQuery.html">Lucy::Search::PolyQuery</a> isa <a href="../../Lucy/Search/Query.html">Lucy::Search::Query</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/Collector.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/Collector.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/Collector.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,59 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Search::Collector - Process hits.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> # Abstract base class.</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>A Collector decides what to do with the hits that a <a href="../../Lucy/Search/Matcher.html">Matcher</a> iterates through, based on how the abstract collect() method is implemented.</p>
+
+<p>Collectors operate on individual segments, but must operate within the context of a larger collection. Each time the collector moves to a new segment, set_reader(), set_base() and set_matcher() will be called, and the collector must take the updated information into account.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-">new()</h2>
+
+<pre><code> package MyCollector;
+ use base qw( Lucy::Search::Collector );
+ our %foo;
+ sub new {
+ my $self = shift->SUPER::new;
+ my %args = @_;
+ $foo{$$self} = $args{foo};
+ return $self;
+ }</code></pre>
+
+<p>Abstract constructor. Takes no arguments.</p>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="collect-doc_id-">collect(doc_id)</h2>
+
+<p>Do something with a doc id. (For instance, keep track of the docs with the ten highest scores.)</p>
+
+<ul>
+
+<li><p><b>doc_id</b> - A segment document id.</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Search::Collector isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/Collector/BitCollector.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/Collector/BitCollector.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/Collector/BitCollector.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,58 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Search::Collector::BitCollector - Collector which records doc nums in a BitVector.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> my $bit_vec = Lucy::Object::BitVector->new(
+ capacity => $searcher->doc_max + 1,
+ );
+ my $bit_collector = Lucy::Search::Collector::BitCollector->new(
+ bit_vector => $bit_vec,
+ );
+ $searcher->collect(
+ collector => $bit_collector,
+ query => $query,
+ );</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>BitCollector is a Collector which saves matching document ids in a <a href="../../../Lucy/Object/BitVector.html">BitVector</a>. It is useful for recording the entire set of documents which matches a query.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-labeled-params-">new( <i>[labeled params]</i> )</h2>
+
+<pre><code> my $bit_collector = Lucy::Search::Collector::BitCollector->new(
+ bit_vector => $bit_vec, # required
+ );</code></pre>
+
+<ul>
+
+<li><p><b>bit_vector</b> - A Lucy::Object::BitVector.</p>
+
+</li>
+</ul>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="collect-doc_id-">collect(doc_id)</h2>
+
+<p>Set bit in the object's BitVector for the supplied doc id.</p>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Search::Collector::BitCollector isa <a href="../../../Lucy/Search/Collector.html">Lucy::Search::Collector</a> isa <a href="../../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+
Added: websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/Compiler.html
==============================================================================
--- websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/Compiler.html (added)
+++ websites/staging/lucy/trunk/content/docs/perl/Lucy/Search/Compiler.html Sat Mar 31 03:36:16 2012
@@ -0,0 +1,152 @@
+
+<html>
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+</head>
+<body>
+
+
+<h1 id="NAME">NAME</h1>
+
+<p>Lucy::Search::Compiler - Query-to-Matcher compiler.</p>
+
+<h1 id="SYNOPSIS">SYNOPSIS</h1>
+
+<pre><code> # (Compiler is an abstract base class.)
+ package MyCompiler;
+ use base qw( Lucy::Search::Compiler );
+
+ sub make_matcher {
+ my $self = shift;
+ return MyMatcher->new( @_, compiler => $self );
+ }</code></pre>
+
+<h1 id="DESCRIPTION">DESCRIPTION</h1>
+
+<p>The purpose of the Compiler class is to take a specification in the form of a <a href="../../Lucy/Search/Query.html">Query</a> object and compile a <a href="../../Lucy/Search/Matcher.html">Matcher</a> object that can do real work.</p>
+
+<p>The simplest Compiler subclasses -- such as those associated with constant-scoring Query types -- might simply implement a make_matcher() method which passes along information verbatim from the Query to the Matcher's constructor.</p>
+
+<p>However it is common for the Compiler to perform some calculations which affect it's "weight" -- a floating point multiplier that the Matcher will factor into each document's score. If that is the case, then the Compiler subclass may wish to override get_weight(), sum_of_squared_weights(), and apply_norm_factor().</p>
+
+<p>Compiling a Matcher is a two stage process.</p>
+
+<p>The first stage takes place during the Compiler's constructor, which is where the Query object meets a <a href="../../Lucy/Search/Searcher.html">Searcher</a> object for the first time. Searchers operate on a specific document collection and they can tell you certain statistical information about the collection -- such as how many total documents are in the collection, or how many documents in the collection a particular term is present in. Lucy's core Compiler classes plug this information into the classic TF/IDF weighting algorithm to adjust the Compiler's weight; custom subclasses might do something similar.</p>
+
+<p>The second stage of compilation is make_matcher(), method, which is where the Compiler meets a <a href="../../Lucy/Index/SegReader.html">SegReader</a> object. SegReaders are associated with a single segment within a single index on a single machine, and are thus lower-level than Searchers, which may represent a document collection spread out over a search cluster (comprising several indexes and many segments). The Compiler object can use new information supplied by the SegReader -- such as whether a term is missing from the local index even though it is present within the larger collection represented by the Searcher -- when figuring out what to feed to the Matchers's constructor, or whether make_matcher() should return a Matcher at all.</p>
+
+<h1 id="CONSTRUCTORS">CONSTRUCTORS</h1>
+
+<h2 id="new-labeled-params-">new( <i>[labeled params]</i> )</h2>
+
+<pre><code> my $compiler = MyCompiler->SUPER::new(
+ parent => $my_query,
+ searcher => $searcher,
+ similarity => $sim, # default: undef
+ boost => undef, # default: see below
+ );</code></pre>
+
+<p>Abstract constructor.</p>
+
+<ul>
+
+<li><p><b>parent</b> - The parent Query.</p>
+
+</li>
+<li><p><b>searcher</b> - A Lucy::Search::Searcher, such as an IndexSearcher.</p>
+
+</li>
+<li><p><b>similarity</b> - A Similarity.</p>
+
+</li>
+<li><p><b>boost</b> - An arbitrary scoring multiplier. Defaults to the boost of the parent Query.</p>
+
+</li>
+</ul>
+
+<h1 id="ABSTRACT-METHODS">ABSTRACT METHODS</h1>
+
+<h2 id="make_matcher-labeled-params-">make_matcher( <i>[labeled params]</i> )</h2>
+
+<p>Factory method returning a Matcher.</p>
+
+<ul>
+
+<li><p><b>reader</b> - A SegReader.</p>
+
+</li>
+<li><p><b>need_score</b> - Indicate whether the Matcher must implement score().</p>
+
+</li>
+</ul>
+
+<p>Returns: a Matcher, or undef if the Matcher would have matched no documents.</p>
+
+<h1 id="METHODS">METHODS</h1>
+
+<h2 id="get_weight-">get_weight()</h2>
+
+<p>Return the Compiler's numerical weight, a scoring multiplier. By default, returns the object's boost.</p>
+
+<h2 id="sum_of_squared_weights-">sum_of_squared_weights()</h2>
+
+<p>Compute and return a raw weighting factor. (This quantity is used by normalize()). By default, simply returns 1.0.</p>
+
+<h2 id="apply_norm_factor-factor-">apply_norm_factor(factor)</h2>
+
+<p>Apply a floating point normalization multiplier. For a TermCompiler, this involves multiplying its own weight by the supplied factor; combining classes such as ORCompiler would apply the factor recursively to their children.</p>
+
+<p>The default implementation is a no-op; subclasses may wish to multiply their internal weight by the supplied factor.</p>
+
+<ul>
+
+<li><p><b>factor</b> - The multiplier.</p>
+
+</li>
+</ul>
+
+<h2 id="normalize-">normalize()</h2>
+
+<p>Take a newly minted Compiler object and apply query-specific normalization factors. Should be called at or near the end of construction.</p>
+
+<p>For a TermQuery, the scoring formula is approximately:</p>
+
+<pre><code> (tf_d * idf_t / norm_d) * (tf_q * idf_t / norm_q)</code></pre>
+
+<p>normalize() is theoretically concerned with applying the second half of that formula to a the Compiler's weight. What actually happens depends on how the Compiler and Similarity methods called internally are implemented.</p>
+
+<h2 id="get_parent-">get_parent()</h2>
+
+<p>Accessor for the Compiler's parent Query object.</p>
+
+<h2 id="get_similarity-">get_similarity()</h2>
+
+<p>Accessor for the Compiler's Similarity object.</p>
+
+<h2 id="highlight_spans-labeled-params-">highlight_spans( <i>[labeled params]</i> )</h2>
+
+<p>Return an array of Span objects, indicating where in the given field the text that matches the parent Query occurs and how well each snippet matches. The Span's offset and length are measured in Unicode code points.</p>
+
+<p>The default implementation returns an empty array.</p>
+
+<ul>
+
+<li><p><b>searcher</b> - A Searcher.</p>
+
+</li>
+<li><p><b>doc_vec</b> - A DocVector.</p>
+
+</li>
+<li><p><b>field</b> - The name of the field.</p>
+
+</li>
+</ul>
+
+<h1 id="INHERITANCE">INHERITANCE</h1>
+
+<p>Lucy::Search::Compiler isa <a href="../../Lucy/Search/Query.html">Lucy::Search::Query</a> isa <a href="../../Lucy/Object/Obj.html">Lucy::Object::Obj</a>.</p>
+
+</body>
+</html>
+