strusPython
0.14
|
Query program object representing a retrieval method for documents in a storage. More...
#include <bindingObjects.hpp>
Public Member Functions | |
Query (const Query &o) | |
Copy constructor. More... | |
~Query () | |
Destructor. More... | |
void | defineFeature (const String &set_, const QueryExpression &expr_, double weight_=1.0) |
Create a feature from the query expression passed. More... | |
void | defineDocFieldFeature (const String &set_, const String &metadataStart, const String &metadataEnd) |
Define a posting iterator describing a document field addressable as feature. More... | |
void | addMetaDataRestrictionCondition (const char *compareOp, const String &name, const Variant &value, bool newGroup) |
Define a meta data restriction. More... | |
void | addMetaDataRestrictionCondition (const char *compareOp, const String &name, double value, bool newGroup) |
Define a meta data restriction. More... | |
void | addMetaDataRestrictionCondition (const char *compareOp, const String &name, unsigned int value, bool newGroup) |
Define a meta data restriction. More... | |
void | addMetaDataRestrictionCondition (const char *compareOp, const String &name, int value, bool newGroup) |
Define a meta data restriction. More... | |
void | defineTermStatistics (const String &type_, const String &value_, const TermStatistics &stats_) |
Define term statistics to use for a term for weighting it in this query. More... | |
void | defineGlobalStatistics (const GlobalStatistics &stats_) |
Define the global statistics to use for weighting in this query. More... | |
void | addDocumentEvaluationSet (const IndexVector &docnolist_) |
Define a set of documents the query is evaluated on. By default the query is evaluated on all documents in the storage. More... | |
void | setMaxNofRanks (unsigned int maxNofRanks_) |
Set number of ranks to evaluate starting with the first rank (the maximum size of the result rank list) More... | |
void | setMinRank (unsigned int minRank_) |
Set the index of the first rank to be returned. More... | |
void | addUserName (const String &username_) |
Add a user for this query (as alternative role) More... | |
void | setWeightingVariables (const FunctionVariableConfig ¶meter) |
Assign values to variables of the weighting formula. More... | |
QueryResult | evaluate () const |
Evaluate this query and return the result. More... | |
String | tostring () const |
Map the contents of the query to a readable string. More... | |
Friends | |
class | QueryEval |
Query program object representing a retrieval method for documents in a storage.
strus::Query::Query | ( | const Query & | o | ) |
Copy constructor.
|
inline |
Destructor.
void strus::Query::addDocumentEvaluationSet | ( | const IndexVector & | docnolist_ | ) |
Define a set of documents the query is evaluated on. By default the query is evaluated on all documents in the storage.
[in] | docnolist_ | list of documents to evaluate the query on |
void strus::Query::addMetaDataRestrictionCondition | ( | const char * | compareOp, |
const String & | name, | ||
const Variant & | value, | ||
bool | newGroup | ||
) |
Define a meta data restriction.
[in] | compareOp | compare operator, one of "=","!=",">=","<=","<",">" |
[in] | name | of the meta data field (left side of comparison operator) |
[in] | value | numeric value to compare with the meta data field (right side of comparison operator) |
[in] | newGroup | true, if the restriction is not an alternative condition to the previous one defined (alternative conditions are evaluated as logical OR) |
void strus::Query::addMetaDataRestrictionCondition | ( | const char * | compareOp, |
const String & | name, | ||
double | value, | ||
bool | newGroup | ||
) |
Define a meta data restriction.
[in] | compareOp | compare operator, one of "=","!=",">=","<=","<",">" |
[in] | name | of the meta data field (left side of comparison operator) |
[in] | value | numeric value to compare with the meta data field (right side of comparison operator) |
[in] | newGroup | true, if the restriction is not an alternative condition to the previous one defined (alternative conditions are evaluated as logical OR) |
void strus::Query::addMetaDataRestrictionCondition | ( | const char * | compareOp, |
const String & | name, | ||
unsigned int | value, | ||
bool | newGroup | ||
) |
Define a meta data restriction.
[in] | compareOp | compare operator, one of "=","!=",">=","<=","<",">" |
[in] | name | of the meta data field (left side of comparison operator) |
[in] | value | numeric value to compare with the meta data field (right side of comparison operator) |
[in] | newGroup | true, if the restriction is not an alternative condition to the previous one defined (alternative conditions are evaluated as logical OR) |
void strus::Query::addMetaDataRestrictionCondition | ( | const char * | compareOp, |
const String & | name, | ||
int | value, | ||
bool | newGroup | ||
) |
Define a meta data restriction.
[in] | compareOp | compare operator, one of "=","!=",">=","<=","<",">" |
[in] | name | of the meta data field (left side of comparison operator) |
[in] | value | numeric value to compare with the meta data field (right side of comparison operator) |
[in] | newGroup | true, if the restriction is not an alternative condition to the previous one defined (alternative conditions are evaluated as logical OR) |
void strus::Query::addUserName | ( | const String & | username_ | ) |
Add a user for this query (as alternative role)
[in] | username_ | an alternative name of a user for the evaluation of this query |
void strus::Query::defineDocFieldFeature | ( | const String & | set_, |
const String & | metadataStart, | ||
const String & | metadataEnd | ||
) |
Define a posting iterator describing a document field addressable as feature.
[in] | set_ | name of the feature set, this feature is addressed with |
[in] | metadataStart | name of meta data element that defines the start of the document field, assumed as 1 if name is empty |
[in] | metadataEnd | name of meta data element that defines the end of the document field, assumed as max value if name is empty |
void strus::Query::defineFeature | ( | const String & | set_, |
const QueryExpression & | expr_, | ||
double | weight_ = 1.0 |
||
) |
Create a feature from the query expression passed.
[in] | set_ | name of the feature set, this feature is addressed with |
[in] | expr_ | query expression that defines the postings of the feature and the variables attached |
[in] | weight_ | individual weight of the feature in the query |
void strus::Query::defineGlobalStatistics | ( | const GlobalStatistics & | stats_ | ) |
Define the global statistics to use for weighting in this query.
[in] | stats_ | the structure with the statistics to set |
void strus::Query::defineTermStatistics | ( | const String & | type_, |
const String & | value_, | ||
const TermStatistics & | stats_ | ||
) |
Define term statistics to use for a term for weighting it in this query.
[in] | type_ | query term type name |
[in] | value_ | query term value |
[in] | stats_ | the structure with the statistics to set |
QueryResult strus::Query::evaluate | ( | ) | const |
Evaluate this query and return the result.
void strus::Query::setMaxNofRanks | ( | unsigned int | maxNofRanks_ | ) |
Set number of ranks to evaluate starting with the first rank (the maximum size of the result rank list)
[in] | maxNofRanks_ | maximum number of results to return by this query |
void strus::Query::setMinRank | ( | unsigned int | minRank_ | ) |
Set the index of the first rank to be returned.
[in] | minRank_ | index of the first rank to be returned by this query |
void strus::Query::setWeightingVariables | ( | const FunctionVariableConfig & | parameter | ) |
Assign values to variables of the weighting formula.
[in] | parameter | parameter values |
String strus::Query::tostring | ( | ) | const |
Map the contents of the query to a readable string.
|
friend |