CLucene - a full-featured, c++ search engine
API Documentation
#include <FuzzyQuery.h>
Public Member Functions | |
FuzzyQuery (lucene::index::Term *term, float_t minimumSimilarity=defaultMinSimilarity, size_t prefixLength=0) | |
Create a new FuzzyQuery that will match terms with a similarity of at least minimumSimilarity to term . | |
~FuzzyQuery () | |
TCHAR * | toString (const TCHAR *field) const |
Prints a user-readable version of this query. | |
const TCHAR * | getQueryName () const |
Query * | clone () const |
Returns a clone of this query. | |
bool | equals (Query *other) const |
size_t | hashCode () const |
float_t | getMinSimilarity () const |
Returns the minimum similarity that is required for this query to match. | |
size_t | getPrefixLength () const |
Returns the prefix length, i.e. | |
Static Public Member Functions | |
static const TCHAR * | getClassName () |
Static Public Attributes | |
static float_t | defaultMinSimilarity |
static int32_t | defaultPrefixLength |
Protected Member Functions | |
FuzzyQuery (const FuzzyQuery &clone) | |
FilteredTermEnum * | getEnum (lucene::index::IndexReader *reader) |
Construct the enumeration to be used, expanding the pattern term. |
lucene::search::FuzzyQuery::FuzzyQuery | ( | const FuzzyQuery & | clone | ) | [protected] |
lucene::search::FuzzyQuery::FuzzyQuery | ( | lucene::index::Term * | term, | |
float_t | minimumSimilarity = defaultMinSimilarity , |
|||
size_t | prefixLength = 0 | |||
) |
Create a new FuzzyQuery that will match terms with a similarity of at least minimumSimilarity
to term
.
If a prefixLength
> 0 is specified, a common prefix of that length is also required.
term | the term to search for | |
minimumSimilarity | a value between 0 and 1 to set the required similarity between the query term and the matching terms. For example, for a minimumSimilarity of 0.5 a term of the same length as the query term is considered similar to the query term if the edit distance between both terms is less than length(term)*0.5 | |
prefixLength | length of common (non-fuzzy) prefix |
IllegalArgumentException | if minimumSimilarity is > 1 or < 0 or if prefixLength < 0 or > term.text().length() . |
lucene::search::FuzzyQuery::~FuzzyQuery | ( | ) |
TCHAR* lucene::search::FuzzyQuery::toString | ( | const TCHAR * | field | ) | const [virtual] |
static const TCHAR* lucene::search::FuzzyQuery::getClassName | ( | ) | [static] |
const TCHAR* lucene::search::FuzzyQuery::getQueryName | ( | ) | const [virtual] |
Implements lucene::search::Query.
Query* lucene::search::FuzzyQuery::clone | ( | ) | const [virtual] |
bool lucene::search::FuzzyQuery::equals | ( | Query * | other | ) | const [virtual] |
Implements lucene::search::Query.
size_t lucene::search::FuzzyQuery::hashCode | ( | ) | const [virtual] |
Implements lucene::search::Query.
float_t lucene::search::FuzzyQuery::getMinSimilarity | ( | ) | const |
Returns the minimum similarity that is required for this query to match.
size_t lucene::search::FuzzyQuery::getPrefixLength | ( | ) | const |
Returns the prefix length, i.e.
the number of characters at the start of a term that must be identical (not fuzzy) to the query term if the query is to match that term.
FilteredTermEnum* lucene::search::FuzzyQuery::getEnum | ( | lucene::index::IndexReader * | reader | ) | [protected, virtual] |
Construct the enumeration to be used, expanding the pattern term.
Implements lucene::search::MultiTermQuery.
float_t lucene::search::FuzzyQuery::defaultMinSimilarity [static] |
int32_t lucene::search::FuzzyQuery::defaultPrefixLength [static] |