true
.
*/
void setLowercaseExpandedTerms(bool lowercaseExpandedTerms);
/**
* @see #setLowercaseExpandedTerms(boolean)
*/
bool getLowercaseExpandedTerms() const;
//values used for setOperator
LUCENE_STATIC_CONSTANT(int, OR_OPERATOR=0);
LUCENE_STATIC_CONSTANT(int, AND_OPERATOR=1);
/**
* Sets the boolean operator of the QueryParser.
* In default mode (OR_OPERATOR
) terms without any modifiers
* are considered optional: for example capital of Hungary
is equal to
* capital OR of OR Hungary
.AND_OPERATOR
mode terms are considered to be in conjuction: the
* above mentioned query is parsed as capital AND of AND Hungary
*/
void setDefaultOperator(int oper);
/**
* Gets implicit operator setting, which will be either AND_OPERATOR
* or OR_OPERATOR.
*/
int getDefaultOperator() const;
//public so that the lexer can call this
virtual void throwParserException(const TCHAR* message, TCHAR ch, int32_t col, int32_t line );
/**
* Sets the default slop for phrases. If zero, then exact phrase matches
* are required. Default value is zero.
*/
void setPhraseSlop(int phraseSlop) { this->phraseSlop = phraseSlop; }
/**
* Gets the default slop for phrases.
*/
int getPhraseSlop() { return phraseSlop; }
protected:
/**
* Removes the escaped characters
*/
void discardEscapeChar(TCHAR* token) const;
//Analyzes the expanded term termStr with the StandardFilter and the LowerCaseFilter.
TCHAR* AnalyzeExpandedTerm(const TCHAR* field, TCHAR* termStr);
// Adds the next parsed clause.
virtual void AddClause(std::vector* Depending on settings, a prefix term may be lower-cased * automatically. It will not go through the default Analyzer, * however, since normal Analyzers are unlikely to work properly * with wildcard templates. *
* Can be overridden by extending classes, to provide custom handling for * wild card queries, which may be necessary due to missing analyzer calls. * * @param field Name of the field query will use. * @param termStr Term token to use for building term for the query * (without trailing '*' character!) * * @return Resulting {@link Query} built for the term * return NULL to disallow */ virtual CL_NS(search)::Query* GetPrefixQuery(const TCHAR* field, TCHAR* termStr); /** * Factory method for generating a query. Called when parser * parses an input term token that contains one or more wildcard * characters (? and *), but is not a prefix term token (one * that has just a single * character at the end) *
* Depending on settings, prefix term may be lower-cased * automatically. It will not go through the default Analyzer, * however, since normal Analyzers are unlikely to work properly * with wildcard templates. *
* Can be overridden by extending classes, to provide custom handling for
* wildcard queries, which may be necessary due to missing analyzer calls.
*
* @param field Name of the field query will use.
* @param termStr Term token that contains one or more wild card
* characters (? or *), but is not simple prefix term
*
* @return Resulting {@link Query} built for the term
* return NULL to disallow
*/
virtual CL_NS(search)::Query* GetWildcardQuery(const TCHAR* field, TCHAR* termStr);
/**
* Factory method for generating a query (similar to
* {@link #GetWildcardQuery}). Called when parser parses
* an input term token that has the fuzzy suffix (~) appended.
*
* @param field Name of the field query will use.
* @param termStr Term token to use for building term for the query
*
* @return Resulting {@link Query} built for the term
* return NULL to disallow
*/
virtual CL_NS(search)::Query* GetFuzzyQuery(const TCHAR* field, TCHAR* termStr);
/**
* Factory method for generating query, given a set of clauses.
* By default creates a boolean query composed of clauses passed in.
*
* Can be overridden by extending classes, to modify query being
* returned.
*
* @param clauses Vector that contains {@link BooleanClause} instances
* to join.
*
* @return Resulting {@link Query} object.
* return NULL to disallow
*
* Memory: clauses must all be cleaned up by this function.
*/
virtual CL_NS(search)::Query* GetBooleanQuery(std::vector