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.
|
MultiPhraseQuery is a generalized version of PhraseQuery, with an added method Add(Term[]). To use this class, to search for the phrase "Microsoft app*" first use add(Term) on the term "Microsoft", then find all terms that have "app" as prefix using IndexReader.terms(Term), and use MultiPhraseQuery.add(Term[] terms) to add them to the query. More...
Inherits Lucene.Net.Search.Query.
Public Member Functions | |
virtual void | Add (Term term) |
Add a single term at the next position in the phrase. | |
virtual void | Add (Term[] terms) |
Add multiple terms at the next position in the phrase. Any of the terms may match. | |
virtual void | Add (Term[] terms, int position) |
Allows to specify the relative position of terms within the phrase. | |
virtual System.Collections.Generic.IList < Term[]> | GetTermArrays () |
Returns a List<Term[]> of the terms in the multiphrase. Do not modify the List or its contents. | |
virtual int[] | GetPositions () |
Returns the relative positions of terms in this phrase. | |
override 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. | |
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 Weight | CreateWeight (Searcher searcher) |
Expert: Constructs an appropriate Weight implementation for this query. | |
override System.String | ToString (System.String f) |
Prints a user-readable version of this query. | |
override bool | Equals (System.Object o) |
Returns true if o is equal to this. | |
override int | GetHashCode () |
Returns a hash code value for this object. | |
Public Member Functions inherited from Lucene.Net.Search.Query | |
override System.String | ToString () |
Prints a query to a string. | |
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 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) |
Static Public Member Functions | |
static bool | TermEquals (System.Array array1, System.Array array2) |
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 | |
virtual int | Slop [get, set] |
Gets or sets the phrase slop for this query. | |
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. | |
MultiPhraseQuery is a generalized version of PhraseQuery, with an added method Add(Term[]). To use this class, to search for the phrase "Microsoft app*" first use add(Term) on the term "Microsoft", then find all terms that have "app" as prefix using IndexReader.terms(Term), and use MultiPhraseQuery.add(Term[] terms) to add them to the query.
<version> 1.0 </version>
Definition at line 40 of file MultiPhraseQuery.cs.
|
virtual |
Add a single term at the next position in the phrase.
Definition at line 60 of file MultiPhraseQuery.cs.
|
virtual |
Add multiple terms at the next position in the phrase. Any of the terms may match.
Definition at line 71 of file MultiPhraseQuery.cs.
|
virtual |
Allows to specify the relative position of terms within the phrase.
terms | |
position |
Definition at line 89 of file MultiPhraseQuery.cs.
Expert: Constructs an appropriate Weight implementation for this query.
Only implemented by primitive queries, which re-write to themselves.
Reimplemented from Lucene.Net.Search.Query.
Definition at line 309 of file MultiPhraseQuery.cs.
override bool Lucene.Net.Search.MultiPhraseQuery.Equals | ( | System.Object | o | ) |
Returns true if o
is equal to this.
Definition at line 370 of file MultiPhraseQuery.cs.
|
virtual |
Expert: adds all terms occuring in this query to the terms set. Only works if this query is in its rewritten form.
<throws> UnsupportedOperationException if this query is not yet rewritten </throws>
Reimplemented from Lucene.Net.Search.Query.
Definition at line 125 of file MultiPhraseQuery.cs.
override int Lucene.Net.Search.MultiPhraseQuery.GetHashCode | ( | ) |
Returns a hash code value for this object.
Definition at line 413 of file MultiPhraseQuery.cs.
|
virtual |
Returns the relative positions of terms in this phrase.
Definition at line 116 of file MultiPhraseQuery.cs.
|
virtual |
Returns a List<Term[]> of the terms in the multiphrase. Do not modify the List or its contents.
Definition at line 110 of file MultiPhraseQuery.cs.
|
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 289 of file MultiPhraseQuery.cs.
|
static |
Definition at line 472 of file MultiPhraseQuery.cs.
|
virtual |
Prints a user-readable version of this query.
Implements Lucene.Net.Search.Query.
Definition at line 315 of file MultiPhraseQuery.cs.
|
getset |
Gets or sets the phrase slop for this query.
Definition at line 52 of file MultiPhraseQuery.cs.