Class SpanTermQuery
Matches spans containing a term.
Inherited Members
Namespace: Lucene.Net.Search.Spans
Assembly: Lucene.Net.dll
Syntax
public class SpanTermQuery : SpanQuery
Constructors
SpanTermQuery(Term)
Construct a SpanTermQuery matching the named term's spans.
Declaration
public SpanTermQuery(Term term)
Parameters
Type | Name | Description |
---|---|---|
Term | term |
Fields
m_term
Matches spans containing a term.
Declaration
protected Term m_term
Field Value
Type | Description |
---|---|
Term |
Properties
Field
Returns the name of the field matched by this query.
Note that this may returnnull
if the query matches no terms.
Declaration
public override string Field { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Term
Return the term whose spans are matched.
Declaration
public virtual Term Term { get; }
Property Value
Type | Description |
---|---|
Term |
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
ExtractTerms(ISet<Term>)
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
Type | Name | Description |
---|---|---|
ISet<Term> | terms |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | If this query is not yet rewritten |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
GetSpans(AtomicReaderContext, IBits, IDictionary<Term, TermContext>)
Expert: Returns the matches for this query in an index. Used internally to search for spans.
Declaration
public override Spans GetSpans(AtomicReaderContext context, IBits acceptDocs, IDictionary<Term, TermContext> termContexts)
Parameters
Type | Name | Description |
---|---|---|
AtomicReaderContext | context | |
IBits | acceptDocs | |
IDictionary<Term, TermContext> | termContexts |
Returns
Type | Description |
---|---|
Spans |
Overrides
ToString(string)
Prints a query to a string, with field
assumed to be the
default field and omitted.
Declaration
public override string ToString(string field)
Parameters
Type | Name | Description |
---|---|---|
string | field |
Returns
Type | Description |
---|---|
string |