Modified: websites/staging/lucy/trunk/content/docs/test/Lucy/Store/FSFolder.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/Lucy/Store/FSFolder.html (original) +++ websites/staging/lucy/trunk/content/docs/test/Lucy/Store/FSFolder.html Fri Feb 26 13:44:48 2016 @@ -81,9 +81,9 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> my $folder = Lucy::Store::FSFolder->new( - path => '/path/to/folder', - );</pre> +<pre>my $folder = Lucy::Store::FSFolder->new( + path => '/path/to/folder', +);</pre> <h2><a class='u' name="DESCRIPTION" @@ -100,14 +100,17 @@ name="CONSTRUCTORS" name="new" >new</a></h3> -<pre> my $folder = Lucy::Store::FSFolder->new( - path => '/path/to/folder', - );</pre> +<pre>my $folder = Lucy::Store::FSFolder->new( + path => '/path/to/folder', +);</pre> <p>Create a new Folder.</p> <ul> -<li><b>path</b> - Location of the index. If the specified directory does not exist already, it will NOT be created, in order to prevent misconfigured read applications from spawning bogus files – so it may be necessary to create the directory yourself.</li> +<li><b>path</b> - Location of the index. +If the specified directory does not exist already, +it will NOT be created, +in order to prevent misconfigured read applications from spawning bogus files – so it may be necessary to create the directory yourself.</li> </ul> <h2><a class='u'
Modified: websites/staging/lucy/trunk/content/docs/test/Lucy/Store/Folder.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/Lucy/Store/Folder.html (original) +++ websites/staging/lucy/trunk/content/docs/test/Lucy/Store/Folder.html Fri Feb 26 13:44:48 2016 @@ -81,16 +81,22 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> # Abstract base class.</pre> +<pre># Abstract base class.</pre> <h2><a class='u' name="DESCRIPTION" >DESCRIPTION</a></h2> -<p>A “file” within a Folder might be a real file on disk – or it might be a RAM buffer. Similarly, Delete() might delete a file from the file system, or a key-value pair from a hash, or something else.</p> +<p>A “file” within a Folder might be a real file on disk – or it might be a RAM buffer. +Similarly, +Delete() might delete a file from the file system, +or a key-value pair from a hash, +or something else.</p> -<p>The archetypal implementation of Folder, <a href="../../Lucy/Store/FSFolder.html" class="podlinkpod" ->FSFolder</a>, represents a directory on the file system holding a collection of files.</p> +<p>The archetypal implementation of Folder, +<a href="../../Lucy/Store/FSFolder.html" class="podlinkpod" +>FSFolder</a>, +represents a directory on the file system holding a collection of files.</p> <h2><a class='u' name="INHERITANCE" Modified: websites/staging/lucy/trunk/content/docs/test/Lucy/Store/Lock.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/Lucy/Store/Lock.html (original) +++ websites/staging/lucy/trunk/content/docs/test/Lucy/Store/Lock.html Fri Feb 26 13:44:48 2016 @@ -81,21 +81,24 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> my $lock = $lock_factory->make_lock( - name => 'write', - timeout => 5000, - ); - $lock->obtain or die "can't get lock for " . $lock->get_name; - do_stuff(); - $lock->release;</pre> +<pre>my $lock = $lock_factory->make_lock( + name => 'write', + timeout => 5000, +); +$lock->obtain or die "can't get lock for " . $lock->get_name; +do_stuff(); +$lock->release;</pre> <h2><a class='u' name="DESCRIPTION" >DESCRIPTION</a></h2> -<p>The Lock class produces an interprocess mutex lock. The default subclass uses dot-lock files, but alternative implementations are possible.</p> +<p>The Lock class produces an interprocess mutex lock. +The default subclass uses dot-lock files, +but alternative implementations are possible.</p> -<p>Each lock must have a name which is unique per resource to be locked. Each lock also has a “host” id which should be unique per machine; it is used to help clear away stale locks.</p> +<p>Each lock must have a name which is unique per resource to be locked. +Each lock also has a “host” id which should be unique per machine; it is used to help clear away stale locks.</p> <h2><a class='u' name="CONSTRUCTORS" @@ -105,20 +108,21 @@ name="CONSTRUCTORS" name="new" >new</a></h3> -<pre> my $lock = Lucy::Store::Lock->new( - name => 'commit', # required - folder => $folder, # required - host => $hostname, # required - timeout => 5000, # default: 0 - interval => 1000, # default: 100 - );</pre> +<pre>my $lock = Lucy::Store::Lock->new( + name => 'commit', # required + folder => $folder, # required + host => $hostname, # required + timeout => 5000, # default: 0 + interval => 1000, # default: 100 +);</pre> <p>Abstract constructor.</p> <ul> <li><b>folder</b> - A Folder.</li> -<li><b>name</b> - String identifying the resource to be locked, which must consist solely of characters matching [-_.A-Za-z0-9].</li> +<li><b>name</b> - String identifying the resource to be locked, +which must consist solely of characters matching [-_.A-Za-z0-9].</li> <li><b>host</b> - A unique per-machine identifier.</li> @@ -136,33 +140,39 @@ name="ABSTRACT_METHODS" name="shared" >shared</a></h3> -<pre> my $retval = $lock->shared();</pre> +<pre>my $retval = $lock->shared();</pre> -<p>Returns true if the Lock is shared, false if the Lock is exclusive.</p> +<p>Returns true if the Lock is shared, +false if the Lock is exclusive.</p> <h3><a class='u' name="request" >request</a></h3> -<pre> my $retval = $lock->request();</pre> +<pre>my $retval = $lock->request();</pre> <p>Make one attempt to acquire the lock.</p> <p>The semantics of <a href="#request" class="podlinkpod" >request()</a> differ depending on whether <a href="#shared" class="podlinkpod" ->shared()</a> returns true. If the Lock is <a href="#shared" class="podlinkpod" ->shared()</a>, then <a href="#request" class="podlinkpod" ->request()</a> should not fail if another lock is held against the resource identified by <code>name</code> (though it might fail for other reasons). If it is not <a href="#shared" class="podlinkpod" ->shared()</a> – i.e. it’s an exclusive (write) lock – then other locks should cause <a href="#request" class="podlinkpod" +>shared()</a> returns true. +If the Lock is <a href="#shared" class="podlinkpod" +>shared()</a>, +then <a href="#request" class="podlinkpod" +>request()</a> should not fail if another lock is held against the resource identified by <code>name</code> (though it might fail for other reasons). +If it is not <a href="#shared" class="podlinkpod" +>shared()</a> – i.e. +it’s an exclusive (write) lock – then other locks should cause <a href="#request" class="podlinkpod" >request()</a> to fail.</p> -<p>Returns: true on success, false on failure (sets the global error object returned by Clownfish->error).</p> +<p>Returns: true on success, +false on failure (sets the global error object returned by Clownfish->error).</p> <h3><a class='u' name="release" >release</a></h3> -<pre> $lock->release();</pre> +<pre>$lock->release();</pre> <p>Release the lock.</p> @@ -170,19 +180,22 @@ name="release" name="is_locked" >is_locked</a></h3> -<pre> my $retval = $lock->is_locked();</pre> +<pre>my $retval = $lock->is_locked();</pre> <p>Indicate whether the resource identified by this lock’s name is currently locked.</p> -<p>Returns: true if the resource is locked, false otherwise.</p> +<p>Returns: true if the resource is locked, +false otherwise.</p> <h3><a class='u' name="clear_stale" >clear_stale</a></h3> -<pre> $lock->clear_stale();</pre> +<pre>$lock->clear_stale();</pre> -<p>Release all locks that meet the following three conditions: the lock name matches, the host id matches, and the process id that the lock was created under no longer identifies an active process.</p> +<p>Release all locks that meet the following three conditions: the lock name matches, +the host id matches, +and the process id that the lock was created under no longer identifies an active process.</p> <h2><a class='u' name="METHODS" @@ -192,13 +205,14 @@ name="METHODS" name="obtain" >obtain</a></h3> -<pre> my $retval = $lock->obtain();</pre> +<pre>my $retval = $lock->obtain();</pre> <p>Call <a href="#request" class="podlinkpod" >request()</a> once per <code>interval</code> until <a href="#request" >class="podlinkpod" >request()</a> returns success or the <code>timeout</code> has been >reached.</p> -<p>Returns: true on success, false on failure (sets the global error object returned by Clownfish->error).</p> +<p>Returns: true on success, +false on failure (sets the global error object returned by Clownfish->error).</p> <h2><a class='u' name="INHERITANCE" Modified: websites/staging/lucy/trunk/content/docs/test/Lucy/Store/LockErr.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/Lucy/Store/LockErr.html (original) +++ websites/staging/lucy/trunk/content/docs/test/Lucy/Store/LockErr.html Fri Feb 26 13:44:48 2016 @@ -81,19 +81,19 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> while (1) { - my $bg_merger = eval { - Lucy::Index::BackgroundMerger->new( index => $index ); - }; - if ( blessed($@) and $@->isa("Lucy::Store::LockErr") ) { - warn "Retrying...\n"; - } - elsif (!$bg_merger) { - # Re-throw. - die "Failed to open BackgroundMerger: $@"; - } - ... - }</pre> +<pre>while (1) { + my $bg_merger = eval { + Lucy::Index::BackgroundMerger->new( index => $index ); + }; + if ( blessed($@) and $@->isa("Lucy::Store::LockErr") ) { + warn "Retrying...\n"; + } + elsif (!$bg_merger) { + # Re-throw. + die "Failed to open BackgroundMerger: $@"; + } + ... +}</pre> <h2><a class='u' name="DESCRIPTION" Modified: websites/staging/lucy/trunk/content/docs/test/Lucy/Store/LockFactory.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/Lucy/Store/LockFactory.html (original) +++ websites/staging/lucy/trunk/content/docs/test/Lucy/Store/LockFactory.html Fri Feb 26 13:44:48 2016 @@ -81,26 +81,28 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> use Sys::Hostname qw( hostname ); - my $hostname = hostname() or die "Can't get unique hostname"; - my $folder = Lucy::Store::FSFolder->new( - path => '/path/to/index', - ); - my $lock_factory = Lucy::Store::LockFactory->new( - folder => $folder, - host => $hostname, - ); - my $write_lock = $lock_factory->make_lock( - name => 'write', - timeout => 5000, - interval => 100, - );</pre> +<pre>use Sys::Hostname qw( hostname ); +my $hostname = hostname() or die "Can't get unique hostname"; +my $folder = Lucy::Store::FSFolder->new( + path => '/path/to/index', +); +my $lock_factory = Lucy::Store::LockFactory->new( + folder => $folder, + host => $hostname, +); +my $write_lock = $lock_factory->make_lock( + name => 'write', + timeout => 5000, + interval => 100, +);</pre> <h2><a class='u' name="DESCRIPTION" >DESCRIPTION</a></h2> -<p>LockFactory is used to spin off interprocess mutex locks used by various index reading and writing components. The default implementation uses lockfiles, but LockFactory subclasses which are implemented using alternatives such as flock() are possible.</p> +<p>LockFactory is used to spin off interprocess mutex locks used by various index reading and writing components. +The default implementation uses lockfiles, +but LockFactory subclasses which are implemented using alternatives such as flock() are possible.</p> <h2><a class='u' name="CONSTRUCTORS" @@ -110,10 +112,10 @@ name="CONSTRUCTORS" name="new" >new</a></h3> -<pre> my $lock_factory = Lucy::Store::LockFactory->new( - folder => $folder, # required - host => $hostname, # required - );</pre> +<pre>my $lock_factory = Lucy::Store::LockFactory->new( + folder => $folder, # required + host => $hostname, # required +);</pre> <p>Create a new LockFactory.</p> @@ -132,14 +134,17 @@ name="METHODS" name="make_lock" >make_lock</a></h3> -<pre> my $retval = $lock_factory->make_lock( - name => $name # required - timeout => $timeout # default: 0 - interval => $interval # default: 100 - );</pre> - -<p>Return a Lock object, which, once <a href="../../Lucy/Store/Lock.html#obtain" class="podlinkpod" ->obtain()</a> returns successfully, maintains an exclusive lock on a resource.</p> +<pre>my $retval = $lock_factory->make_lock( + name => $name # required + timeout => $timeout # default: 0 + interval => $interval # default: 100 +);</pre> + +<p>Return a Lock object, +which, +once <a href="../../Lucy/Store/Lock.html#obtain" class="podlinkpod" +>obtain()</a> returns successfully, +maintains an exclusive lock on a resource.</p> <ul> <li><b>name</b> - A file-system-friendly id which identifies the resource to be locked.</li> @@ -154,14 +159,15 @@ name="make_lock" name="make_shared_lock" >make_shared_lock</a></h3> -<pre> my $retval = $lock_factory->make_shared_lock( - name => $name # required - timeout => $timeout # default: 0 - interval => $interval # default: 100 - );</pre> +<pre>my $retval = $lock_factory->make_shared_lock( + name => $name # required + timeout => $timeout # default: 0 + interval => $interval # default: 100 +);</pre> <p>Return a Lock object for which <a href="../../Lucy/Store/Lock.html#shared" class="podlinkpod" ->shared()</a> returns true, and which maintains a non-exclusive lock on a resource once <a href="../../Lucy/Store/Lock.html#obtain" class="podlinkpod" +>shared()</a> returns true, +and which maintains a non-exclusive lock on a resource once <a href="../../Lucy/Store/Lock.html#obtain" class="podlinkpod" >obtain()</a> returns success.</p> <ul> Modified: websites/staging/lucy/trunk/content/docs/test/Lucy/Store/RAMFolder.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/Lucy/Store/RAMFolder.html (original) +++ websites/staging/lucy/trunk/content/docs/test/Lucy/Store/RAMFolder.html Fri Feb 26 13:44:48 2016 @@ -81,19 +81,20 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> my $folder = Lucy::Store::RAMFolder->new; +<pre>my $folder = Lucy::Store::RAMFolder->new; - # or sometimes... - my $folder = Lucy::Store::RAMFolder->new( - path => $relative_path, - );</pre> +# or sometimes... +my $folder = Lucy::Store::RAMFolder->new( + path => $relative_path, +);</pre> <h2><a class='u' name="DESCRIPTION" >DESCRIPTION</a></h2> <p>RAMFolder is an entirely in-memory implementation of <a href="../../Lucy/Store/Folder.html" class="podlinkpod" ->Folder</a>, primarily used for testing and development.</p> +>Folder</a>, +primarily used for testing and development.</p> <h2><a class='u' name="CONSTRUCTORS" @@ -103,14 +104,15 @@ name="CONSTRUCTORS" name="new" >new</a></h3> -<pre> my $folder = Lucy::Store::RAMFolder->new( - path => $relative_path, # default: empty string - );</pre> +<pre>my $folder = Lucy::Store::RAMFolder->new( + path => $relative_path, # default: empty string +);</pre> <p>Create a new RAMFolder.</p> <ul> -<li><b>path</b> - Relative path, used for subfolders.</li> +<li><b>path</b> - Relative path, +used for subfolders.</li> </ul> <h2><a class='u' Modified: websites/staging/lucy/trunk/content/docs/test/LucyX/Index/ByteBufDocReader.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/LucyX/Index/ByteBufDocReader.html (original) +++ websites/staging/lucy/trunk/content/docs/test/LucyX/Index/ByteBufDocReader.html Fri Feb 26 13:44:48 2016 @@ -81,13 +81,14 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> # See LucyX::Index::ByteBufDocWriter</pre> +<pre># See LucyX::Index::ByteBufDocWriter</pre> <h2><a class='u' name="DESCRIPTION" >DESCRIPTION</a></h2> -<p>This is a proof-of-concept class to demonstrate alternate implementations for fetching documents. It is unsupported.</p> +<p>This is a proof-of-concept class to demonstrate alternate implementations for fetching documents. +It is unsupported.</p> </div> Modified: websites/staging/lucy/trunk/content/docs/test/LucyX/Index/ByteBufDocWriter.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/LucyX/Index/ByteBufDocWriter.html (original) +++ websites/staging/lucy/trunk/content/docs/test/LucyX/Index/ByteBufDocWriter.html Fri Feb 26 13:44:48 2016 @@ -84,73 +84,76 @@ name="SYNOPSIS" <p>Create an <a href="../../Lucy/Plan/Architecture.html" class="podlinkpod" >Architecture</a> subclass which overrides register_doc_writer() and >register_doc_reader():</p> -<pre> package MyArchitecture; - use base qw( Lucy::Plan::Architecture ); - use LucyX::Index::ByteBufDocReader; - use LucyX::Index::ByteBufDocWriter; - - sub register_doc_writer { - my ( $self, $seg_writer ) = @_; - my $doc_writer = LucyX::Index::ByteBufDocWriter->new( - width => 16, - field => 'value', - 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::ByteBufDocReader->new( - width => 16, - field => 'value', - 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 { MyArchitecture->new }</pre> - -<p>Proceed as normal in your indexer app, making sure that every supplied document supplies a valid value for the field in question:</p> - -<pre> $indexer->add_doc({ - title => $title, - content => $content, - id => $id, # <---- Must meet spec. - });</pre> - -<p>Then, in your search app:</p> - -<pre> my $searcher = Lucy::Search::IndexSearcher->new( - index => '/path/to/index', - ); - my $hits = $searcher->hits( query => $query ); - while ( my $id = $hits->next ) { - my $real_doc = $external_document_source->fetch( $doc->{value} ); - ... - }</pre> +<pre>package MyArchitecture; +use base qw( Lucy::Plan::Architecture ); +use LucyX::Index::ByteBufDocReader; +use LucyX::Index::ByteBufDocWriter; + +sub register_doc_writer { + my ( $self, $seg_writer ) = @_; + my $doc_writer = LucyX::Index::ByteBufDocWriter->new( + width => 16, + field => 'value', + 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::ByteBufDocReader->new( + width => 16, + field => 'value', + 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 { MyArchitecture->new }</pre> + +<p>Proceed as normal in your indexer app, +making sure that every supplied document supplies a valid value for the field in question:</p> + +<pre>$indexer->add_doc({ + title => $title, + content => $content, + id => $id, # <---- Must meet spec. +});</pre> + +<p>Then, +in your search app:</p> + +<pre>my $searcher = Lucy::Search::IndexSearcher->new( + index => '/path/to/index', +); +my $hits = $searcher->hits( query => $query ); +while ( my $id = $hits->next ) { + my $real_doc = $external_document_source->fetch( $doc->{value} ); + ... +}</pre> <h2><a class='u' name="DESCRIPTION" >DESCRIPTION</a></h2> -<p>This is a proof-of-concept class to demonstrate alternate implementations for fetching documents. It is unsupported.</p> +<p>This is a proof-of-concept class to demonstrate alternate implementations for fetching documents. +It is unsupported.</p> </div> Modified: websites/staging/lucy/trunk/content/docs/test/LucyX/Index/LongFieldSim.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/LucyX/Index/LongFieldSim.html (original) +++ websites/staging/lucy/trunk/content/docs/test/LucyX/Index/LongFieldSim.html Fri Feb 26 13:44:48 2016 @@ -81,10 +81,10 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> package MySchema::body; - use base qw( Lucy::Plan::FullTextType ); - use LucyX::Index::LongFieldSim; - sub make_similarity { LucyX::Index::LongFieldSim->new }</pre> +<pre>package MySchema::body; +use base qw( Lucy::Plan::FullTextType ); +use LucyX::Index::LongFieldSim; +sub make_similarity { LucyX::Index::LongFieldSim->new }</pre> <h2><a class='u' name="DESCRIPTION" @@ -93,35 +93,38 @@ name="DESCRIPTION" <p>Apache Lucy's default <a href="../../Lucy/Index/Similarity.html" class="podlinkpod" >Similarity</a> implmentation produces a bias towards extremely short >fields.</p> -<pre> Lucy::Index::Similarity +<pre>Lucy::Index::Similarity - | more weight - | * - | ** - | *** - | ********** - | ******************** - | ******************************* - | less weight **** - |------------------------------------------------------------------------ - fewer tokens more tokens</pre> +| more weight +| * +| ** +| *** +| ********** +| ******************** +| ******************************* +| less weight **** +|------------------------------------------------------------------------ + fewer tokens more tokens</pre> <p>LongFieldSim eliminates this bias.</p> -<pre> LucyX::Index::LongFieldSim +<pre>LucyX::Index::LongFieldSim - | more weight - | - | - | - |***************** - | ******************** - | ******************************* - | less weight **** - |------------------------------------------------------------------------ - fewer tokens more tokens</pre> - -<p>In most cases, the default bias towards short fields is desirable. For instance, say you have two documents:</p> +| more weight +| +| +| +|***************** +| ******************** +| ******************************* +| less weight **** +|------------------------------------------------------------------------ + fewer tokens more tokens</pre> + +<p>In most cases, +the default bias towards short fields is desirable. +For instance, +say you have two documents:</p> <ul> <li>"George Washington"</li> @@ -129,17 +132,31 @@ name="DESCRIPTION" <li>"George Washington Carver"</li> </ul> -<p>If a user searches for "george washington", we want the exact title match to appear first. Under the default Similarity implementation it will, because the "Carver" in "George Washington Carver" dilutes the impact of the other two tokens.</p> - -<p>However, under LongFieldSim, the two titles will yield equal scores. That would be bad in this particular case, but it could be good in another.</p> - -<pre> "George Washington Carver is cool." - - "George Washington Carver was born on the eve of the US Civil War, in - 1864. His exact date of birth is unknown... Carver's research in crop - rotation revolutionized agriculture..."</pre> - -<p>The first document is succinct, but useless. Unfortunately, the default similarity will assess it as extremely relevant to a query of "george washington carver". However, under LongFieldSim, the short-field bias is eliminated, and the addition of other mentions of Carver's name in the second document yield a higher score and a higher rank.</p> +<p>If a user searches for "george washington", +we want the exact title match to appear first. +Under the default Similarity implementation it will, +because the "Carver" in "George Washington Carver" dilutes the impact of the other two tokens.</p> + +<p>However, +under LongFieldSim, +the two titles will yield equal scores. +That would be bad in this particular case, +but it could be good in another.</p> + +<pre> "George Washington Carver is cool." + + "George Washington Carver was born on the eve of the US Civil War, in + 1864. His exact date of birth is unknown... Carver's research in crop + rotation revolutionized agriculture..."</pre> + +<p>The first document is succinct, +but useless. +Unfortunately, +the default similarity will assess it as extremely relevant to a query of "george washington carver". +However, +under LongFieldSim, +the short-field bias is eliminated, +and the addition of other mentions of Carver's name in the second document yield a higher score and a higher rank.</p> </div> Modified: websites/staging/lucy/trunk/content/docs/test/LucyX/Remote/ClusterSearcher.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/LucyX/Remote/ClusterSearcher.html (original) +++ websites/staging/lucy/trunk/content/docs/test/LucyX/Remote/ClusterSearcher.html Fri Feb 26 13:44:48 2016 @@ -81,21 +81,22 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> my $searcher = eval { - LucyX::Remote::ClusterSearcher->new( - schema => MySchema->new, - shards => [ 'search1:7890', 'search2:7890', 'search3:7890' ], - ); - }; - ... - my $hits = eval { $searcher->hits( query => $query ) };</pre> +<pre>my $searcher = eval { + LucyX::Remote::ClusterSearcher->new( + schema => MySchema->new, + shards => [ 'search1:7890', 'search2:7890', 'search3:7890' ], + ); +}; +... +my $hits = eval { $searcher->hits( query => $query ) };</pre> <h2><a class='u' name="DESCRIPTION" >DESCRIPTION</a></h2> <p>ClusterSearcher is a subclass of <a href="../../Lucy/Search/Searcher.html" class="podlinkpod" ->Lucy::Search::Searcher</a> which can be used to search a composite index made up of multiple shards, where each shard is represented by a host:port pair running <a href="../../LucyX/Remote/SearchServer.html" class="podlinkpod" +>Lucy::Search::Searcher</a> which can be used to search a composite index made up of multiple shards, +where each shard is represented by a host:port pair running <a href="../../LucyX/Remote/SearchServer.html" class="podlinkpod" >LucyX::Remote::SearchServer</a>.</p> <h2><a class='u' @@ -106,12 +107,15 @@ name="METHODS" name="new" >new</a></h3> -<p>Constructor. Takes hash-style params.</p> +<p>Constructor. +Takes hash-style params.</p> <ul> -<li><b>schema</b> - A Schema, which must match the Schema used by each remote node.</li> +<li><b>schema</b> - A Schema, +which must match the Schema used by each remote node.</li> -<li><b>shards</b> - An array of host:port pairs running LucyX::Remote::SearchServer instances, which identifying the shards that make up the composite index.</li> +<li><b>shards</b> - An array of host:port pairs running LucyX::Remote::SearchServer instances, +which identifying the shards that make up the composite index.</li> </ul> </div> Modified: websites/staging/lucy/trunk/content/docs/test/LucyX/Remote/SearchClient.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/LucyX/Remote/SearchClient.html (original) +++ websites/staging/lucy/trunk/content/docs/test/LucyX/Remote/SearchClient.html Fri Feb 26 13:44:48 2016 @@ -85,10 +85,10 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> my $client = LucyX::Remote::SearchClient->new( - peer_address => 'searchserver1:7890', - ); - my $hits = $client->hits( query => $query );</pre> +<pre>my $client = LucyX::Remote::SearchClient->new( + peer_address => 'searchserver1:7890', +); +my $hits = $client->hits( query => $query );</pre> <h2><a class='u' name="DESCRIPTION" @@ -106,7 +106,8 @@ name="METHODS" name="new" >new</a></h3> -<p>Constructor. Takes hash-style params.</p> +<p>Constructor. +Takes hash-style params.</p> <ul> <li><b>peer_address</b> - The name/IP and the port number which the client should attempt to connect to.</li> Modified: websites/staging/lucy/trunk/content/docs/test/LucyX/Remote/SearchServer.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/LucyX/Remote/SearchServer.html (original) +++ websites/staging/lucy/trunk/content/docs/test/LucyX/Remote/SearchServer.html Fri Feb 26 13:44:48 2016 @@ -81,25 +81,30 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> my $searcher = Lucy::Search::IndexSearcher->new( - index => '/path/to/index' - ); - my $search_server = LucyX::Remote::SearchServer->new( - searcher => $searcher - ); - $search_server->serve( - port => 7890 - );</pre> +<pre>my $searcher = Lucy::Search::IndexSearcher->new( + index => '/path/to/index' +); +my $search_server = LucyX::Remote::SearchServer->new( + searcher => $searcher +); +$search_server->serve( + port => 7890 +);</pre> <h2><a class='u' name="DESCRIPTION" >DESCRIPTION</a></h2> -<p>The SearchServer class, in conjunction with either <a href="../../LucyX/Remote/SearchClient.html" class="podlinkpod" +<p>The SearchServer class, +in conjunction with either <a href="../../LucyX/Remote/SearchClient.html" class="podlinkpod" >SearchClient</a> or <a href="../../LucyX/Remote/ClusterSearcher.html" >class="podlinkpod" ->ClusterSearcher</a>, makes it possible to run a search on one machine and report results on another.</p> +>ClusterSearcher</a>, +makes it possible to run a search on one machine and report results on another.</p> -<p>By aggregating several SearchClients under a ClusterSearcher, the cost of searching what might have been a prohibitively large monolithic index can be distributed across multiple nodes, each with its own, smaller index.</p> +<p>By aggregating several SearchClients under a ClusterSearcher, +the cost of searching what might have been a prohibitively large monolithic index can be distributed across multiple nodes, +each with its own, +smaller index.</p> <h2><a class='u' name="METHODS" @@ -109,11 +114,12 @@ name="METHODS" name="new" >new</a></h3> -<pre> my $search_server = LucyX::Remote::SearchServer->new( - searcher => $searcher, # required - );</pre> +<pre>my $search_server = LucyX::Remote::SearchServer->new( + searcher => $searcher, # required +);</pre> -<p>Constructor. Takes hash-style parameters.</p> +<p>Constructor. +Takes hash-style parameters.</p> <ul> <li><b>searcher</b> - the <a href="../../Lucy/Search/IndexSearcher.html" class="podlinkpod" @@ -124,9 +130,9 @@ name="new" name="serve" >serve</a></h3> -<pre> $search_server->serve( - port => 7890, # required - );</pre> +<pre>$search_server->serve( + port => 7890, # required +);</pre> <p>Open a listening socket on localhost and wait for SearchClients to connect.</p> @@ -138,9 +144,12 @@ name="serve" name="serve_rpc" >serve_rpc</a></h3> -<pre> my $status = $search_server->serve_rpc($sock);</pre> +<pre>my $status = $search_server->serve_rpc($sock);</pre> -<p>Handle a single RPC from socket $sock. Returns 'done' if the connection should be closed. Returns 'terminate' if the server should shut down. Returns 'continue' if the server should continue to handle requests from this client.</p> +<p>Handle a single RPC from socket $sock. +Returns 'done' if the connection should be closed. +Returns 'terminate' if the server should shut down. +Returns 'continue' if the server should continue to handle requests from this client.</p> </div> Modified: websites/staging/lucy/trunk/content/docs/test/LucyX/Search/Filter.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/LucyX/Search/Filter.html (original) +++ websites/staging/lucy/trunk/content/docs/test/LucyX/Search/Filter.html Fri Feb 26 13:44:48 2016 @@ -81,40 +81,44 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> my %category_filters; - for my $category (qw( sweet sour salty bitter )) { - my $cat_query = Lucy::Search::TermQuery->new( - field => 'category', - term => $category, - ); - $category_filters{$category} = LucyX::Search::Filter->new( - query => $cat_query, - ); - } - - while ( my $cgi = CGI::Fast->new ) { - my $user_query = $cgi->param('q'); - my $filter = $category_filters{ $cgi->param('category') }; - my $and_query = Lucy::Search::ANDQuery->new; - $and_query->add_child($user_query); - $and_query->add_child($filter); - my $hits = $searcher->hits( query => $and_query ); - ...</pre> +<pre>my %category_filters; +for my $category (qw( sweet sour salty bitter )) { + my $cat_query = Lucy::Search::TermQuery->new( + field => 'category', + term => $category, + ); + $category_filters{$category} = LucyX::Search::Filter->new( + query => $cat_query, + ); +} + +while ( my $cgi = CGI::Fast->new ) { + my $user_query = $cgi->param('q'); + my $filter = $category_filters{ $cgi->param('category') }; + my $and_query = Lucy::Search::ANDQuery->new; + $and_query->add_child($user_query); + $and_query->add_child($filter); + my $hits = $searcher->hits( query => $and_query ); + ...</pre> <h2><a class='u' name="DESCRIPTION" >DESCRIPTION</a></h2> <p>A Filter is a <a href="../../Lucy/Search/Query.html" class="podlinkpod" ->Lucy::Search::Query</a> subclass that can be used to filter the results of another Query. The effect is very similar to simply using the wrapped inner query, but there are two important differences:</p> +>Lucy::Search::Query</a> subclass that can be used to filter the results of another Query. +The effect is very similar to simply using the wrapped inner query, +but there are two important differences:</p> <ul> <li>A Filter does not contribute to the score of the documents it matches.</li> -<li>A Filter caches its results, so it is more efficient if you use it more than once.</li> +<li>A Filter caches its results, +so it is more efficient if you use it more than once.</li> </ul> -<p>To obtain logically equivalent results to the Filter but avoid the caching, substitute the wrapped query but use set_boost() to set its <code>boost</code> to 0.</p> +<p>To obtain logically equivalent results to the Filter but avoid the caching, +substitute the wrapped query but use set_boost() to set its <code>boost</code> to 0.</p> <h2><a class='u' name="METHODS" @@ -124,11 +128,14 @@ name="METHODS" name="new" >new</a></h3> -<pre> my $filter = LucyX::Search::Filter->new( - query => $query; - );</pre> - -<p>Constructor. Takes one hash-style parameter, <code>query</code>, which must be an object belonging to a subclass of <a href="../../Lucy/Search/Query.html" class="podlinkpod" +<pre>my $filter = LucyX::Search::Filter->new( + query => $query; +);</pre> + +<p>Constructor. +Takes one hash-style parameter, +<code>query</code>, +which must be an object belonging to a subclass of <a href="../../Lucy/Search/Query.html" class="podlinkpod" >Lucy::Search::Query</a>.</p> <h2><a class='u' Modified: websites/staging/lucy/trunk/content/docs/test/LucyX/Search/ProximityQuery.html ============================================================================== --- websites/staging/lucy/trunk/content/docs/test/LucyX/Search/ProximityQuery.html (original) +++ websites/staging/lucy/trunk/content/docs/test/LucyX/Search/ProximityQuery.html Fri Feb 26 13:44:48 2016 @@ -81,12 +81,12 @@ name="NAME" name="SYNOPSIS" >SYNOPSIS</a></h2> -<pre> my $proximity_query = LucyX::Search::ProximityQuery->new( - field => 'content', - terms => [qw( the who )], - within => 10, # match within 10 positions - ); - my $hits = $searcher->hits( query => $proximity_query );</pre> +<pre>my $proximity_query = LucyX::Search::ProximityQuery->new( + field => 'content', + terms => [qw( the who )], + within => 10, # match within 10 positions +); +my $hits = $searcher->hits( query => $proximity_query );</pre> <h2><a class='u' name="DESCRIPTION" @@ -103,11 +103,11 @@ name="CONSTRUCTORS" name="new" >new</a></h3> -<pre> my $proximity_query = LucyX::Search::ProximityQuery->new( - field => $field # required - terms => $terms # required - within => $within # required - );</pre> +<pre>my $proximity_query = LucyX::Search::ProximityQuery->new( + field => $field # required + terms => $terms # required + within => $within # required +);</pre> <p>Create a new ProximityQuery.</p> @@ -125,7 +125,7 @@ name="METHODS" name="get_field" >get_field</a></h3> -<pre> my $retval = $proximity_query->get_field();</pre> +<pre>my $retval = $proximity_query->get_field();</pre> <p>Accessor for object’s field attribute.</p> @@ -133,7 +133,7 @@ name="get_field" name="get_terms" >get_terms</a></h3> -<pre> my $retval = $proximity_query->get_terms();</pre> +<pre>my $retval = $proximity_query->get_terms();</pre> <p>Accessor for object’s array of terms.</p> @@ -141,7 +141,7 @@ name="get_terms" name="get_within" >get_within</a></h3> -<pre> my $retval = $proximity_query->get_within();</pre> +<pre>my $retval = $proximity_query->get_within();</pre> <p>Accessor for object’s within attribute.</p> @@ -149,11 +149,11 @@ name="get_within" name="make_compiler" >make_compiler</a></h3> -<pre> my $retval = $proximity_query->make_compiler( - searcher => $searcher # required - boost => $boost # required - subordinate => $subordinate # default: false - );</pre> +<pre>my $retval = $proximity_query->make_compiler( + searcher => $searcher # required + boost => $boost # required + subordinate => $subordinate # default: false +);</pre> <p>Abstract factory method returning a Compiler derived from this Query.</p> @@ -162,7 +162,9 @@ name="make_compiler" <li><b>boost</b> - A scoring multiplier.</li> -<li><b>subordinate</b> - Indicates whether the Query is a subquery (as opposed to a top-level query). If false, the implementation must invoke <a href="../../Lucy/Search/Compiler.html#normalize" class="podlinkpod" +<li><b>subordinate</b> - Indicates whether the Query is a subquery (as opposed to a top-level query). +If false, +the implementation must invoke <a href="../../Lucy/Search/Compiler.html#normalize" class="podlinkpod" >normalize()</a> on the newly minted Compiler object before returning it.</li> </ul>