Package org.apache.lucene.search.spans
Class SpanQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.spans.SpanQuery
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
FieldMaskingSpanQuery,SpanMultiTermQueryWrapper,SpanNearQuery,SpanNotQuery,SpanOrQuery,SpanPositionCheckQuery,SpanTermQuery
Base class for span-based queries.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight(IndexSearcher searcher) Expert: Constructs an appropriate Weight implementation for this query.abstract StringgetField()Returns the name of the field matched by this query.abstract SpansgetSpans(AtomicReaderContext context, Bits acceptDocs, Map<Term, TermContext> termContexts) Expert: Returns the matches for this query in an index.
-
Constructor Details
-
SpanQuery
public SpanQuery()
-
-
Method Details
-
getSpans
public abstract Spans getSpans(AtomicReaderContext context, Bits acceptDocs, Map<Term, TermContext> termContexts) throws IOExceptionExpert: Returns the matches for this query in an index. Used internally to search for spans.- Throws:
IOException
-
getField
Returns the name of the field matched by this query.Note that this may return null if the query matches no terms.
-
createWeight
Description copied from class:QueryExpert: Constructs an appropriate Weight implementation for this query.Only implemented by primitive queries, which re-write to themselves.
- Overrides:
createWeightin classQuery- Throws:
IOException
-