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 classSpanTermQuery.SpanTermWeightCreates SpanTermQuery scorer instances
-
Field Summary
Fields Modifier and Type Field Description protected Termtermprotected TermStatestermStates
-
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 SpanWeightcreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)booleanequals(Object other)StringgetField()Returns the name of the field matched by this query.TermgetTerm()Return the term whose spans are matched.TermStatesgetTermStates()Returns theTermStatespassed to the constructor, or null if it was not passed.inthashCode()StringtoString(String field)voidvisit(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 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
public String 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
public void visit(QueryVisitor visitor)
-
-