public abstract class BLSpanQuery
extends org.apache.lucene.search.spans.SpanQuery
Modifier and Type | Field and Description |
---|---|
static int |
MAX_UNLIMITED |
Constructor and Description |
---|
BLSpanQuery() |
Modifier and Type | Method and Description |
---|---|
static int |
addMaxValues(int a,
int b)
Add two values for maximum number of repetitions, taking "infinite" into
account.
|
boolean |
canInternalizeNeighbour(BLSpanQuery clause,
boolean onTheRight)
Can this query "internalize" the given neighbouring clause?
Internalizing means adding the clause to its children, which is often more
efficient because we create longer sequences that match fewer hits and may
themselves be further optimized.
|
boolean |
canMakeNfa() |
abstract BLSpanWeight |
createWeight(org.apache.lucene.search.IndexSearcher searcher,
boolean needsScores) |
static BLSpanQuery |
ensureSorted(BLSpanQuery spanQuery) |
static BLSpanQuery |
ensureSortedUnique(BLSpanQuery spanQuery) |
abstract boolean |
equals(Object obj) |
abstract int |
forwardMatchingCost()
Return an (very rough) indication of how expensive finding a match for this
query using an NFA would be.
|
String |
getField() |
Nfa |
getNfa(ForwardIndexAccessor fiAccessor,
int direction) |
NfaTwoWay |
getNfaTwoWay(ForwardIndexAccessor fiAccessor,
int nativeDirection) |
abstract String |
getRealField() |
abstract int |
hashCode() |
abstract boolean |
hitsAllSameLength()
Do our hits have constant length?
|
abstract boolean |
hitsAreUnique()
Is it guaranteed that no two hits have the same start and end position?
|
abstract boolean |
hitsEndPointSorted()
When hit B follows hit A, is it guaranteed that B.end >= A.end? Also, if
A.end == B.end, is B.start > A.start?
|
abstract boolean |
hitsHaveUniqueEnd()
Is it guaranteed that no two hits have the same end position?
|
abstract boolean |
hitsHaveUniqueStart()
Is it guaranteed that no two hits have the same start position?
|
abstract int |
hitsLengthMax()
How long could our longest hit be?
|
abstract int |
hitsLengthMin()
How long could our shortest hit be?
|
abstract boolean |
hitsStartPointSorted()
When hit B follows hit A, is it guaranteed that B.start >= A.start? Also,
if A.start == B.start, is B.end > A.end?
|
static String |
inf(int max) |
BLSpanQuery |
internalizeNeighbour(BLSpanQuery clause,
boolean onTheRight)
Internalize the given clause.
|
BLSpanQuery |
inverted()
Return an inverted version of this query.
|
boolean |
isSingleTokenNot()
Is this query only a negative clause, producing all tokens that don't satisfy
certain conditions?
Used for optimization decisions, i.e.
|
void |
log(LogLevel level,
String msg) |
boolean |
matchesEmptySequence()
Does this query match the empty sequence?
For example, the query [word="cow"]* matches the empty sequence.
|
BLSpanQuery |
optimize(org.apache.lucene.index.IndexReader reader)
Called before rewrite() to optimize certain parts of the query before they
are rewritten (e.g.
|
boolean |
producesSingleTokens()
Are all our hits single tokens?
|
abstract long |
reverseMatchingCost(org.apache.lucene.index.IndexReader reader)
Return an (very rough) indication of how many hits this clause might return.
|
abstract BLSpanQuery |
rewrite(org.apache.lucene.index.IndexReader reader) |
void |
setQueryInfo(QueryInfo queryInfo) |
abstract String |
toString(String field) |
static BLSpanQuery |
wrap(org.apache.lucene.search.spans.SpanQuery spanQuery)
Rewrite a SpanQuery after rewrite() to a BLSpanQuery equivalent.
|
public static final int MAX_UNLIMITED
public static BLSpanQuery wrap(org.apache.lucene.search.spans.SpanQuery spanQuery)
spanQuery
- the SpanQuery to BL-ify (if it isn't a BLSpanQuery already)public static int addMaxValues(int a, int b)
a
- first max. repetitions valueb
- first max. repetitions valuepublic static BLSpanQuery ensureSortedUnique(BLSpanQuery spanQuery)
public static BLSpanQuery ensureSorted(BLSpanQuery spanQuery)
public static String inf(int max)
public abstract String toString(String field)
toString
in class org.apache.lucene.search.Query
public abstract int hashCode()
hashCode
in class org.apache.lucene.search.Query
public abstract boolean equals(Object obj)
equals
in class org.apache.lucene.search.Query
public BLSpanQuery optimize(org.apache.lucene.index.IndexReader reader) throws IOException
reader
- index readerIOException
- on errorpublic abstract BLSpanQuery rewrite(org.apache.lucene.index.IndexReader reader) throws IOException
rewrite
in class org.apache.lucene.search.spans.SpanQuery
IOException
public abstract BLSpanWeight createWeight(org.apache.lucene.search.IndexSearcher searcher, boolean needsScores) throws IOException
createWeight
in class org.apache.lucene.search.spans.SpanQuery
IOException
public boolean matchesEmptySequence()
public BLSpanQuery inverted()
public boolean isSingleTokenNot()
public boolean producesSingleTokens()
public abstract boolean hitsAllSameLength()
public abstract int hitsLengthMin()
public abstract int hitsLengthMax()
public abstract boolean hitsEndPointSorted()
public abstract boolean hitsStartPointSorted()
public abstract boolean hitsHaveUniqueStart()
public abstract boolean hitsHaveUniqueEnd()
public abstract boolean hitsAreUnique()
public boolean canInternalizeNeighbour(BLSpanQuery clause, boolean onTheRight)
clause
- clause we want to internalizeonTheRight
- if true, clause is a right neighbour of this query; if
false, a left neighbourpublic BLSpanQuery internalizeNeighbour(BLSpanQuery clause, boolean onTheRight)
clause
- clause we want to internalizeonTheRight
- if true, clause is a right neighbour of this query; if
false, a left neighbourpublic Nfa getNfa(ForwardIndexAccessor fiAccessor, int direction)
public boolean canMakeNfa()
public NfaTwoWay getNfaTwoWay(ForwardIndexAccessor fiAccessor, int nativeDirection)
public abstract long reverseMatchingCost(org.apache.lucene.index.IndexReader reader)
reader
- the index readerpublic abstract int forwardMatchingCost()
public String getField()
getField
in class org.apache.lucene.search.spans.SpanQuery
public abstract String getRealField()
public void setQueryInfo(QueryInfo queryInfo)
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.