public final class SpanNotQuery extends SpanQuery
| Modifier and Type | Class and Description |
|---|---|
class |
SpanNotQuery.SpanNotWeight |
| Modifier and Type | Field and Description |
|---|---|
private SpanQuery |
exclude |
private SpanQuery |
include |
private int |
post |
private int |
pre |
| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
SpanWeight |
createWeight(IndexSearcher searcher,
boolean needsScores)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(java.lang.Object other)
Returns true iff
o is equal to this. |
private boolean |
equalsTo(SpanNotQuery other) |
SpanQuery |
getExclude()
Return the SpanQuery whose matches must not overlap those returned.
|
java.lang.String |
getField()
Returns the name of the field matched by this query.
|
SpanQuery |
getInclude()
Return the SpanQuery whose matches are filtered.
|
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
Query |
rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
|
java.lang.String |
toString(java.lang.String field)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
getTermContexts, getTermContextsclassHash, sameClassAs, toStringprivate SpanQuery include
private SpanQuery exclude
private final int pre
private final int post
public SpanNotQuery(SpanQuery include, SpanQuery exclude)
include which
have no overlap with spans from exclude.public SpanNotQuery(SpanQuery include, SpanQuery exclude, int dist)
include which
have no overlap with spans from exclude within
dist tokens of include.public SpanQuery getInclude()
public SpanQuery getExclude()
public java.lang.String getField()
SpanQuerypublic java.lang.String toString(java.lang.String field)
Queryfield assumed to be the
default field and omitted.public SpanWeight createWeight(IndexSearcher searcher, boolean needsScores) throws java.io.IOException
QueryOnly implemented by primitive queries, which re-write to themselves.
createWeight in class SpanQueryneedsScores - True if document scores (Scorer.score()) or match
frequencies (Scorer.freq()) are needed.java.io.IOExceptionpublic Query rewrite(IndexReader reader) throws java.io.IOException
Querypublic boolean equals(java.lang.Object other)
o is equal to this.equals in class QueryQuery.sameClassAs(Object),
Query.classHash()private boolean equalsTo(SpanNotQuery other)
public int hashCode()
QueryQueryCache works properly.hashCode in class QueryQuery.equals(Object)