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
-
public class SpanTermQuery extends SpanQuery
Matches spans containing a term. This should not be used for terms that are indexed at position Integer.MAX_VALUE.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SpanTermQuery.SpanTermWeight
Creates SpanTermQuery scorer instances
-
Field Summary
Fields Modifier and Type Field Description protected Term
term
protected TermStates
termStates
-
Constructor Summary
Constructors Constructor Description SpanTermQuery(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpanWeight
createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)
boolean
equals(Object other)
String
getField()
Returns the name of the field matched by this query.Term
getTerm()
Return the term whose spans are matched.TermStates
getTermStates()
Returns theTermStates
passed to the constructor, or null if it was not passed.int
hashCode()
String
toString(String field)
void
visit(QueryVisitor visitor)
-
Methods inherited from class org.apache.lucene.queries.spans.SpanQuery
getTermStates, getTermStates
-
-
-
-
Field Detail
-
term
protected final Term term
-
termStates
protected final TermStates termStates
-
-
Constructor Detail
-
SpanTermQuery
public SpanTermQuery(Term term)
Construct a SpanTermQuery matching the named term's spans.
-
SpanTermQuery
public SpanTermQuery(Term term, TermStates termStates)
Expert: Construct a SpanTermQuery matching the named term's spans, using the provided TermStates
-
-
Method Detail
-
getTerm
public Term getTerm()
Return the term whose spans are matched.
-
getTermStates
public TermStates 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
public String 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
public void visit(QueryVisitor visitor)
-
-