Analyzer object representing a set of function for transforming a field, the smallest unit in any query language, to a set of terms that can be used to build a query.
More...
#include <bindingObjects.hpp>
|
| QueryAnalyzer (const QueryAnalyzer &o) |
| Copy constructor. More...
|
|
| ~QueryAnalyzer () |
| Destructor. More...
|
|
void | addSearchIndexElement (const String &featureType, const String &fieldType, const Tokenizer &tokenizer, const NormalizerVector &normalizers) |
| Defines a search index element. More...
|
|
void | addSearchIndexElementFromPatternMatch (const std::string &type, const std::string &patternTypeName, const NormalizerVector &normalizers) |
| Defines a search index element from a pattern matching result. More...
|
|
void | addPatternLexem (const std::string &termtype, const std::string &fieldtype, const Tokenizer &tokenizer, const NormalizerVector &normalizers) |
| Declare an element to be used as lexem by post processing pattern matching but not put into the result of query analysis. More...
|
|
void | definePatternMatcherPostProc (const String &patternTypeName, const String &patternMatcherModule, const PatternMatcher &patterns) |
| Declare a pattern matcher on the query features after other query analysis. More...
|
|
void | definePatternMatcherPostProcFromFile (const String &patternTypeName, const String &patternMatcherModule, const String &serializedPatternFile) |
| Declare a pattern matcher on the query features after other query analysis. More...
|
|
TermVector | analyzeField (const String &fieldType, const String &fieldContent) |
| Tokenizes and normalizes a query field and creates some typed terms out of it according the definition of the field type given. More...
|
|
QueryAnalyzeContext | createContext () const |
| Creates a context for analyzing a multipart query. More...
|
|
Analyzer object representing a set of function for transforming a field, the smallest unit in any query language, to a set of terms that can be used to build a query.
strus::QueryAnalyzer::~QueryAnalyzer |
( |
| ) |
|
|
inline |
void strus::QueryAnalyzer::addPatternLexem |
( |
const std::string & |
termtype, |
|
|
const std::string & |
fieldtype, |
|
|
const Tokenizer & |
tokenizer, |
|
|
const NormalizerVector & |
normalizers |
|
) |
| |
Declare an element to be used as lexem by post processing pattern matching but not put into the result of query analysis.
- Parameters
-
[in] | termtype | term type name of the lexem to be feed to the pattern matching |
[in] | fieldtype | type of the field of this element in the query |
[in] | tokenizer | tokenizer function description to use for the features of this field type |
[in] | normalizers | list of normalizer function description to use for the features of this field type in the ascending order of appearance |
void strus::QueryAnalyzer::addSearchIndexElement |
( |
const String & |
featureType, |
|
|
const String & |
fieldType, |
|
|
const Tokenizer & |
tokenizer, |
|
|
const NormalizerVector & |
normalizers |
|
) |
| |
Defines a search index element.
- Parameters
-
[in] | featureType | element feature type created from this field type |
[in] | fieldType | name of the field type defined |
[in] | tokenizer | tokenizer function description to use for the features of this field type |
[in] | normalizers | list of normalizer function description to use for the features of this field type in the ascending order of appearance |
void strus::QueryAnalyzer::addSearchIndexElementFromPatternMatch |
( |
const std::string & |
type, |
|
|
const std::string & |
patternTypeName, |
|
|
const NormalizerVector & |
normalizers |
|
) |
| |
Defines a search index element from a pattern matching result.
- Parameters
-
[in] | type | element type created from this pattern match result type |
[in] | patternTypeName | name of the pattern match result item |
[in] | normalizers | list of normalizer functions |
TermVector strus::QueryAnalyzer::analyzeField |
( |
const String & |
fieldType, |
|
|
const String & |
fieldContent |
|
) |
| |
Tokenizes and normalizes a query field and creates some typed terms out of it according the definition of the field type given.
- Parameters
-
[in] | fieldType | name of the field type to use for analysis |
[in] | fieldContent | content string of the query field to analyze |
- Note
- This is a very simplistic method to analyze a query. For multi field queries the object QueryAnalyzeContext is more appropriate
Creates a context for analyzing a multipart query.
- Returns
- the queue
void strus::QueryAnalyzer::definePatternMatcherPostProc |
( |
const String & |
patternTypeName, |
|
|
const String & |
patternMatcherModule, |
|
|
const PatternMatcher & |
patterns |
|
) |
| |
Declare a pattern matcher on the query features after other query analysis.
- Parameters
-
[in] | patternTypeName | name of the type to assign to the pattern matching results |
[in] | patternMatcherModule | module id of pattern matcher to use (empty string for default) |
[in] | patterns | structure with all patterns |
void strus::QueryAnalyzer::definePatternMatcherPostProcFromFile |
( |
const String & |
patternTypeName, |
|
|
const String & |
patternMatcherModule, |
|
|
const String & |
serializedPatternFile |
|
) |
| |
Declare a pattern matcher on the query features after other query analysis.
- Parameters
-
[in] | patternTypeName | name of the type to assign to the pattern matching results |
[in] | patternMatcherModule | module id of pattern matcher to use (empty string for default) |
[in] | serializedPatternFile | path to file with serialized (binary) patterns |
The documentation for this class was generated from the following file: