Modified: lucy/site/trunk/content/docs/test/Lucy/Index/Segment.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Index/Segment.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Index/Segment.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Index/Segment.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Index::Segment - Apache Luc <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Index::Segment - Warehouse for information about one segment of an inverted index.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> # Index-time. package MyDataWriter; @@ -43,21 +43,23 @@ name="SYNOPSIS" return $self; }</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> -<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>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> +<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><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="add_field(field)" ->add_field(field)</a></h2> +<h3><a class='u' +name="add_field" +>add_field</a></h3> + +<pre> my $retval = $segment->add_field($field);</pre> <p>Register a new field and assign it a field number. If the field was already known, nothing happens.</p> @@ -65,13 +67,18 @@ name="add_field(field)" <li><b>field</b> - Field name.</li> </ul> -<p>Returns: the field's field number, which is a positive integer.</p> +<p>Returns: the field’s field number, which is a positive integer.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="store_metadata(_[labeled_params]_)" ->store_metadata( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="store_metadata" +>store_metadata</a></h3> + +<pre> $segment->store_metadata( + key => $key # required + metadata => $metadata # required + );</pre> -<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> +<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><b>key</b> - String identifying an index component.</li> @@ -79,55 +86,77 @@ name="store_metadata(_[labeled_params]_) <li><b>metadata</b> - JSON-izable data structure.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="fetch_metadata(key)" ->fetch_metadata(key)</a></h2> +<h3><a class='u' +name="fetch_metadata" +>fetch_metadata</a></h3> + +<pre> my $retval = $segment->fetch_metadata($key);</pre> + +<p>Fetch a value from the Segment’s metadata hash.</p> -<p>Fetch a value from the Segment's metadata hash.</p> +<h3><a class='u' +name="field_num" +>field_num</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="field_num(field)" ->field_num(field)</a></h2> +<pre> my $retval = $segment->field_num($field);</pre> -<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> +<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><b>field</b> - Field name.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="field_name(field_num)" ->field_name(field_num)</a></h2> +<h3><a class='u' +name="field_name" +>field_name</a></h3> + +<pre> my $retval = $segment->field_name($field_num);</pre> + +<p>Given a field number, return the name of its field, or undef if the field name can’t be found.</p> + +<h3><a class='u' +name="get_name" +>get_name</a></h3> -<p>Given a field number, return the name of its field, or undef if the field name can't be found.</p> +<pre> my $retval = $segment->get_name();</pre> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_name()" ->get_name()</a></h2> +<p>Getter for the object’s seg name.</p> -<p>Getter for the object's seg name.</p> +<h3><a class='u' +name="get_number" +>get_number</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_number()" ->get_number()</a></h2> +<pre> my $retval = $segment->get_number();</pre> <p>Getter for the segment number.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="set_count(count)" ->set_count(count)</a></h2> +<h3><a class='u' +name="set_count" +>set_count</a></h3> + +<pre> $segment->set_count($count);</pre> + +<p>Setter for the object’s document count.</p> + +<h3><a class='u' +name="get_count" +>get_count</a></h3> + +<pre> my $retval = $segment->get_count();</pre> + +<p>Getter for the object’s document count.</p> -<p>Setter for the object's document count.</p> +<h3><a class='u' +name="compare_to" +>compare_to</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_count()" ->get_count()</a></h2> +<pre> my $retval = $segment->compare_to($other);</pre> -<p>Getter for the object's document count.</p> +<p>Compare by segment number.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Index::Segment isa Clownfish::Obj.</p>
Modified: lucy/site/trunk/content/docs/test/Lucy/Index/Similarity.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Index/Similarity.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Index/Similarity.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Index/Similarity.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Index::Similarity - Apache <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Index::Similarity - Judge how well a document matches a query.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> package MySimilarity; @@ -22,47 +22,49 @@ name="SYNOPSIS" sub make_similarity { MySimilarity->new }</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> -<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>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>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><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new()" ->new()</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $sim = Lucy::Index::Similarity->new;</pre> <p>Constructor. Takes no arguments.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="length_norm(num_tokens)" ->length_norm(num_tokens)</a></h2> +<h3><a class='u' +name="length_norm" +>length_norm</a></h3> + +<pre> my $retval = $similarity->length_norm($num_tokens);</pre> <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>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> +<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><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Index::Similarity isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Index/Snapshot.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Index/Snapshot.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Index/Snapshot.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Index/Snapshot.mdtext Fri Feb 26 12:52:25 2016 @@ -3,75 +3,88 @@ Title: Lucy::Index::Snapshot - Apache Lu <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Index::Snapshot - Point-in-time index file list.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> my $snapshot = Lucy::Index::Snapshot->new; $snapshot->read_file( folder => $folder ); # load most recent snapshot my $files = $snapshot->list; print "$_\n" for @$files;</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <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" class="podlinkpod" >IndexReader</a> objects interpret the data associated with a single >Snapshot.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new()" ->new()</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $snapshot = Lucy::Index::Snapshot->new;</pre> <p>Constructor. Takes no arguments.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="list()" ->list()</a></h2> +<h3><a class='u' +name="list" +>list</a></h3> + +<pre> my $retval = $snapshot->list();</pre> <p>Return an array of all entries.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="num_entries()" ->num_entries()</a></h2> +<h3><a class='u' +name="num_entries" +>num_entries</a></h3> + +<pre> my $retval = $snapshot->num_entries();</pre> <p>Return the number of entries (including directories).</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="add_entry(entry)" ->add_entry(entry)</a></h2> +<h3><a class='u' +name="add_entry" +>add_entry</a></h3> + +<pre> $snapshot->add_entry($entry);</pre> <p>Add a filepath to the snapshot.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="delete_entry(entry)" ->delete_entry(entry)</a></h2> +<h3><a class='u' +name="delete_entry" +>delete_entry</a></h3> + +<pre> my $retval = $snapshot->delete_entry($entry);</pre> <p>Delete a filepath from the snapshot.</p> <p>Returns: true if the entry existed and was successfully deleted, false otherwise.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="read_file(_[labeled_params]_)" ->read_file( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="read_file" +>read_file</a></h3> + +<pre> my $retval = $snapshot->read_file( + folder => $folder # required + path => $path # default: undef + );</pre> <p>Decode a snapshot file and initialize the object to reflect its contents.</p> @@ -81,11 +94,16 @@ name="read_file(_[labeled_params]_)" <li><b>path</b> - The location of the snapshot file. If not supplied, the most recent snapshot file in the base directory will be chosen.</li> </ul> -<p>Returns: the object, allowing an assignment idiom.</p> +<p>Returns: the Snapshot object itself</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="write_file(_[labeled_params]_)" ->write_file( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="write_file" +>write_file</a></h3> + +<pre> $snapshot->write_file( + folder => $folder # required + path => $path # default: undef + );</pre> <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> @@ -95,21 +113,28 @@ name="write_file(_[labeled_params]_)" <li><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.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="set_path(path)" ->set_path(path)</a></h2> +<h3><a class='u' +name="set_path" +>set_path</a></h3> -<p>Set the path to the file that the Snapshot object serves as a proxy for.</p> +<pre> $snapshot->set_path($path);</pre> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_path()" ->get_path()</a></h2> +<p>Set the path to the file that the Snapshot object serves as a proxy for.</p> -<p>Get the path to the snapshot file. Initially undef; updated by read_file(), write_file(), and set_path().</p> +<h3><a class='u' +name="get_path" +>get_path</a></h3> + +<pre> my $retval = $snapshot->get_path();</pre> + +<p>Get the path to the snapshot file. Initially undef; updated by <a href="#read_file" class="podlinkpod" +>read_file()</a>, <a href="#write_file" class="podlinkpod" +>write_file()</a>, and <a href="#set_path" class="podlinkpod" +>set_path()</a>.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Index::Snapshot isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Object/BitVector.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Object/BitVector.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Object/BitVector.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Object/BitVector.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Object::BitVector - Apache <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Object::BitVector - An array of bits.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> my $bit_vec = Lucy::Object::BitVector->new( capacity => 8 ); my $other = Lucy::Object::BitVector->new( capacity => 8 ); @@ -20,45 +20,51 @@ name="SYNOPSIS" $bit_vec->or($other); print "$_\n" for @{ $bit_vec->to_array }; # prints 0 through 7.</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <p>BitVector is a growable array of bits. All bits are initially zero.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new(_[labeled_params]_)" ->new( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $bit_vec = Lucy::Object::BitVector->new( capacity => $doc_max + 1, # default 0, );</pre> +<p>Create a new BitVector.</p> + <ul> <li><b>capacity</b> - The number of bits that the initial array should be able to hold.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> + +<h3><a class='u' +name="get" +>get</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get(tick)" ->get(tick)</a></h2> +<pre> my $retval = $bit_vector->get($tick);</pre> -<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> +<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><b>tick</b> - The requested bit.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="set(tick)" ->set(tick)</a></h2> +<h3><a class='u' +name="set" +>set</a></h3> + +<pre> $bit_vector->set($tick);</pre> <p>Set the bit at <code>tick</code> to 1.</p> @@ -66,9 +72,19 @@ name="set(tick)" <li><b>tick</b> - The bit to be set.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="clear(tick)" ->clear(tick)</a></h2> +<h3><a class='u' +name="next_hit" +>next_hit</a></h3> + +<pre> my $retval = $bit_vector->next_hit($tick);</pre> + +<p>Returns the next set bit equal to or greater than <code>tick</code>, or -1 if no such bit exists.</p> + +<h3><a class='u' +name="clear" +>clear</a></h3> + +<pre> $bit_vector->clear($tick);</pre> <p>Clear the indicated bit. (i.e. set it to 0).</p> @@ -76,15 +92,31 @@ name="clear(tick)" <li><b>tick</b> - The bit to be cleared.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="clear_all()" ->clear_all()</a></h2> +<h3><a class='u' +name="clear_all" +>clear_all</a></h3> + +<pre> $bit_vector->clear_all();</pre> <p>Clear all bits.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="and(other)" ->and(other)</a></h2> +<h3><a class='u' +name="grow" +>grow</a></h3> + +<pre> $bit_vector->grow($capacity);</pre> + +<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><b>capacity</b> - Least number of bits the BitVector should accomodate.</li> +</ul> + +<h3><a class='u' +name="and" +>and</a></h3> + +<pre> $bit_vector->and($other);</pre> <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> @@ -92,9 +124,11 @@ name="and(other)" <li><b>other</b> - Another BitVector.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="or(other)" ->or(other)</a></h2> +<h3><a class='u' +name="or" +>or</a></h3> + +<pre> $bit_vector->or($other);</pre> <p>Modify the BitVector, setting all bits which are set in the other BitVector if they were not already set.</p> @@ -102,29 +136,35 @@ name="or(other)" <li><b>other</b> - Another BitVector.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="and_not(other)" ->and_not(other)</a></h2> +<h3><a class='u' +name="xor" +>xor</a></h3> -<p>Modify the BitVector, clearing all bits which are set in the other.</p> +<pre> $bit_vector->xor($other);</pre> + +<p>Modify the BitVector, performing an XOR operation against the other.</p> <ul> <li><b>other</b> - Another BitVector.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="xor(other)" ->xor(other)</a></h2> +<h3><a class='u' +name="and_not" +>and_not</a></h3> -<p>Modify the BitVector, performing an XOR operation against the other.</p> +<pre> $bit_vector->and_not($other);</pre> + +<p>Modify the BitVector, clearing all bits which are set in the other.</p> <ul> <li><b>other</b> - Another BitVector.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="flip(tick)" ->flip(tick)</a></h2> +<h3><a class='u' +name="flip" +>flip</a></h3> + +<pre> $bit_vector->flip($tick);</pre> <p>Invert the value of a bit.</p> @@ -132,9 +172,14 @@ name="flip(tick)" <li><b>tick</b> - The bit to invert.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="flip_block(_[labeled_params]_)" ->flip_block( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="flip_block" +>flip_block</a></h3> + +<pre> $bit_vector->flip_block( + offset => $offset # required + length => $length # required + );</pre> <p>Invert each bit within a contiguous block.</p> @@ -144,37 +189,33 @@ name="flip_block(_[labeled_params]_)" <li><b>length</b> - The number of bits to flip.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="next_hit(tick)" ->next_hit(tick)</a></h2> +<h3><a class='u' +name="count" +>count</a></h3> -<p>Returns the next set bit equal to or greater than <code>tick</code>, or -1 if no such bit exists.</p> +<pre> my $retval = $bit_vector->count();</pre> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="to_array()" ->to_array()</a></h2> +<p>Return a count of the number of set bits.</p> -<p>Return an array where each element represents a set bit.</p> +<h3><a class='u' +name="to_array" +>to_array</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="grow(capacity)" ->grow(capacity)</a></h2> +<pre> my $retval = $bit_vector->to_array();</pre> -<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> +<p>Return an array where each element represents a set bit.</p> -<ul> -<li><b>capacity</b> - Least number of bits the BitVector should accomodate.</li> -</ul> +<h3><a class='u' +name="clone" +>clone</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="count()" ->count()</a></h2> +<pre> my $retval = $bit_vector->clone();</pre> -<p>Return a count of the number of set bits.</p> +<p>Return a clone of the object.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Object::BitVector isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Object/Obj.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Object/Obj.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Object/Obj.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Object/Obj.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Object::Obj - Apache Lucy D <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Object::Obj - Moved.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="MOVED" ->MOVED</a></h1> +>MOVED</a></h2> <p>Lucy::Object::Obj has been moved to Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Plan/Architecture.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Plan/Architecture.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Plan/Architecture.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Plan/Architecture.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Plan::Architecture - Apache <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Plan::Architecture - Configure major components of an index.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> package MyArchitecture; use base qw( Lucy::Plan::Architecture ); @@ -56,53 +56,58 @@ name="SYNOPSIS" return MyArchitecture->new(@_); }</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> -<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" class="podlinkpod" +<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" class="podlinkpod" >SegWriter</a> and <a href="../../Lucy/Index/SegReader.html" class="podlinkpod" >SegReader</a>.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new()" ->new()</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $arch = Lucy::Plan::Architecture->new;</pre> <p>Constructor. Takes no arguments.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="register_doc_writer(writer)" ->register_doc_writer(writer)</a></h2> +<h3><a class='u' +name="register_doc_writer" +>register_doc_writer</a></h3> -<p>Spawn a DataWriter and register() it with the supplied SegWriter, adding it to the SegWriter's writer stack.</p> +<pre> $architecture->register_doc_writer($writer);</pre> + +<p>Spawn a DataWriter and <a href="../../Lucy/Index/SegWriter.html#register" class="podlinkpod" +>register()</a> it with the supplied SegWriter, adding it to the SegWriter’s writer stack.</p> <ul> <li><b>writer</b> - A SegWriter.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="register_doc_reader(reader)" ->register_doc_reader(reader)</a></h2> +<h3><a class='u' +name="register_doc_reader" +>register_doc_reader</a></h3> + +<pre> $architecture->register_doc_reader($reader);</pre> -<p>Spawn a DocReader and register() it with the supplied SegReader.</p> +<p>Spawn a DocReader and register it with the supplied SegReader.</p> <ul> <li><b>reader</b> - A SegReader.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Plan::Architecture isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Plan/BlobType.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Plan/BlobType.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Plan/BlobType.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Plan/BlobType.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Plan::BlobType - Apache Luc <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Plan::BlobType - Default behaviors for binary fields.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> my $string_type = Lucy::Plan::StringType->new; my $blob_type = Lucy::Plan::BlobType->new( stored => 1 ); @@ -19,31 +19,33 @@ name="SYNOPSIS" $schema->spec_field( name => 'id', type => $string_type ); $schema->spec_field( name => 'jpeg', type => $blob_type );</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> -<p>BlobType is an implementation of FieldType tuned for use with fields containing binary data, which cannot be indexed or searched -- only stored.</p> +<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><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new(_[labeled_params]_)" ->new( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $blob_type = Lucy::Plan::BlobType->new( stored => 1, # default: false );</pre> +<p>Create a new BlobType.</p> + <ul> <li><b>stored</b> - boolean indicating whether the field should be stored.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Plan::BlobType isa <a href="../../Lucy/Plan/FieldType.html" class="podlinkpod" >Lucy::Plan::FieldType</a> isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Plan/FieldType.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Plan/FieldType.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Plan/FieldType.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Plan/FieldType.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Plan::FieldType - Apache Lu <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> -<p>Lucy::Plan::FieldType - Define a field's behavior.</p> +<p>Lucy::Plan::FieldType - Define a field’s behavior.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> my @sortable; for my $field ( @{ $schema->all_fields } ) { @@ -20,15 +20,15 @@ name="SYNOPSIS" push @sortable, $field; }</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <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>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> @@ -41,43 +41,85 @@ name="DESCRIPTION" <p>The <code>similarity</code> property is a <a href="../../Lucy/Index/Similarity.html" class="podlinkpod" >Similarity</a> object which defines matching and scoring behavior for the >field. It is required if the field is <code>indexed</code>.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_boost()" ->get_boost()</a></h2> +<h3><a class='u' +name="set_boost" +>set_boost</a></h3> + +<pre> $field_type->set_boost($boost);</pre> + +<p>Setter for <code>boost</code>.</p> + +<h3><a class='u' +name="get_boost" +>get_boost</a></h3> + +<pre> my $retval = $field_type->get_boost();</pre> <p>Accessor for <code>boost</code>.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="indexed()" ->indexed()</a></h2> +<h3><a class='u' +name="set_indexed" +>set_indexed</a></h3> + +<pre> $field_type->set_indexed($indexed);</pre> + +<p>Setter for <code>indexed</code>.</p> + +<h3><a class='u' +name="indexed" +>indexed</a></h3> + +<pre> my $retval = $field_type->indexed();</pre> <p>Accessor for <code>indexed</code>.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="stored()" ->stored()</a></h2> +<h3><a class='u' +name="set_stored" +>set_stored</a></h3> + +<pre> $field_type->set_stored($stored);</pre> + +<p>Setter for <code>stored</code>.</p> + +<h3><a class='u' +name="stored" +>stored</a></h3> + +<pre> my $retval = $field_type->stored();</pre> <p>Accessor for <code>stored</code>.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="sortable()" ->sortable()</a></h2> +<h3><a class='u' +name="set_sortable" +>set_sortable</a></h3> + +<pre> $field_type->set_sortable($sortable);</pre> + +<p>Setter for <code>sortable</code>.</p> + +<h3><a class='u' +name="sortable" +>sortable</a></h3> + +<pre> my $retval = $field_type->sortable();</pre> <p>Accessor for <code>sortable</code>.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="binary()" ->binary()</a></h2> +<h3><a class='u' +name="binary" +>binary</a></h3> + +<pre> my $retval = $field_type->binary();</pre> <p>Indicate whether the field contains binary data.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Plan::FieldType isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Plan/FullTextType.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Plan/FullTextType.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Plan/FullTextType.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Plan/FullTextType.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Plan::FullTextType - Apache <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Plan::FullTextType - Full-text search field type.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> my $easyanalyzer = Lucy::Analysis::EasyAnalyzer->new( language => 'en', @@ -23,12 +23,12 @@ name="SYNOPSIS" $schema->spec_field( name => 'title', type => $type ); $schema->spec_field( name => 'content', type => $type );</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <p>Lucy::Plan::FullTextType is an implementation of <a href="../../Lucy/Plan/FieldType.html" class="podlinkpod" ->Lucy::Plan::FieldType</a> tuned for "full text search".</p> +>FieldType</a> tuned for “full text search”.</p> <p>Full text fields are associated with an <a href="../../Lucy/Analysis/Analyzer.html" class="podlinkpod" >Analyzer</a>, which is used to tokenize and normalize the text so that it can >be searched for individual words.</p> @@ -36,13 +36,13 @@ name="DESCRIPTION" <p>For an exact-match, single value field type using character data, see <a href="../../Lucy/Plan/StringType.html" class="podlinkpod" >StringType</a>.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new(_[labeled_params]_)" ->new( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $type = Lucy::Plan::FullTextType->new( analyzer => $analyzer, # required @@ -67,26 +67,38 @@ name="new(_[labeled_params]_)" <li><b>highlightable</b> - boolean indicating whether the field should be highlightable.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="set_highlightable(highlightable)" ->set_highlightable(highlightable)</a></h2> +<h3><a class='u' +name="set_highlightable" +>set_highlightable</a></h3> + +<pre> $full_text_type->set_highlightable($highlightable);</pre> <p>Indicate whether to store data required by <a href="../../Lucy/Highlight/Highlighter.html" class="podlinkpod" ->Lucy::Highlight::Highlighter</a> for excerpt selection and search term highlighting.</p> +>Highlighter</a> for excerpt selection and search term highlighting.</p> + +<h3><a class='u' +name="highlightable" +>highlightable</a></h3> + +<pre> my $retval = $full_text_type->highlightable();</pre> + +<p>Accessor for “highlightable” property.</p> + +<h3><a class='u' +name="get_analyzer" +>get_analyzer</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="highlightable()" ->highlightable()</a></h2> +<pre> my $retval = $full_text_type->get_analyzer();</pre> -<p>Accessor for "highlightable" property.</p> +<p>Accessor for the type’s analyzer.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Plan::FullTextType isa Lucy::Plan::TextType isa <a href="../../Lucy/Plan/FieldType.html" class="podlinkpod" >Lucy::Plan::FieldType</a> isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Plan/Schema.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Plan/Schema.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Plan/Schema.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Plan/Schema.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Plan::Schema - Apache Lucy <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Plan::Schema - User-created specification for an inverted index.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> use Lucy::Plan::Schema; use Lucy::Plan::FullTextType; @@ -27,37 +27,51 @@ name="SYNOPSIS" $schema->spec_field( name => 'title', type => $type ); $schema->spec_field( name => 'content', type => $type );</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <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><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new()" ->new()</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $schema = Lucy::Plan::Schema->new;</pre> <p>Constructor. Takes no arguments.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="spec_field(_[labeled_params]_)" ->spec_field( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="architecture" +>architecture</a></h3> + +<pre> my $retval = $schema->architecture();</pre> + +<p>Factory method which creates an Architecture object for this index.</p> + +<h3><a class='u' +name="spec_field" +>spec_field</a></h3> + +<pre> $schema->spec_field( + name => $name # required + type => $type # required + );</pre> <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> +<p>If this method has already been called for the supplied <code>field</code>, it will merely test to verify that the supplied FieldType <a href="../../Clownfish/Obj.html#equals" class="podlinkpod" +>equals()</a> the existing one.</p> <ul> <li><b>name</b> - The name of the field.</li> @@ -65,51 +79,58 @@ name="spec_field(_[labeled_params]_)" <li><b>type</b> - A FieldType.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="num_fields()" ->num_fields()</a></h2> +<h3><a class='u' +name="fetch_type" +>fetch_type</a></h3> -<p>Return the number of fields currently defined.</p> +<pre> my $retval = $schema->fetch_type($field);</pre> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="all_fields()" ->all_fields()</a></h2> +<p>Return the FieldType for the specified field. If the field can’t be found, return undef.</p> -<p>Return all the Schema's field names as an array.</p> +<h3><a class='u' +name="fetch_sim" +>fetch_sim</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="fetch_type(field)" ->fetch_type(field)</a></h2> +<pre> my $retval = $schema->fetch_sim($field); + my $retval = $schema->fetch_sim(); # default: undef</pre> -<p>Return the FieldType for the specified field. If the field can't be found, return undef.</p> +<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><a class='u' href='#___top' title='click to go to top of document' -name="fetch_sim(field)" ->fetch_sim(field)</a></h2> +<h3><a class='u' +name="num_fields" +>num_fields</a></h3> -<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> +<pre> my $retval = $schema->num_fields();</pre> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="architecture()" ->architecture()</a></h2> +<p>Return the number of fields currently defined.</p> -<p>Factory method which creates an Architecture object for this index.</p> +<h3><a class='u' +name="all_fields" +>all_fields</a></h3> + +<pre> my $retval = $schema->all_fields();</pre> + +<p>Return all the Schema’s field names as an array.</p> + +<h3><a class='u' +name="get_architecture" +>get_architecture</a></h3> + +<pre> my $retval = $schema->get_architecture();</pre> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_architecture()" ->get_architecture()</a></h2> +<p>Return the Schema instance’s internal Architecture object.</p> -<p>Return the Schema instance's internal Architecture object.</p> +<h3><a class='u' +name="get_similarity" +>get_similarity</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_similarity()" ->get_similarity()</a></h2> +<pre> my $retval = $schema->get_similarity();</pre> -<p>Return the Schema instance's internal Similarity object.</p> +<p>Return the Schema instance’s internal Similarity object.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Plan::Schema isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Plan/StringType.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Plan/StringType.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Plan/StringType.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Plan/StringType.mdtext Fri Feb 26 12:52:25 2016 @@ -3,33 +3,33 @@ Title: Lucy::Plan::StringType - Apache L <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Plan::StringType - Non-tokenized text type.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> my $type = Lucy::Plan::StringType->new; my $schema = Lucy::Plan::Schema->new; $schema->spec_field( name => 'category', type => $type );</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> -<p>Lucy::Plan::StringType is used for "exact-match" strings.</p> +<p>Lucy::Plan::StringType is used for “exact-match” strings.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new()" ->new()</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $type = Lucy::Plan::StringType->new( boost => 0.1, # default: 1.0 @@ -48,9 +48,9 @@ name="new()" <li><b>sortable</b> - boolean indicating whether the field should be sortable.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Plan::StringType isa Lucy::Plan::TextType isa <a href="../../Lucy/Plan/FieldType.html" class="podlinkpod" >Lucy::Plan::FieldType</a> isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Search/ANDQuery.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Search/ANDQuery.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Search/ANDQuery.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Search/ANDQuery.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Search::ANDQuery - Apache L <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Search::ANDQuery - Intersect multiple result sets.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> my $foo_and_bar_query = Lucy::Search::ANDQuery->new( children => [ $foo_query, $bar_query ], @@ -19,42 +19,59 @@ name="SYNOPSIS" my $hits = $searcher->hits( query => $foo_and_bar_query ); ...</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <p>ANDQuery is a composite <a href="../../Lucy/Search/Query.html" class="podlinkpod" >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><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new(_[labeled_params]_)" ->new( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $foo_and_bar_query = Lucy::Search::ANDQuery->new( children => [ $foo_query, $bar_query ], );</pre> +<p>Create a new ANDQuery.</p> + <ul> <li><b>children</b> - An array of child Queries.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> + +<h3><a class='u' +name="make_compiler" +>make_compiler</a></h3> + +<pre> my $retval = $and_query->make_compiler( + searcher => $searcher # required + boost => $boost # required + subordinate => $subordinate # default: false + );</pre> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="add_child(query)" ->add_child(query)</a></h2> +<p>Abstract factory method returning a Compiler derived from this Query.</p> -<p>Add a child Query node.</p> +<ul> +<li><b>searcher</b> - A Searcher.</li> + +<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" +>normalize()</a> on the newly minted Compiler object before returning it.</li> +</ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Search::ANDQuery isa <a href="../../Lucy/Search/PolyQuery.html" class="podlinkpod" >Lucy::Search::PolyQuery</a> isa <a href="../../Lucy/Search/Query.html" >class="podlinkpod" Modified: lucy/site/trunk/content/docs/test/Lucy/Search/Collector.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Search/Collector.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Search/Collector.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Search/Collector.mdtext Fri Feb 26 12:52:25 2016 @@ -3,34 +3,35 @@ Title: Lucy::Search::Collector - Apache <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Search::Collector - Process hits.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> # Abstract base class.</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <p>A Collector decides what to do with the hits that a <a href="../../Lucy/Search/Matcher.html" class="podlinkpod" ->Matcher</a> iterates through, based on how the abstract collect() method is implemented.</p> +>Matcher</a> iterates through, based on how the abstract <a href="#collect" class="podlinkpod" +>collect()</a> 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> +<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><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new()" ->new()</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> package MyCollector; use base qw( Lucy::Search::Collector ); @@ -44,13 +45,15 @@ name="new()" <p>Abstract constructor. Takes no arguments.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="ABSTRACT_METHODS" ->ABSTRACT METHODS</a></h1> +>ABSTRACT METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="collect(doc_id)" ->collect(doc_id)</a></h2> +<h3><a class='u' +name="collect" +>collect</a></h3> + +<pre> $collector->collect($doc_id);</pre> <p>Do something with a doc id. (For instance, keep track of the docs with the ten highest scores.)</p> @@ -58,9 +61,9 @@ name="collect(doc_id)" <li><b>doc_id</b> - A segment document id.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Search::Collector isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Search/Collector/BitCollector.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Search/Collector/BitCollector.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Search/Collector/BitCollector.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Search/Collector/BitCollector.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Search::Collector::BitColle <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Search::Collector::BitCollector - Collector which records doc nums in a BitVector.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> my $bit_vec = Lucy::Object::BitVector->new( capacity => $searcher->doc_max + 1, @@ -24,42 +24,46 @@ name="SYNOPSIS" query => $query, );</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <p>BitCollector is a Collector which saves matching document ids in a <a href="../../../Lucy/Object/BitVector.html" class="podlinkpod" >BitVector</a>. It is useful for recording the entire set of documents which >matches a query.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new(_[labeled_params]_)" ->new( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $bit_collector = Lucy::Search::Collector::BitCollector->new( bit_vector => $bit_vec, # required );</pre> +<p>Create a new BitCollector.</p> + <ul> <li><b>bit_vector</b> - A Lucy::Object::BitVector.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> + +<h3><a class='u' +name="collect" +>collect</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="collect(doc_id)" ->collect(doc_id)</a></h2> +<pre> $bit_collector->collect($doc_id);</pre> -<p>Set bit in the object's BitVector for the supplied doc id.</p> +<p>Set bit in the object’s BitVector for the supplied doc id.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Search::Collector::BitCollector isa <a href="../../../Lucy/Search/Collector.html" class="podlinkpod" >Lucy::Search::Collector</a> isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Search/Compiler.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Search/Compiler.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Search/Compiler.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Search/Compiler.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Search::Compiler - Apache L <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Search::Compiler - Query-to-Matcher compiler.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> # (Compiler is an abstract base class.) package MyCompiler; @@ -22,33 +22,39 @@ name="SYNOPSIS" return MyMatcher->new( @_, compiler => $self ); }</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <p>The purpose of the Compiler class is to take a specification in the form of a <a href="../../Lucy/Search/Query.html" class="podlinkpod" >Query</a> object and compile a <a href="../../Lucy/Search/Matcher.html" >class="podlinkpod" >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>The simplest Compiler subclasses – such as those associated with constant-scoring Query types – might simply implement a <a href="#make_matcher" class="podlinkpod" +>make_matcher()</a> 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>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 <a href="#get_weight" class="podlinkpod" +>get_weight()</a>, <a href="#sum_of_squared_weights" class="podlinkpod" +>sum_of_squared_weights()</a>, and <a href="#apply_norm_factor" class="podlinkpod" +>apply_norm_factor()</a>.</p> <p>Compiling a Matcher is a two stage process.</p> -<p>The first stage takes place during the Compiler's construction, which is where the Query object meets a <a href="../../Lucy/Search/Searcher.html" class="podlinkpod" ->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 first stage takes place during the Compiler’s construction, which is where the Query object meets a <a href="../../Lucy/Search/Searcher.html" class="podlinkpod" +>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" class="podlinkpod" ->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> +<p>The second stage of compilation is <a href="#make_matcher" class="podlinkpod" +>make_matcher()</a>, method, which is where the Compiler meets a <a href="../../Lucy/Index/SegReader.html" class="podlinkpod" +>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 <a href="#make_matcher" class="podlinkpod" +>make_matcher()</a> should return a Matcher at all.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new(_[labeled_params]_)" ->new( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $compiler = MyCompiler->SUPER::new( parent => $my_query, @@ -69,95 +75,100 @@ name="new(_[labeled_params]_)" <li><b>boost</b> - An arbitrary scoring multiplier. Defaults to the boost of the parent Query.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="ABSTRACT_METHODS" ->ABSTRACT METHODS</a></h1> +>ABSTRACT METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="make_matcher(_[labeled_params]_)" ->make_matcher( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="make_matcher" +>make_matcher</a></h3> + +<pre> my $retval = $compiler->make_matcher( + reader => $reader # required + need_score => $need_score # required + );</pre> <p>Factory method returning a Matcher.</p> <ul> <li><b>reader</b> - A SegReader.</li> -<li><b>need_score</b> - Indicate whether the Matcher must implement score().</li> +<li><b>need_score</b> - Indicate whether the Matcher must implement <a href="../../Lucy/Search/Matcher.html#score" class="podlinkpod" +>score()</a>.</li> </ul> <p>Returns: a Matcher, or undef if the Matcher would have matched no documents.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_weight()" ->get_weight()</a></h2> +<h3><a class='u' +name="get_weight" +>get_weight</a></h3> -<p>Return the Compiler's numerical weight, a scoring multiplier. By default, returns the object's boost.</p> +<pre> my $retval = $compiler->get_weight();</pre> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="sum_of_squared_weights()" ->sum_of_squared_weights()</a></h2> +<p>Return the Compiler’s numerical weight, a scoring multiplier. By default, returns the object’s boost.</p> -<p>Compute and return a raw weighting factor. (This quantity is used by normalize()). By default, simply returns 1.0.</p> +<h3><a class='u' +name="get_similarity" +>get_similarity</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="apply_norm_factor(factor)" ->apply_norm_factor(factor)</a></h2> +<pre> my $retval = $compiler->get_similarity();</pre> -<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>Accessor for the Compiler’s Similarity object.</p> -<p>The default implementation is a no-op; subclasses may wish to multiply their internal weight by the supplied factor.</p> +<h3><a class='u' +name="get_parent" +>get_parent</a></h3> -<ul> -<li><b>factor</b> - The multiplier.</li> -</ul> +<pre> my $retval = $compiler->get_parent();</pre> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="normalize()" ->normalize()</a></h2> +<p>Accessor for the Compiler’s parent Query object.</p> -<p>Take a newly minted Compiler object and apply query-specific normalization factors. Should be invoked by Query subclasses during make_compiler() for top-level nodes.</p> +<h3><a class='u' +name="sum_of_squared_weights" +>sum_of_squared_weights</a></h3> -<p>For a TermQuery, the scoring formula is approximately:</p> +<pre> my $retval = $compiler->sum_of_squared_weights();</pre> -<pre> (tf_d * idf_t / norm_d) * (tf_q * idf_t / norm_q)</pre> +<p>Compute and return a raw weighting factor. (This quantity is used by <a href="#normalize" class="podlinkpod" +>normalize()</a>). By default, simply returns 1.0.</p> -<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> +<h3><a class='u' +name="apply_norm_factor" +>apply_norm_factor</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_parent()" ->get_parent()</a></h2> +<pre> $compiler->apply_norm_factor($factor);</pre> -<p>Accessor for the Compiler's parent Query object.</p> +<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> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_similarity()" ->get_similarity()</a></h2> +<p>The default implementation is a no-op; subclasses may wish to multiply their internal weight by the supplied factor.</p> -<p>Accessor for the Compiler's Similarity object.</p> +<ul> +<li><b>factor</b> - The multiplier.</li> +</ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="highlight_spans(_[labeled_params]_)" ->highlight_spans( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="normalize" +>normalize</a></h3> -<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> +<pre> $compiler->normalize();</pre> -<p>The default implementation returns an empty array.</p> +<p>Take a newly minted Compiler object and apply query-specific normalization factors. Should be invoked by Query subclasses during <a href="../../Lucy/Search/Query.html#make_compiler" class="podlinkpod" +>make_compiler()</a> for top-level nodes.</p> -<ul> -<li><b>searcher</b> - A Searcher.</li> +<p>For a TermQuery, the scoring formula is approximately:</p> -<li><b>doc_vec</b> - A DocVector.</li> +<pre> (tf_d * idf_t / norm_d) * (tf_q * idf_t / norm_q)</pre> -<li><b>field</b> - The name of the field.</li> -</ul> +<p><a href="#normalize" class="podlinkpod" +>normalize()</a> 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> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Search::Compiler isa <a href="../../Lucy/Search/Query.html" class="podlinkpod" >Lucy::Search::Query</a> isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Search/Hits.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Search/Hits.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Search/Hits.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Search/Hits.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Search::Hits - Apache Lucy <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Search::Hits - Access search results.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> my $hits = $searcher->hits( query => $query, @@ -22,31 +22,35 @@ name="SYNOPSIS" print "<p>$hit->{title} <em>" . $hit->get_score . "</em></p>\n"; }</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <p>Hits objects are iterators used to access the results of a search.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="next()" ->next()</a></h2> +<h3><a class='u' +name="next" +>next</a></h3> + +<pre> my $retval = $hits->next();</pre> <p>Return the next hit, or undef when the iterator is exhausted.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="total_hits()" ->total_hits()</a></h2> +<h3><a class='u' +name="total_hits" +>total_hits</a></h3> + +<pre> my $retval = $hits->total_hits();</pre> <p>Return the total number of documents which matched the Query used to produce the Hits object. Note that this is the total number of matches, not just the number of matches represented by the Hits iterator.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Search::Hits isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Search/IndexSearcher.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Search/IndexSearcher.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Search/IndexSearcher.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Search/IndexSearcher.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Search::IndexSearcher - Apa <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Search::IndexSearcher - Execute searches against a single index.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> my $searcher = Lucy::Search::IndexSearcher->new( index => '/path/to/index' @@ -22,9 +22,9 @@ name="SYNOPSIS" num_wanted => 100, );</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <p>Use the IndexSearcher class to perform search queries against an index. (For searching multiple indexes at once, see <a href="../../Lucy/Search/PolySearcher.html" class="podlinkpod" >PolySearcher</a>).</p> @@ -32,46 +32,61 @@ name="DESCRIPTION" <p>IndexSearchers operate against a single point-in-time view or <a href="../../Lucy/Index/Snapshot.html" class="podlinkpod" >Snapshot</a> of the index. If an index is modified, a new IndexSearcher must >be opened to access the changes.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new(_[labeled_params]_)" ->new( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $searcher = Lucy::Search::IndexSearcher->new( index => '/path/to/index' );</pre> +<p>Create a new IndexSearcher.</p> + <ul> <li><b>index</b> - Either a string filepath, a Folder, or an IndexReader.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="hits(_[labeled_params]_)" ->hits( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="doc_max" +>doc_max</a></h3> -<p>Return a Hits object containing the top results.</p> +<pre> my $retval = $index_searcher->doc_max();</pre> -<ul> -<li><b>query</b> - Either a Query object or a query string.</li> +<p>Return the maximum number of docs in the collection represented by the Searcher, which is also the highest possible internal doc id. Documents which have been marked as deleted but not yet purged are included in this count.</p> -<li><b>offset</b> - The number of most-relevant hits to discard, typically used when "paging" through hits N at a time. Setting <code>offset</code> to 20 and <code>num_wanted</code> to 10 retrieves hits 21-30, assuming that 30 hits can be found.</li> +<h3><a class='u' +name="doc_freq" +>doc_freq</a></h3> + +<pre> my $retval = $index_searcher->doc_freq( + field => $field # required + term => $term # required + );</pre> -<li><b>num_wanted</b> - The number of hits you would like to see after <code>offset</code> is taken into account.</li> +<p>Return the number of documents which contain the term in the given field.</p> -<li><b>sort_spec</b> - A <a href="../../Lucy/Search/SortSpec.html" class="podlinkpod" ->Lucy::Search::SortSpec</a>, which will affect how results are ranked and returned.</li> +<ul> +<li><b>field</b> - Field name.</li> + +<li><b>term</b> - The term to look up.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="collect(_[labeled_params]_)" ->collect( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="collect" +>collect</a></h3> + +<pre> $index_searcher->collect( + query => $query # required + collector => $collector # required + );</pre> <p>Iterate over hits, feeding them into a <a href="../../Lucy/Search/Collector.html" class="podlinkpod" >Collector</a>.</p> @@ -82,27 +97,11 @@ name="collect(_[labeled_params]_)" <li><b>collector</b> - A Collector.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="doc_max()" ->doc_max()</a></h2> - -<p>Return the maximum number of docs in the collection represented by the Searcher, which is also the highest possible internal doc id. Documents which have been marked as deleted but not yet purged are included in this count.</p> - -<h2><a class='u' href='#___top' title='click to go to top of document' -name="doc_freq(_[labeled_params]_)" ->doc_freq( <i>[labeled params]</i> )</a></h2> - -<p>Return the number of documents which contain the term in the given field.</p> +<h3><a class='u' +name="fetch_doc" +>fetch_doc</a></h3> -<ul> -<li><b>field</b> - Field name.</li> - -<li><b>term</b> - The term to look up.</li> -</ul> - -<h2><a class='u' href='#___top' title='click to go to top of document' -name="fetch_doc(doc_id)" ->fetch_doc(doc_id)</a></h2> +<pre> my $retval = $index_searcher->fetch_doc($doc_id);</pre> <p>Retrieve a document. Throws an error if the doc id is out of range.</p> @@ -110,21 +109,17 @@ name="fetch_doc(doc_id)" <li><b>doc_id</b> - A document id.</li> </ul> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_schema()" ->get_schema()</a></h2> - -<p>Accessor for the object's <code>schema</code> member.</p> +<h3><a class='u' +name="get_reader" +>get_reader</a></h3> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_reader()" ->get_reader()</a></h2> +<pre> my $retval = $index_searcher->get_reader();</pre> -<p>Accessor for the object's <code>reader</code> member.</p> +<p>Accessor for the object’s <code>reader</code> member.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Search::IndexSearcher isa <a href="../../Lucy/Search/Searcher.html" class="podlinkpod" >Lucy::Search::Searcher</a> isa Clownfish::Obj.</p> Modified: lucy/site/trunk/content/docs/test/Lucy/Search/LeafQuery.mdtext URL: http://svn.apache.org/viewvc/lucy/site/trunk/content/docs/test/Lucy/Search/LeafQuery.mdtext?rev=1732471&r1=1732470&r2=1732471&view=diff ============================================================================== --- lucy/site/trunk/content/docs/test/Lucy/Search/LeafQuery.mdtext (original) +++ lucy/site/trunk/content/docs/test/Lucy/Search/LeafQuery.mdtext Fri Feb 26 12:52:25 2016 @@ -3,15 +3,15 @@ Title: Lucy::Search::LeafQuery - Apache <div> <a name='___top' class='dummyTopAnchor' ></a> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="NAME" ->NAME</a></h1> +>NAME</a></h2> <p>Lucy::Search::LeafQuery - Leaf node in a tree created by QueryParser.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="SYNOPSIS" ->SYNOPSIS</a></h1> +>SYNOPSIS</a></h2> <pre> package MyQueryParser; use base qw( Lucy::Search::QueryParser ); @@ -29,53 +29,72 @@ name="SYNOPSIS" } }</pre> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="DESCRIPTION" ->DESCRIPTION</a></h1> +>DESCRIPTION</a></h2> <p>LeafQuery objects serve as leaf nodes in the tree structure generated by <a href="../../Lucy/Search/QueryParser.html" class="podlinkpod" ->QueryParser</a>'s tree() method. Ultimately, they must be transformed, typically into either <a href="../../Lucy/Search/TermQuery.html" class="podlinkpod" +>QueryParser</a>’s <a href="../../Lucy/Search/QueryParser.html#tree" class="podlinkpod" +>tree()</a> method. Ultimately, they must be transformed, typically into either <a href="../../Lucy/Search/TermQuery.html" class="podlinkpod" >TermQuery</a> or <a href="../../Lucy/Search/PhraseQuery.html" >class="podlinkpod" >PhraseQuery</a> objects, as attempting to search a LeafQuery causes an >error.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="CONSTRUCTORS" ->CONSTRUCTORS</a></h1> +>CONSTRUCTORS</a></h2> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="new(_[labeled_params]_)" ->new( <i>[labeled params]</i> )</a></h2> +<h3><a class='u' +name="new" +>new</a></h3> <pre> my $leaf_query = Lucy::Search::LeafQuery->new( text => '"three blind mice"', # required field => 'content', # default: undef );</pre> +<p>Create a new LeafQuery.</p> + <ul> <li><b>field</b> - Optional field name.</li> <li><b>text</b> - Raw query text.</li> </ul> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="METHODS" ->METHODS</a></h1> +>METHODS</a></h2> + +<h3><a class='u' +name="get_field" +>get_field</a></h3> + +<pre> my $retval = $leaf_query->get_field();</pre> + +<p>Accessor for object’s <code>field</code> attribute.</p> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_field()" ->get_field()</a></h2> +<h3><a class='u' +name="get_text" +>get_text</a></h3> -<p>Accessor for object's <code>field</code> attribute.</p> +<pre> my $retval = $leaf_query->get_text();</pre> -<h2><a class='u' href='#___top' title='click to go to top of document' -name="get_text()" ->get_text()</a></h2> +<p>Accessor for object’s <code>text</code> attribute.</p> + +<h3><a class='u' +name="make_compiler" +>make_compiler</a></h3> + +<pre> my $retval = $leaf_query->make_compiler( + searcher => $searcher # required + boost => $boost # required + subordinate => $subordinate # default: false + );</pre> -<p>Accessor for object's <code>text</code> attribute.</p> +<p>Throws an error.</p> -<h1><a class='u' href='#___top' title='click to go to top of document' +<h2><a class='u' name="INHERITANCE" ->INHERITANCE</a></h1> +>INHERITANCE</a></h2> <p>Lucy::Search::LeafQuery isa <a href="../../Lucy/Search/Query.html" class="podlinkpod" >Lucy::Search::Query</a> isa Clownfish::Obj.</p>
