Class TermQuery
A Query that matches documents containing a term.
this may be combined with other terms with a BooleanQuery.
Assembly: Lucene.Net.dll
Syntax
public class TermQuery : Query
Constructors
TermQuery(Term)
Constructs a query for the term t
.
Declaration
Parameters
Type |
Name |
Description |
Term |
t |
|
TermQuery(Term, TermContext)
Expert: constructs a TermQuery that will use the
provided docFreq instead of looking up the docFreq
against the searcher.
Declaration
public TermQuery(Term t, TermContext states)
Parameters
TermQuery(Term, int)
Expert: constructs a TermQuery that will use the
provided docFreq
instead of looking up the docFreq
against the searcher.
Declaration
public TermQuery(Term t, int docFreq)
Parameters
Type |
Name |
Description |
Term |
t |
|
int |
docFreq |
|
Properties
Term
Returns the term of this query.
Declaration
public virtual Term Term { get; }
Property Value
Methods
CreateWeight(IndexSearcher)
Expert: Constructs an appropriate Weight implementation for this query.
Only implemented by primitive queries, which re-write to themselves.
Declaration
public override Weight CreateWeight(IndexSearcher searcher)
Parameters
Returns
Overrides
Equals(object)
Returns true
if o
is equal to this.
Declaration
public override bool Equals(object o)
Parameters
Type |
Name |
Description |
object |
o |
|
Returns
Overrides
Expert: adds all terms occurring in this query to the terms set. Only
works if this query is in its rewritten (Rewrite(IndexReader)) form.
Declaration
public override void ExtractTerms(ISet<Term> terms)
Parameters
Overrides
Exceptions
GetHashCode()
Returns a hash code value for this object.
Declaration
public override int GetHashCode()
Returns
Overrides
ToString(string)
Prints a user-readable version of this query.
Declaration
public override string ToString(string field)
Parameters
Type |
Name |
Description |
string |
field |
|
Returns
Overrides