Query program object representing a retrieval method for documents in a storage.
More...
#include <bindingObjects.hpp>
|
| 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, 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...
|
|
Query program object representing a retrieval method for documents in a storage.
net::strus::api::Query::Query |
( |
const Query & |
o | ) |
|
net::strus::api::Query::~Query |
( |
| ) |
|
|
inline |
void net::strus::api::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.
- Parameters
-
[in] | docnolist_ | list of documents to evaluate the query on |
void net::strus::api::Query::addMetaDataRestrictionCondition |
( |
const char * |
compareOp, |
|
|
const String & |
name, |
|
|
double |
value, |
|
|
bool |
newGroup |
|
) |
| |
Define a meta data restriction.
- Parameters
-
[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 net::strus::api::Query::addMetaDataRestrictionCondition |
( |
const char * |
compareOp, |
|
|
const String & |
name, |
|
|
unsigned int |
value, |
|
|
bool |
newGroup |
|
) |
| |
Define a meta data restriction.
- Parameters
-
[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 net::strus::api::Query::addMetaDataRestrictionCondition |
( |
const char * |
compareOp, |
|
|
const String & |
name, |
|
|
int |
value, |
|
|
bool |
newGroup |
|
) |
| |
Define a meta data restriction.
- Parameters
-
[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 net::strus::api::Query::addUserName |
( |
const String & |
username_ | ) |
|
Add a user for this query (as alternative role)
- Parameters
-
[in] | username_ | an alternative name of a user for the evaluation of this query |
- Note
- the user restriction applies if no user role specified in the query is allowed to see the document.
void net::strus::api::Query::defineDocFieldFeature |
( |
const String & |
set_, |
|
|
const String & |
metadataStart, |
|
|
const String & |
metadataEnd |
|
) |
| |
Define a posting iterator describing a document field addressable as feature.
- Parameters
-
[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 net::strus::api::Query::defineFeature |
( |
const String & |
set_, |
|
|
const QueryExpression & |
expr_, |
|
|
double |
weight_ = 1.0 |
|
) |
| |
Create a feature from the query expression passed.
- Parameters
-
[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 net::strus::api::Query::defineGlobalStatistics |
( |
const GlobalStatistics & |
stats_ | ) |
|
Define the global statistics to use for weighting in this query.
- Parameters
-
[in] | stats_ | the structure with the statistics to set |
void net::strus::api::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.
- Parameters
-
[in] | type_ | query term type name |
[in] | value_ | query term value |
[in] | stats_ | the structure with the statistics to set |
Evaluate this query and return the result.
- Returns
- the result
void net::strus::api::Query::setMaxNofRanks |
( |
unsigned int |
maxNofRanks_ | ) |
|
Set number of ranks to evaluate starting with the first rank (the maximum size of the result rank list)
- Parameters
-
[in] | maxNofRanks_ | maximum number of results to return by this query |
void net::strus::api::Query::setMinRank |
( |
unsigned int |
minRank_ | ) |
|
Set the index of the first rank to be returned.
- Parameters
-
[in] | minRank_ | index of the first rank to be returned by this query |
Assign values to variables of the weighting formula.
- Parameters
-
[in] | parameter | parameter values |
String net::strus::api::Query::tostring |
( |
| ) |
const |
Map the contents of the query to a readable string.
- Returns
- the string
The documentation for this class was generated from the following file: