strus  0.17
Public Member Functions | List of all members
strus::WeightingFunctionContextInterface Class Referenceabstract

Interface for a weighting function with its state and context used during calculation. More...

#include <weightingFunctionContextInterface.hpp>

Public Member Functions

virtual ~WeightingFunctionContextInterface ()
 Destructor. More...
 
virtual void addWeightingFeature (const std::string &name_, PostingIteratorInterface *postingIterator_, double weight_, const TermStatistics &stats_)=0
 Add a feature that is subject of weighting to the execution context. More...
 
virtual void setVariableValue (const std::string &name, double value)=0
 Set the value of a query variable. More...
 
virtual double call (const Index &docno)=0
 Call the weighting function for a document. More...
 
virtual std::string debugCall (const Index &docno)=0
 Get debug info dumped as string of the weighting call for one document. More...
 

Detailed Description

Interface for a weighting function with its state and context used during calculation.

Constructor & Destructor Documentation

virtual strus::WeightingFunctionContextInterface::~WeightingFunctionContextInterface ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void strus::WeightingFunctionContextInterface::addWeightingFeature ( const std::string &  name_,
PostingIteratorInterface postingIterator_,
double  weight_,
const TermStatistics stats_ 
)
pure virtual

Add a feature that is subject of weighting to the execution context.

Parameters
[in]name_name of the weighting feature
[in]postingIterator_iterator on the matches of the weighting feature (ownership remains at caller)
[in]weight_weight of this feature
[in]stats_global term statistics passed down with the query. If undefined, they can be defined by or estimated from the posting iterator data.
Remarks
Do call this method before calling call the first time for not having incomplete results
virtual double strus::WeightingFunctionContextInterface::call ( const Index docno)
pure virtual

Call the weighting function for a document.

Parameters
[in]docnodocument number
Returns
the calculated weight of the document
virtual std::string strus::WeightingFunctionContextInterface::debugCall ( const Index docno)
pure virtual

Get debug info dumped as string of the weighting call for one document.

Parameters
[in]docnodocument to get the debug info from
Returns
the debug info as string
virtual void strus::WeightingFunctionContextInterface::setVariableValue ( const std::string &  name,
double  value 
)
pure virtual

Set the value of a query variable.

Parameters
[in]namename of the variable
[in]valuevalue of the variable

The documentation for this class was generated from the following file: