Lucy
view release on metacpan or search on metacpan
cfcore/Lucy/Search/Compiler.cfh view on Meta::CPAN
* @param parent The parent Query.
* @param searcher A Lucy::Search::Searcher, such as an
* IndexSearcher.
* @param similarity A Similarity.
* @param boost An arbitrary scoring multiplier. Defaults to the boost of
* the parent Query.
*/
public inert Compiler*
init(Compiler *self, Query *parent, Searcher *searcher,
Similarity *similarity = NULL, float boost);
/** Factory method returning a Matcher.
*
* @param reader A SegReader.
* @param need_score Indicate whether the Matcher must implement [](cfish:Matcher.Score).
* @return a Matcher, or [](cfish:@null) if the Matcher would have matched
* no documents.
*/
public abstract incremented nullable Matcher*
Make_Matcher(Compiler *self, SegReader *reader, bool need_score);
/** Return the Compiler's numerical weight, a scoring multiplier. By
* default, returns the object's boost.
*/
public float
Get_Weight(Compiler *self);
/** Accessor for the Compiler's Similarity object.
*/
public nullable Similarity*
Get_Similarity(Compiler *self);
/** Accessor for the Compiler's parent Query object.
*/
public Query*
Get_Parent(Compiler *self);
/** Compute and return a raw weighting factor. (This quantity is used by
* [](cfish:.Normalize)). By default, simply returns 1.0.
*/
public float
Sum_Of_Squared_Weights(Compiler *self);
/** 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.
*
* @param factor The multiplier.
*/
public void
Apply_Norm_Factor(Compiler *self, float factor);
/** Take a newly minted Compiler object and apply query-specific
* normalization factors. Should be invoked by Query subclasses during
* [](cfish:.Make_Compiler) for top-level nodes.
*
* For a TermQuery, the scoring formula is approximately:
*
* (tf_d * idf_t / norm_d) * (tf_q * idf_t / norm_q)
*
* [](cfish:.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.
*/
public void
Normalize(Compiler *self);
/** 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.
*
* The default implementation returns an empty array.
*
* @param searcher A Searcher.
* @param doc_vec A DocVector.
* @param field The name of the field.
*/
incremented Vector*
Highlight_Spans(Compiler *self, Searcher *searcher,
DocVector *doc_vec, String *field);
void
Serialize(Compiler *self, OutStream *outstream);
incremented Compiler*
Deserialize(decremented Compiler *self, InStream *instream);
public bool
Equals(Compiler *self, Obj *other);
public incremented String*
To_String(Compiler *self);
public void
Destroy(Compiler *self);
}
( run in 0.568 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )