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

Defines a query evaluation scheme. More...

#include <queryEvalInterface.hpp>

Classes

class  FeatureParameter
 Structure that describes a feature that is subject of summarization or weighting. More...
 

Public Member Functions

virtual ~QueryEvalInterface ()
 Destructor. More...
 
virtual void addTerm (const std::string &set_, const std::string &type_, const std::string &value_)=0
 Declare a predefined term for all queries of this type. More...
 
virtual void addSelectionFeature (const std::string &set_)=0
 Declare a set of features to be used for selection (declare what documents to weight) More...
 
virtual void addRestrictionFeature (const std::string &set_)=0
 Define a set of features to be used as restriction (exclude documents that do not contain a feature of the set declared) More...
 
virtual void addExclusionFeature (const std::string &set_)=0
 Define a set of features to be used as exclusion (exclude documents that contain a feature of the set declared) More...
 
virtual std::vector< std::string > getWeightingFeatureSets () const =0
 Define a set of features to be used for weighting. More...
 
virtual std::vector< std::string > getSelectionFeatureSets () const =0
 Define a set of features to be used as selection (declare what documents to weight) More...
 
virtual std::vector< std::string > getRestrictionFeatureSets () const =0
 Get the set names of features to be used as restriction (exclude documents that do not contain a feature of the set declared) More...
 
virtual std::vector< std::string > getExclusionFeatureSets () const =0
 Get the set names of features to be used as exclusion (exclude documents that contain a feature of the set declared) More...
 
virtual void addSummarizerFunction (const std::string &functionName, SummarizerFunctionInstanceInterface *function, const std::vector< FeatureParameter > &featureParameters, const std::string &debugAttributeName=std::string())=0
 Declare a summarizer function to use for this query evaluation scheme. More...
 
virtual void addWeightingFunction (const std::string &functionName, WeightingFunctionInstanceInterface *function, const std::vector< FeatureParameter > &featureParameters, const std::string &debugAttributeName=std::string())=0
 Declare a weighting function to use for this query evaluation scheme. More...
 
virtual void defineWeightingFormula (ScalarFunctionInterface *combinefunc)=0
 Declare the scalar function to combine the weighting functions declared. More...
 
virtual QueryInterfacecreateQuery (const StorageClientInterface *storage) const =0
 Create a new query. More...
 

Detailed Description

Defines a query evaluation scheme.

Constructor & Destructor Documentation

virtual strus::QueryEvalInterface::~QueryEvalInterface ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void strus::QueryEvalInterface::addExclusionFeature ( const std::string &  set_)
pure virtual

Define a set of features to be used as exclusion (exclude documents that contain a feature of the set declared)

Parameters
[in]set_name of the set of the exclusion feature
virtual void strus::QueryEvalInterface::addRestrictionFeature ( const std::string &  set_)
pure virtual

Define a set of features to be used as restriction (exclude documents that do not contain a feature of the set declared)

Parameters
[in]set_name of the set of the restriction feature
virtual void strus::QueryEvalInterface::addSelectionFeature ( const std::string &  set_)
pure virtual

Declare a set of features to be used for selection (declare what documents to weight)

Parameters
[in]set_name of the set of the selecting feature.
Remarks
If no selector feature is specified then the query evaluation fails
virtual void strus::QueryEvalInterface::addSummarizerFunction ( const std::string &  functionName,
SummarizerFunctionInstanceInterface function,
const std::vector< FeatureParameter > &  featureParameters,
const std::string &  debugAttributeName = std::string() 
)
pure virtual

Declare a summarizer function to use for this query evaluation scheme.

Parameters
[in]functionNamename of the summarizer function (no meaning, just for inspection and tracing)
[in]functionparameterized summarizer function to use (ownership passed to this). The function instance can be constructed by getting the function by name from the query processor and parameterizing a created instance of it.
[in]featureParameterslist of parameters adressing query features that are subject of sumarization
[in]debugAttributeName(optional) name of the attribute the debug info is attached to if debug mode is switched on in query (empty if no debug info should be provided in any case)
virtual void strus::QueryEvalInterface::addTerm ( const std::string &  set_,
const std::string &  type_,
const std::string &  value_ 
)
pure virtual

Declare a predefined term for all queries of this type.

Parameters
[in]set_name of the set of this term. The set is the identifier to address a group of terms. It declares the role of the term in the query
[in]type_name of the type of the term
[in]value_value of the term
Note
This function is useful to define structural elements in the document used for query evaluation, that are not part of the query itself. For example sentence or paragraph marker.
virtual void strus::QueryEvalInterface::addWeightingFunction ( const std::string &  functionName,
WeightingFunctionInstanceInterface function,
const std::vector< FeatureParameter > &  featureParameters,
const std::string &  debugAttributeName = std::string() 
)
pure virtual

Declare a weighting function to use for this query evaluation scheme.

Parameters
[in]functionNamename of the weighting function (no meaning, just for inspection and tracing)
[in]functionparameterized weighting function to use (ownership passed to this). The function instance can be constructed by getting the function by name from the query processor and parameterizing a created instance of it.
[in]featureParameterslist of parameters adressing query features that are subject of weighting
[in]debugAttributeName(optional) name of the attribute the debug info is attached to if debug mode is switched on in query (empty if no debug info should be provided in any case)
virtual QueryInterface* strus::QueryEvalInterface::createQuery ( const StorageClientInterface storage) const
pure virtual

Create a new query.

Parameters
[in]storagestorage to run the query on
Returns
a query instance for this query evaluation type
virtual void strus::QueryEvalInterface::defineWeightingFormula ( ScalarFunctionInterface combinefunc)
pure virtual

Declare the scalar function to combine the weighting functions declared.

Parameters
[in]combinefuncscalar function (passed ownership) for combining the weighting functions defined to one value
Remarks
If not defined, then the weights of the declared weighting functions are just added together
virtual std::vector<std::string> strus::QueryEvalInterface::getExclusionFeatureSets ( ) const
pure virtual

Get the set names of features to be used as exclusion (exclude documents that contain a feature of the set declared)

Returns
the list of all exclusion feature set names declared
virtual std::vector<std::string> strus::QueryEvalInterface::getRestrictionFeatureSets ( ) const
pure virtual

Get the set names of features to be used as restriction (exclude documents that do not contain a feature of the set declared)

Returns
the list of all restriction feature set names declared
virtual std::vector<std::string> strus::QueryEvalInterface::getSelectionFeatureSets ( ) const
pure virtual

Define a set of features to be used as selection (declare what documents to weight)

Returns
the list of all selecting feature set names declared
virtual std::vector<std::string> strus::QueryEvalInterface::getWeightingFeatureSets ( ) const
pure virtual

Define a set of features to be used for weighting.

Returns
the list of all weighting feature set names declared

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