Package org.apache.lucene.queries.spans
Class SpanTermQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.queries.spans.SpanQuery
org.apache.lucene.queries.spans.SpanTermQuery
Matches spans containing a term. This should not be used for terms that are indexed at position
Integer.MAX_VALUE.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Creates SpanTermQuery scorer instances -
Field Summary
-
Constructor Summary
ConstructorDescriptionSpanTermQuery
(Term term) Construct a SpanTermQuery matching the named term's spans.SpanTermQuery
(Term term, TermStates termStates) Expert: Construct a SpanTermQuery matching the named term's spans, using the provided TermStates -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight
(IndexSearcher searcher, ScoreMode scoreMode, float boost) boolean
getField()
Returns the name of the field matched by this query.getTerm()
Return the term whose spans are matched.Returns theTermStates
passed to the constructor, or null if it was not passed.int
hashCode()
void
visit
(QueryVisitor visitor) Methods inherited from class org.apache.lucene.queries.spans.SpanQuery
getTermStates, getTermStates
-
Field Details
-
term
-
termStates
-
-
Constructor Details
-
SpanTermQuery
Construct a SpanTermQuery matching the named term's spans. -
SpanTermQuery
Expert: Construct a SpanTermQuery matching the named term's spans, using the provided TermStates
-
-
Method Details
-
getTerm
Return the term whose spans are matched. -
getTermStates
Returns theTermStates
passed to the constructor, or null if it was not passed.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
getField
Description copied from class:SpanQuery
Returns the name of the field matched by this query. -
createWeight
public SpanWeight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException - Specified by:
createWeight
in classSpanQuery
- Throws:
IOException
-
visit
-
toString
-
hashCode
public int hashCode() -
equals
-