strus  0.17
queryEvalInterface.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_QUERY_EVAL_INTERFACE_HPP_INCLUDED
11 #define _STRUS_QUERY_EVAL_INTERFACE_HPP_INCLUDED
12 #include <iostream>
13 #include <vector>
14 
15 namespace strus
16 {
18 class QueryInterface;
20 class StorageClientInterface;
22 class WeightingFunctionInstanceInterface;
24 class SummarizerFunctionInstanceInterface;
26 class ScalarFunctionInterface;
28 class QueryProcessorInterface;
29 
32 {
33 public:
35  virtual ~QueryEvalInterface(){}
36 
42  virtual void addTerm(
43  const std::string& set_,
44  const std::string& type_,
45  const std::string& value_)=0;
46 
50  virtual void addSelectionFeature( const std::string& set_)=0;
51 
54  virtual void addRestrictionFeature( const std::string& set_)=0;
55 
58  virtual void addExclusionFeature( const std::string& set_)=0;
59 
62  virtual std::vector<std::string> getWeightingFeatureSets() const=0;
63 
66  virtual std::vector<std::string> getSelectionFeatureSets() const=0;
67 
70  virtual std::vector<std::string> getRestrictionFeatureSets() const=0;
71 
74  virtual std::vector<std::string> getExclusionFeatureSets() const=0;
75 
79  {
80  public:
82  const std::string& parameterName_,
83  const std::string& featureSet_)
84  :m_parameterName(parameterName_),m_featureSet(featureSet_){}
86  const FeatureParameter& o)
87  :m_parameterName(o.m_parameterName),m_featureSet(o.m_featureSet){}
88 
89  const std::string& parameterName() const {return m_parameterName;}
90  const std::string& featureSet() const {return m_featureSet;}
91 
92  private:
93  std::string m_parameterName;
94  std::string m_featureSet;
95  };
96 
102  virtual void addSummarizerFunction(
103  const std::string& functionName,
105  const std::vector<FeatureParameter>& featureParameters,
106  const std::string& debugAttributeName=std::string())=0;
107 
113  virtual void addWeightingFunction(
114  const std::string& functionName,
116  const std::vector<FeatureParameter>& featureParameters,
117  const std::string& debugAttributeName=std::string())=0;
118 
122  virtual void defineWeightingFormula(
123  ScalarFunctionInterface* combinefunc)=0;
124 
128  virtual QueryInterface* createQuery(
129  const StorageClientInterface* storage) const=0;
130 };
131 
132 }//namespace
133 #endif
134 
Interface of a strus IR storage.
Definition: storageClientInterface.hpp:52
Defines a query evaluation scheme.
Definition: queryEvalInterface.hpp:31
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 feat...
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.
Interface for a parameterized weighting function instance.
Definition: weightingFunctionInstanceInterface.hpp:29
virtual ~QueryEvalInterface()
Destructor.
Definition: queryEvalInterface.hpp:35
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.
virtual std::vector< std::string > getWeightingFeatureSets() const =0
Define a set of features to be used for weighting.
Structure that describes a feature that is subject of summarization or weighting. ...
Definition: queryEvalInterface.hpp:78
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 o...
Defines a strus information retrieval query.
Definition: queryInterface.hpp:29
virtual QueryInterface * createQuery(const StorageClientInterface *storage) const =0
Create a new query.
virtual void defineWeightingFormula(ScalarFunctionInterface *combinefunc)=0
Declare the scalar function to combine the weighting functions declared.
virtual void addSelectionFeature(const std::string &set_)=0
Declare a set of features to be used for selection (declare what documents to weight) ...
const std::string & parameterName() const
Definition: queryEvalInterface.hpp:89
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...
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.
FeatureParameter(const std::string &parameterName_, const std::string &featureSet_)
Definition: queryEvalInterface.hpp:81
FeatureParameter(const FeatureParameter &o)
Definition: queryEvalInterface.hpp:85
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 th...
const std::string & featureSet() const
Definition: queryEvalInterface.hpp:90
virtual std::vector< std::string > getSelectionFeatureSets() const =0
Define a set of features to be used as selection (declare what documents to weight) ...
Interface for a parameterized instance of summarization.
Definition: summarizerFunctionInstanceInterface.hpp:31
Interface for a scalar function type.
Definition: scalarFunctionInterface.hpp:24