# Uses of Class
org.apache.lucene.queries.spans.SpanQuery

Packages that use SpanQuery
Package
Description
org.apache.lucene.queries.payloads
The payloads package provides Query mechanisms for finding and using payloads.
org.apache.lucene.queries.spans
The calculus of spans.

## Uses of SpanQuery in org.apache.lucene.queries.payloads

Subclasses of SpanQuery in org.apache.lucene.queries.payloads
Modifier and Type
Class
Description
`class`
`PayloadScoreQuery`
A Query class that uses a `PayloadFunction` to modify the score of a wrapped `SpanQuery`.
`class`
`SpanPayloadCheckQuery`
Only return those matches that have a specific payload at the given position.
Fields in org.apache.lucene.queries.payloads declared as SpanQuery
Modifier and Type
Field
Description
`protected final SpanQuery`
SpanPayloadCheckQuery.`match`
Constructors in org.apache.lucene.queries.payloads with parameters of type SpanQuery
Modifier
Constructor
Description
``
`PayloadScoreQuery(SpanQuery wrappedQuery, PayloadFunction function, PayloadDecoder decoder)`
Creates a new PayloadScoreQuery that includes the underlying span scores
``
`PayloadScoreQuery(SpanQuery wrappedQuery, PayloadFunction function, PayloadDecoder decoder, boolean includeSpanScore)`
Creates a new PayloadScoreQuery
``
`SpanPayloadCheckQuery(SpanQuery match, List<BytesRef> payloadToMatch)`
``
`SpanPayloadCheckQuery(SpanQuery match, List<BytesRef> payloadToMatch, SpanPayloadCheckQuery.PayloadType payloadType, SpanPayloadCheckQuery.MatchOperation operation)`

## Uses of SpanQuery in org.apache.lucene.queries.spans

Subclasses of SpanQuery in org.apache.lucene.queries.spans
Modifier and Type
Class
Description
`final class`
`FieldMaskingSpanQuery`
Wrapper to allow `SpanQuery` objects participate in composite single-field SpanQueries by 'lying' about their search field.
`final class`
`SpanContainingQuery`
Keep matches that contain another SpanScorer.
`class`
`SpanFirstQuery`
Matches spans near the beginning of a field.
`class`
`SpanMultiTermQueryWrapper<Q extends MultiTermQuery>`
Wraps any `MultiTermQuery` as a `SpanQuery`, so it can be nested within other SpanQuery classes.
`class`
`SpanNearQuery`
Matches spans which are near one another.
`final class`
`SpanNotQuery`
Removes matches which overlap with another SpanQuery or which are within x tokens before or y tokens after another SpanQuery.
`final class`
`SpanOrQuery`
Matches the union of its clauses.
`class`
`SpanPositionCheckQuery`
Base class for filtering a SpanQuery based on the position of a match.
`class`
`SpanPositionRangeQuery`
Checks to see if the `SpanPositionCheckQuery.getMatch()` lies between a start and end position
`class`
`SpanTermQuery`
Matches spans containing a term.
`final class`
`SpanWithinQuery`
Keep matches that are contained within another Spans.
Fields in org.apache.lucene.queries.spans declared as SpanQuery
Modifier and Type
Field
Description
`protected SpanQuery`
SpanPositionCheckQuery.`match`
Fields in org.apache.lucene.queries.spans with type parameters of type SpanQuery
Modifier and Type
Field
Description
`protected List<SpanQuery>`
SpanNearQuery.`clauses`
Methods in org.apache.lucene.queries.spans that return SpanQuery
Modifier and Type
Method
Description
`SpanQuery[]`
SpanNearQuery.`getClauses()`
Return the clauses whose spans are matched.
`SpanQuery[]`
SpanOrQuery.`getClauses()`
Return the clauses whose spans are matched.
`SpanQuery`
SpanNotQuery.`getExclude()`
Return the SpanQuery whose matches must not overlap those returned.
`SpanQuery`
SpanNotQuery.`getInclude()`
Return the SpanQuery whose matches are filtered.
`SpanQuery`
FieldMaskingSpanQuery.`getMaskedQuery()`
`SpanQuery`
SpanPositionCheckQuery.`getMatch()`
`abstract SpanQuery`
SpanMultiTermQueryWrapper.SpanRewriteMethod.`rewrite(IndexSearcher indexSearcher, MultiTermQuery query)`
`SpanQuery`
SpanMultiTermQueryWrapper.TopTermsSpanBooleanQueryRewrite.`rewrite(IndexSearcher indexSearcher, MultiTermQuery query)`
Methods in org.apache.lucene.queries.spans with parameters of type SpanQuery
Modifier and Type
Method
Description
`SpanNearQuery.Builder`
SpanNearQuery.Builder.`addClause(SpanQuery clause)`
Add a new clause
Constructors in org.apache.lucene.queries.spans with parameters of type SpanQuery
Modifier
Constructor
Description
``
`FieldMaskingSpanQuery(SpanQuery maskedQuery, String maskedField)`
``
`SpanContainingQuery(SpanQuery big, SpanQuery little)`
Construct a SpanContainingQuery matching spans from `big` that contain at least one spans from `little`.
``
`SpanFirstQuery(SpanQuery match, int end)`
Construct a SpanFirstQuery matching spans in `match` whose end position is less than or equal to `end`.
``
`SpanNearQuery(SpanQuery[] clausesIn, int slop, boolean inOrder)`
Construct a SpanNearQuery.
``
`SpanNotQuery(SpanQuery include, SpanQuery exclude)`
Construct a SpanNotQuery matching spans from `include` which have no overlap with spans from `exclude`.
``
`SpanNotQuery(SpanQuery include, SpanQuery exclude, int dist)`
Construct a SpanNotQuery matching spans from `include` which have no overlap with spans from `exclude` within `dist` tokens of `include`.
``
`SpanNotQuery(SpanQuery include, SpanQuery exclude, int pre, int post)`
Construct a SpanNotQuery matching spans from `include` which have no overlap with spans from `exclude` within `pre` tokens before or `post` tokens of `include`.
``
`SpanOrQuery(SpanQuery... clauses)`
Construct a SpanOrQuery merging the provided clauses.
``
`SpanPositionCheckQuery(SpanQuery match)`
``
`SpanPositionRangeQuery(SpanQuery match, int start, int end)`
``
`SpanWeight(SpanQuery query, IndexSearcher searcher, Map<Term,TermStates> termStates, float boost)`
Create a new SpanWeight
``
`SpanWithinQuery(SpanQuery big, SpanQuery little)`
Construct a SpanWithinQuery matching spans from `little` that are inside of `big`.