KinoSearch
view release on metacpan or search on metacpan
lib/KinoSearch/Search/Compiler.pod view on Meta::CPAN
=head1 ABSTRACT METHODS
=head2 make_matcher( I<[labeled params]> )
Factory method returning a Matcher.
=over
=item *
B<reader> - A SegReader.
=item *
B<need_score> - Indicate whether the Matcher must implement score().
=back
Returns: a Matcher, or undef if the Matcher would have matched no
documents.
=head1 METHODS
=head2 get_weight()
Return the Compiler's numerical weight, a scoring multiplier. By
default, returns the object's boost.
=head2 sum_of_squared_weights()
Compute and return a raw weighting factor. (This quantity is used by
normalize()). By default, simply returns 1.0.
=head2 apply_norm_factor(factor)
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.
The default implementation is a no-op; subclasses may wish to multiply
their internal weight by the supplied factor.
=over
=item *
B<factor> - The multiplier.
=back
=head2 normalize()
Take a newly minted Compiler object and apply query-specific
normalization factors. Should be called at or near the end of
construction.
For a TermQuery, the scoring formula is approximately:
( tf_d * idf_t / norm_d ) * ( tf_q * idf_t / norm_q )
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.
=head2 get_parent()
Accessor for the Compiler's parent Query object.
=head2 get_similarity()
Accessor for the Compiler's Similarity object.
=head2 highlight_spans( I<[labeled params]> )
Return an array of Span objects, indicating where in the given
field the text that matches the parent query occurs. In this case,
the span's offset and length are measured in Unicode code points.
The default implementation returns an empty array.
=over
=item *
B<searcher> - A Searcher.
=item *
B<doc_vec> - A DocVector.
=item *
B<field> - The name of the field.
=back
=head1 INHERITANCE
KinoSearch::Search::Compiler isa L<KinoSearch::Search::Query> isa L<KinoSearch::Object::Obj>.
=head1 COPYRIGHT AND LICENSE
Copyright 2005-2011 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
=cut
( run in 0.382 second using v1.01-cache-2.11-cpan-5511b514fd6 )