10 #ifndef _STRUS_QUERY_INTERFACE_HPP_INCLUDED
11 #define _STRUS_QUERY_INTERFACE_HPP_INCLUDED
15 #include "strus/numericVariant.hpp"
26 class PostingJoinOperatorInterface;
40 const std::string& type_,
41 const std::string& value_,
42 const Index& length_)=0;
49 const std::string& metadataRangeStart,
50 const std::string& metadataRangeEnd)=0;
60 unsigned int argc,
int range,
unsigned int cardinality)=0;
72 virtual void defineFeature(
const std::string& set_,
double weight_=1.0)=0;
79 const std::string& type_,
80 const std::string& value_,
97 const std::string& name,
98 const NumericVariant& operand,
99 bool newGroup=
true)=0;
104 const std::vector<Index>& docnolist_)=0;
108 virtual void addAccess(
const std::string& username_)=0;
115 virtual void setMinRank( std::size_t minRank_)=0;
132 virtual std::string
tostring()
const=0;
Result of a query evaluation.
int32_t Index
Number type generally used for locally counted indices.
Definition: index.hpp:29
virtual void defineGlobalStatistics(const GlobalStatistics &stats_)=0
Define the global statistics for the case that they are defined by the client.
virtual void addAccess(const std::string &username_)=0
Add a restriction for documents accessible by this query.
virtual void setMaxNofRanks(std::size_t maxNofRanks_)=0
Set the maximum number of ranks to evaluate starting with the minimum rank.
Client interface for accessing a storage (read/write)
virtual void setMinRank(std::size_t minRank_)=0
Set the minimum rank number to return.
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 repres...
virtual void setWeightingVariableValue(const std::string &name, double value)=0
Set the value of a variable in the weigthing formula defined with QueryEval::defineWeightingFormula(S...
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.
Defines a strus information retrieval query.
Definition: queryInterface.hpp:29
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 t...
virtual ~QueryInterface()
Destructor.
Definition: queryInterface.hpp:33
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.
virtual void pushTerm(const std::string &type_, const std::string &value_, const Index &length_)=0
Push a term to the query stack.
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.
virtual void attachVariable(const std::string &name_)=0
Attaches a variable to the top expression or term on the query stack.
Global term statistics, if passed down with the query.
Definition: termStatistics.hpp:16
Global document statistics, if passed down with the query.
Definition: globalStatistics.hpp:16
virtual QueryResult evaluate() const =0
Evaluate the query.
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 sy...
Structure defining the result of a strus query.
Definition: queryResult.hpp:22
Interface for creating iterators on joined sets of postings.
Definition: postingJoinOperatorInterface.hpp:23
virtual std::string tostring() const =0
Map query to readable string.
virtual void setDebugMode(bool debug)=0
Switch debug mode on or off (default off). In case of debug mode additional attributes defined with t...