Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Classes | Public Member Functions | List of all members
Lucene.Net.Search.FuzzyLikeThisQuery Class Reference

Fuzzifies ALL terms provided as strings and then picks the best n differentiating terms. In effect this mixes the behaviour of FuzzyQuery and MoreLikeThis but with special consideration of fuzzy scoring factors. This generally produces good results for queries where users may provide details in a number of fields and have no knowledge of boolean query syntax and also want a degree of fuzzy matching and a fast query. More...

Inherits Lucene.Net.Search.Query.

Public Member Functions

override int GetHashCode ()
 
override bool Equals (Object obj)
 
 FuzzyLikeThisQuery (int maxNumTerms, Analyzer analyzer)
 
void AddTerms (String queryString, String fieldName, float minSimilarity, int prefixLength)
 
override Query Rewrite (IndexReader reader)
 Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.
 
override String ToString (String field)
 
bool IsIgnoreTF ()
 
void SetIgnoreTF (bool ignoreTF)
 
- Public Member Functions inherited from Lucene.Net.Search.Query
abstract System.String ToString (System.String field)
 Prints a query to a string, with field assumed to be the default field and omitted. The representation used is one that is supposed to be readable by QueryParser. However, there are the following limitations:

  • If the query was created by the parser, the printed representation may not be exactly what was parsed. For example, characters that need to be escaped will be represented without the required backslash.
  • Some of the more complicated queries (e.g. span queries) don't have a representation that can be parsed by QueryParser.

 
override System.String ToString ()
 Prints a query to a string.
 
virtual Weight CreateWeight (Searcher searcher)
 Expert: Constructs an appropriate Weight implementation for this query.
 
virtual Weight Weight (Searcher searcher)
 Expert: Constructs and initializes a Weight for a top-level query.
 
virtual Query Combine (Query[] queries)
 Expert: called when re-writing queries under MultiSearcher.
 
virtual void ExtractTerms (System.Collections.Generic.ISet< Term > terms)
 Expert: adds all terms occuring in this query to the terms set. Only works if this query is in its rewritten form.
 
virtual Similarity GetSimilarity (Searcher searcher)
 Expert: Returns the Similarity implementation to be used for this query. Subclasses may override this method to specify their own Similarity implementation, perhaps one that delegates through that of the Searcher. By default the Searcher's Similarity implementation is returned.
 
virtual System.Object Clone ()
 Returns a clone of this query.
 
override int GetHashCode ()
 
override bool Equals (System.Object obj)
 

Additional Inherited Members

- Static Public Member Functions inherited from Lucene.Net.Search.Query
static Query MergeBooleanQueries (params BooleanQuery[] queries)
 Expert: merges the clauses of a set of BooleanQuery's into a single BooleanQuery.
 
- Properties inherited from Lucene.Net.Search.Query
virtual float Boost [get, set]
 Gets or sets the boost for this query clause to b. Documents matching this clause will (in addition to the normal weightings) have their score multiplied by b. The boost is 1.0 by default.
 

Detailed Description

Fuzzifies ALL terms provided as strings and then picks the best n differentiating terms. In effect this mixes the behaviour of FuzzyQuery and MoreLikeThis but with special consideration of fuzzy scoring factors. This generally produces good results for queries where users may provide details in a number of fields and have no knowledge of boolean query syntax and also want a degree of fuzzy matching and a fast query.

For each source term the fuzzy variants are held in a BooleanQuery with no coord factor (because we are not looking for matches on multiple variants in any one doc). Additionally, a specialized TermQuery is used for variants and does not use that variant term's IDF because this would favour rarer terms eg misspellings. Instead, all variants use the same IDF ranking (the one for the source query term) and this is factored into the variant's boost. If the source query term does not exist in the index the average IDF of the variants is used.

Definition at line 48 of file FuzzyLikeThisQuery.cs.

Constructor & Destructor Documentation

Lucene.Net.Search.FuzzyLikeThisQuery.FuzzyLikeThisQuery ( int  maxNumTerms,
Analyzer  analyzer 
)

Definition at line 108 of file FuzzyLikeThisQuery.cs.

Member Function Documentation

void Lucene.Net.Search.FuzzyLikeThisQuery.AddTerms ( String  queryString,
String  fieldName,
float  minSimilarity,
int  prefixLength 
)

Definition at line 184 of file FuzzyLikeThisQuery.cs.

override bool Lucene.Net.Search.FuzzyLikeThisQuery.Equals ( Object  obj)

Definition at line 72 of file FuzzyLikeThisQuery.cs.

override int Lucene.Net.Search.FuzzyLikeThisQuery.GetHashCode ( )

Definition at line 60 of file FuzzyLikeThisQuery.cs.

bool Lucene.Net.Search.FuzzyLikeThisQuery.IsIgnoreTF ( )

Definition at line 410 of file FuzzyLikeThisQuery.cs.

override Query Lucene.Net.Search.FuzzyLikeThisQuery.Rewrite ( IndexReader  reader)
virtual

Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.

Reimplemented from Lucene.Net.Search.Query.

Definition at line 257 of file FuzzyLikeThisQuery.cs.

void Lucene.Net.Search.FuzzyLikeThisQuery.SetIgnoreTF ( bool  ignoreTF)

Definition at line 416 of file FuzzyLikeThisQuery.cs.

override String Lucene.Net.Search.FuzzyLikeThisQuery.ToString ( String  field)

Definition at line 404 of file FuzzyLikeThisQuery.cs.


The documentation for this class was generated from the following file: