strus
0.17
|
Defines a strus information retrieval query. More...
#include <queryInterface.hpp>
Public Member Functions | |
virtual | ~QueryInterface () |
Destructor. More... | |
virtual void | pushTerm (const std::string &type_, const std::string &value_, const Index &length_)=0 |
Push a term to the query stack. More... | |
virtual void | pushDocField (const std::string &metadataRangeStart, const std::string &metadataRangeEnd)=0 |
Push an expression on the query stack that defines a single field per document. The fields are represented as a sets of postings. The postings are defined as meta data elements describing the start and the end of the field for each document. More... | |
virtual void | pushExpression (const PostingJoinOperatorInterface *operation, unsigned int argc, int range, unsigned int cardinality)=0 |
Push an expression formed by the topmost elements from the stack to the query stack, removing the argument elements. More... | |
virtual void | attachVariable (const std::string &name_)=0 |
Attaches a variable to the top expression or term on the query stack. More... | |
virtual void | defineFeature (const std::string &set_, double weight_=1.0)=0 |
Define the topmost element of the stack as feature, removing it from the stack. More... | |
virtual void | defineTermStatistics (const std::string &type_, const std::string &value_, const TermStatistics &stats_)=0 |
Define the statistics of a term for the case that they are defined by the client (for example in a system with a distributed index) More... | |
virtual void | defineGlobalStatistics (const GlobalStatistics &stats_)=0 |
Define the global statistics for the case that they are defined by the client. More... | |
virtual void | addMetaDataRestrictionCondition (const MetaDataRestrictionInterface::CompareOperator &opr, const std::string &name, const NumericVariant &operand, bool newGroup=true)=0 |
Add a condition clause to the restriction on the document meta data of this query. More... | |
virtual void | addDocumentEvaluationSet (const std::vector< Index > &docnolist_)=0 |
Define a restriction on the documents as list of local document numbers (Add local document numbers to the list of documents to restrict the query on) More... | |
virtual void | addAccess (const std::string &username_)=0 |
Add a restriction for documents accessible by this query. More... | |
virtual void | setMaxNofRanks (std::size_t maxNofRanks_)=0 |
Set the maximum number of ranks to evaluate starting with the minimum rank. More... | |
virtual void | setMinRank (std::size_t minRank_)=0 |
Set the minimum rank number to return. More... | |
virtual void | setWeightingVariableValue (const std::string &name, double value)=0 |
Set the value of a variable in the weigthing formula defined with QueryEval::defineWeightingFormula(ScalarFunctionInterface* combinefunc) or in a weighting function or a summarizer. More... | |
virtual void | setDebugMode (bool debug)=0 |
Switch debug mode on or off (default off). In case of debug mode additional attributes defined with the function definitions in the query evaluation are attached to the result. More... | |
virtual QueryResult | evaluate () const =0 |
Evaluate the query. More... | |
virtual std::string | tostring () const =0 |
Map query to readable string. More... | |
Defines a strus information retrieval query.
|
inlinevirtual |
Destructor.
|
pure virtual |
Add a restriction for documents accessible by this query.
[in] | username_ | name of user role that is allowed to see the result documents |
|
pure virtual |
Define a restriction on the documents as list of local document numbers (Add local document numbers to the list of documents to restrict the query on)
[in] | docnolist_ | list of documents to evaluate the query on |
|
pure virtual |
Add a condition clause to the restriction on the document meta data of this query.
[in] | opr | condition compare operator |
[in] | name | name of meta data element to check |
[in] | operand | constant number to check against |
[in] | newGroup | true, if the conditional opens a new group of elements joined with a logical "OR" false, if the conditional belongs to the last group of elements joined with a logical "OR". Different groups are joined with a logical "AND" to form the meta data restriction expression |
|
pure virtual |
Attaches a variable to the top expression or term on the query stack.
[in] | name_ | name of the variable attached |
|
pure virtual |
Define the topmost element of the stack as feature, removing it from the stack.
[in] | set_ | name of the set of the new feature created |
[in] | weight_ | weight of the feature for the weighting function in query evaluation |
|
pure virtual |
Define the global statistics for the case that they are defined by the client.
[in] | stats_ | global statistics |
|
pure virtual |
Define the statistics of a term for the case that they are defined by the client (for example in a system with a distributed index)
[in] | type_ | term type |
[in] | value_ | term value |
[in] | stats_ | term statistics |
|
pure virtual |
Evaluate the query.
|
pure virtual |
Push an expression on the query stack that defines a single field per document. The fields are represented as a sets of postings. The postings are defined as meta data elements describing the start and the end of the field for each document.
[in] | metadataRangeStart | name of metadata element that defines the start position of the field in a document |
[in] | metadataRangeEnd | name of metadata element that defines the end position of the field (first position after the field) in a document |
|
pure virtual |
Push an expression formed by the topmost elements from the stack to the query stack, removing the argument elements.
[in] | operation | the expression join operator |
[in] | argc | number of expression arguments |
[in] | range | position proximity range of the expression |
[in] | cardinality | specifies a result dimension requirement (e.g. minimum number of elements of any input subset selection that builds a result) (0 for use default). Interpretation depends on operation, but in most cases it specifies the required size for a valid result. |
|
pure virtual |
Push a term to the query stack.
[in] | type_ | term type |
[in] | value_ | term value |
[in] | length_ | term length (ordinal position count) |
|
pure virtual |
Switch debug mode on or off (default off). In case of debug mode additional attributes defined with the function definitions in the query evaluation are attached to the result.
[in] | debug | true for enabling debug mode on and false for disabling debug mode (diabled by default) |
|
pure virtual |
Set the maximum number of ranks to evaluate starting with the minimum rank.
[in] | maxNofRanks_ | maximum number of ranks |
|
pure virtual |
Set the minimum rank number to return.
[in] | minRank_ | the minimum rank number |
|
pure virtual |
Set the value of a variable in the weigthing formula defined with QueryEval::defineWeightingFormula(ScalarFunctionInterface* combinefunc) or in a weighting function or a summarizer.
[in] | name | name of the variable |
[in] | value | value of the variable |
|
pure virtual |
Map query to readable string.