public class SpanQueryFiSeq extends BLSpanQuery
Modifier and Type | Field and Description |
---|---|
protected String |
baseFieldName
The field name for this query.
|
protected List<BLSpanQuery> |
clauses |
static int |
DIR_TO_LEFT |
static int |
DIR_TO_RIGHT |
protected String |
luceneFieldName |
MAX_UNLIMITED
Constructor and Description |
---|
SpanQueryFiSeq(BLSpanQuery anchor,
boolean startOfAnchor,
NfaTwoWay nfa,
BLSpanQuery nfaQuery,
int direction,
ForwardIndexAccessor fiAccessor) |
Modifier and Type | Method and Description |
---|---|
SpanQueryFiSeq |
appendNfa(BLSpanQuery originalQuery)
Append a new NFA fragment to (a copy of) our existing NFA, and return a new
SpanQueryFiSeq using it.
|
boolean |
canMakeNfa() |
String |
clausesToString(String field) |
BLSpanWeight |
createWeight(org.apache.lucene.search.IndexSearcher searcher,
boolean needsScores) |
boolean |
equals(Object o) |
int |
forwardMatchingCost()
Return an (very rough) indication of how expensive finding a match for this
query using an NFA would be.
|
int |
getDirection() |
ForwardIndexAccessor |
getFiAccessor() |
String |
getField()
Returns the name of the search field.
|
Nfa |
getNfa(ForwardIndexAccessor fiAccessor,
int direction) |
String |
getRealField() |
int |
hashCode() |
boolean |
hitsAllSameLength()
Do our hits have constant length?
|
boolean |
hitsAreUnique()
Is it guaranteed that no two hits have the same start and end position?
|
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?
|
boolean |
hitsHaveUniqueEnd()
Is it guaranteed that no two hits have the same end position?
|
boolean |
hitsHaveUniqueStart()
Is it guaranteed that no two hits have the same start position?
|
int |
hitsLengthMax()
How long could our longest hit be?
|
int |
hitsLengthMin()
How long could our shortest hit be?
|
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?
|
boolean |
matchesEmptySequence()
Does this query match the empty sequence?
For example, the query [word="cow"]* matches the empty sequence.
|
BLSpanQuery |
noEmpty()
Return a version of this clause that cannot match the empty sequence.
|
long |
reverseMatchingCost(org.apache.lucene.index.IndexReader reader)
Return an (very rough) indication of how many hits this clause might return.
|
BLSpanQuery |
rewrite(org.apache.lucene.index.IndexReader reader) |
protected List<BLSpanQuery> |
rewriteClauses(org.apache.lucene.index.IndexReader reader) |
void |
setQueryInfo(QueryInfo queryInfo) |
String |
toString(String field) |
addMaxValues, canInternalizeNeighbour, ensureSorted, ensureSortedUnique, getNfaTwoWay, inf, internalizeNeighbour, inverted, isSingleTokenNot, log, optimize, producesSingleTokens, wrap
public static final int DIR_TO_LEFT
public static final int DIR_TO_RIGHT
protected String baseFieldName
protected String luceneFieldName
protected List<BLSpanQuery> clauses
public SpanQueryFiSeq(BLSpanQuery anchor, boolean startOfAnchor, NfaTwoWay nfa, BLSpanQuery nfaQuery, int direction, ForwardIndexAccessor fiAccessor)
anchor
- hits to use as anchor to start NFA matchingstartOfAnchor
- if true, use the starts of anchor hits; if false, use
the endsnfa
- the NFA to use for matchingnfaQuery
- the query that generated the NFA, so we can still use its
guarantee methods for optimizationdirection
- the direction to match in (-1 = right-to-left, 1 =
left-to-right; use DIR_TO_RIGHT / DIR_TO_LEFT)fiAccessor
- maps between term strings and term indices for each
annotationpublic BLSpanQuery rewrite(org.apache.lucene.index.IndexReader reader) throws IOException
rewrite
in class BLSpanQuery
IOException
public BLSpanWeight createWeight(org.apache.lucene.search.IndexSearcher searcher, boolean needsScores) throws IOException
createWeight
in class BLSpanQuery
IOException
public String toString(String field)
toString
in class BLSpanQuery
public boolean matchesEmptySequence()
BLSpanQuery
matchesEmptySequence
in class BLSpanQuery
public BLSpanQuery noEmpty()
BLSpanQuery
public boolean hitsAllSameLength()
BLSpanQuery
hitsAllSameLength
in class BLSpanQuery
public int hitsLengthMin()
BLSpanQuery
hitsLengthMin
in class BLSpanQuery
public int hitsLengthMax()
BLSpanQuery
hitsLengthMax
in class BLSpanQuery
public boolean hitsStartPointSorted()
BLSpanQuery
hitsStartPointSorted
in class BLSpanQuery
public boolean hitsEndPointSorted()
BLSpanQuery
hitsEndPointSorted
in class BLSpanQuery
public boolean hitsHaveUniqueStart()
BLSpanQuery
hitsHaveUniqueStart
in class BLSpanQuery
public boolean hitsHaveUniqueEnd()
BLSpanQuery
hitsHaveUniqueEnd
in class BLSpanQuery
public boolean hitsAreUnique()
BLSpanQuery
hitsAreUnique
in class BLSpanQuery
public long reverseMatchingCost(org.apache.lucene.index.IndexReader reader)
BLSpanQuery
reverseMatchingCost
in class BLSpanQuery
reader
- the index readerpublic int forwardMatchingCost()
BLSpanQuery
forwardMatchingCost
in class BLSpanQuery
public int getDirection()
public SpanQueryFiSeq appendNfa(BLSpanQuery originalQuery)
originalQuery
- query that yielded this NFApublic ForwardIndexAccessor getFiAccessor()
public Nfa getNfa(ForwardIndexAccessor fiAccessor, int direction)
getNfa
in class BLSpanQuery
public boolean canMakeNfa()
canMakeNfa
in class BLSpanQuery
public boolean equals(Object o)
equals
in class BLSpanQuery
public int hashCode()
hashCode
in class BLSpanQuery
public String getField()
getField
in class BLSpanQuery
public String getRealField()
getRealField
in class BLSpanQuery
protected List<BLSpanQuery> rewriteClauses(org.apache.lucene.index.IndexReader reader) throws IOException
IOException
public void setQueryInfo(QueryInfo queryInfo)
setQueryInfo
in class BLSpanQuery
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.