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
-
public final class SpanNotQuery extends SpanQuery
Removes matches which overlap with another SpanQuery or which are within x tokens before or y tokens after another SpanQuery.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSpanNotQuery.SpanNotWeightCreates SpanNotQuery scorer instances
-
Constructor Summary
Constructors Constructor Description SpanNotQuery(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpanWeightcreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)booleanequals(Object other)Returns true iffois equal to this.SpanQuerygetExclude()Return the SpanQuery whose matches must not overlap those returned.StringgetField()Returns the name of the field matched by this query.SpanQuerygetInclude()Return the SpanQuery whose matches are filtered.inthashCode()Queryrewrite(IndexSearcher indexSearcher)StringtoString(String field)voidvisit(QueryVisitor visitor)-
Methods inherited from class org.apache.lucene.queries.spans.SpanQuery
getTermStates, getTermStates
-
Methods inherited from class org.apache.lucene.search.Query
classHash, rewrite, sameClassAs, toString
-
-
-
-
Constructor Detail
-
SpanNotQuery
public SpanNotQuery(SpanQuery include, SpanQuery exclude)
Construct a SpanNotQuery matching spans fromincludewhich have no overlap with spans fromexclude.
-
SpanNotQuery
public SpanNotQuery(SpanQuery include, SpanQuery exclude, int dist)
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
public SpanNotQuery(SpanQuery include, SpanQuery exclude, int pre, int post)
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 Detail
-
getInclude
public SpanQuery getInclude()
Return the SpanQuery whose matches are filtered.
-
getExclude
public SpanQuery getExclude()
Return the SpanQuery whose matches must not overlap those returned.
-
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
-
rewrite
public Query rewrite(IndexSearcher indexSearcher) throws IOException
- Overrides:
rewritein classQuery- Throws:
IOException
-
visit
public void visit(QueryVisitor visitor)
-
equals
public boolean equals(Object other)
Returns true iffois equal to this.
-
-