Package org.apache.lucene.queries.spans
Class SpanNotQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.queries.spans.SpanQuery
org.apache.lucene.queries.spans.SpanNotQuery
Removes matches which overlap with another SpanQuery or which are within x tokens before or y
tokens after another SpanQuery.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassCreates SpanNotQuery scorer instances -
Constructor Summary
ConstructorsConstructorDescriptionSpanNotQuery(SpanQuery include, SpanQuery exclude) Construct a SpanNotQuery matching spans fromincludewhich have no overlap with spans fromexclude.SpanNotQuery(SpanQuery include, SpanQuery exclude, int dist) Construct a SpanNotQuery matching spans fromincludewhich have no overlap with spans fromexcludewithindisttokens ofinclude.SpanNotQuery(SpanQuery include, SpanQuery exclude, int pre, int post) Construct a SpanNotQuery matching spans fromincludewhich have no overlap with spans fromexcludewithinpretokens before orposttokens ofinclude. -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) booleanReturns true iffois equal to this.Return the SpanQuery whose matches must not overlap those returned.getField()Returns the name of the field matched by this query.Return the SpanQuery whose matches are filtered.inthashCode()rewrite(IndexSearcher indexSearcher) voidvisit(QueryVisitor visitor) Methods inherited from class org.apache.lucene.queries.spans.SpanQuery
getTermStates, getTermStatesMethods inherited from class org.apache.lucene.search.Query
classHash, sameClassAs, toString
-
Constructor Details
-
SpanNotQuery
Construct a SpanNotQuery matching spans fromincludewhich have no overlap with spans fromexclude. -
SpanNotQuery
Construct a SpanNotQuery matching spans fromincludewhich have no overlap with spans fromexcludewithindisttokens ofinclude. Inversely, a negativedistvalue may be used to specify a certain amount of allowable overlap. -
SpanNotQuery
Construct a SpanNotQuery matching spans fromincludewhich have no overlap with spans fromexcludewithinpretokens before orposttokens ofinclude. Inversely, negative values forpreand/orpostallow a certain amount of overlap to occur.
-
-
Method Details
-
getInclude
Return the SpanQuery whose matches are filtered. -
getExclude
Return the SpanQuery whose matches must not overlap those returned. -
getField
Description copied from class:SpanQueryReturns the name of the field matched by this query. -
toString
-
createWeight
public SpanWeight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException - Specified by:
createWeightin classSpanQuery- Throws:
IOException
-
rewrite
- Overrides:
rewritein classQuery- Throws:
IOException
-
visit
-
equals
Returns true iffois equal to this. -
hashCode
public int hashCode()
-