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
Nested ClassesModifier and TypeClassDescriptionclassCreates SpanTermQuery scorer instances -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSpanTermQuery(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) booleangetField()Returns the name of the field matched by this query.getTerm()Return the term whose spans are matched.Returns theTermStatespassed to the constructor, or null if it was not passed.inthashCode()voidvisit(QueryVisitor visitor) Methods inherited from class org.apache.lucene.queries.spans.SpanQuery
getTermStates, getTermStatesMethods inherited from class org.apache.lucene.search.Query
classHash, rewrite, sameClassAs, toString
-
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 theTermStatespassed 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:SpanQueryReturns the name of the field matched by this query. -
createWeight
public SpanWeight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException - Specified by:
createWeightin classSpanQuery- Throws:
IOException
-
visit
-
toString
-
hashCode
public int hashCode() -
equals
-