public class SpanQueryPositionFilter extends BLSpanQuery
Modifier and Type | Class and Description |
---|---|
static class |
SpanQueryPositionFilter.Operation
The different positional operations
|
Modifier and Type | Field and Description |
---|---|
protected String |
baseFieldName
The field name for this query.
|
protected List<BLSpanQuery> |
clauses |
protected String |
luceneFieldName |
MAX_UNLIMITED
Constructor and Description |
---|
SpanQueryPositionFilter(BLSpanQuery producer,
BLSpanQuery filter,
SpanQueryPositionFilter.Operation op,
boolean invert)
Produce hits that match filter hits.
|
SpanQueryPositionFilter(BLSpanQuery producer,
BLSpanQuery filter,
SpanQueryPositionFilter.Operation op,
boolean invert,
int leftAdjust,
int rightAdjust)
Produce hits that match filter hits.
|
Modifier and Type | Method and Description |
---|---|
void |
adjustLeft(int delta)
Adjust the left edge of the producer hits for matching only.
|
void |
adjustRight(int delta)
Adjust the right edge of the producer hits for matching only.
|
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.
|
String |
clausesToString(String field) |
SpanQueryPositionFilter |
copy() |
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.
|
String |
getField()
Returns the name of the search field.
|
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?
|
BLSpanQuery |
internalizeNeighbour(BLSpanQuery clause,
boolean addToRight)
Internalize the given clause.
|
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, canMakeNfa, ensureSorted, ensureSortedUnique, getNfa, getNfaTwoWay, inf, inverted, isSingleTokenNot, log, optimize, producesSingleTokens, wrap
protected String baseFieldName
protected String luceneFieldName
protected List<BLSpanQuery> clauses
public SpanQueryPositionFilter(BLSpanQuery producer, BLSpanQuery filter, SpanQueryPositionFilter.Operation op, boolean invert)
producer
- hits we may be interested infilter
- how we determine what producer hits we're interested inop
- operation used to determine what producer hits we're interested in
(containing, within, startsat, endsat)invert
- produce hits that don't match filter instead?public SpanQueryPositionFilter(BLSpanQuery producer, BLSpanQuery filter, SpanQueryPositionFilter.Operation op, boolean invert, int leftAdjust, int rightAdjust)
producer
- hits we may be interested infilter
- how we determine what producer hits we're interested inop
- operation used to determine what producer hits we're interested in
(containing, within, startsat, endsat)invert
- produce hits that don't match filter instead?leftAdjust
- how to adjust the left edge of the producer hits while
matchingrightAdjust
- how to adjust the right edge of the producer hits while
matchingpublic 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 SpanQueryPositionFilter copy()
public void adjustLeft(int delta)
delta
- how to adjust the edgepublic void adjustRight(int delta)
delta
- how to adjust the edgepublic 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 boolean canInternalizeNeighbour(BLSpanQuery clause, boolean onTheRight)
BLSpanQuery
canInternalizeNeighbour
in class BLSpanQuery
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 addToRight)
BLSpanQuery
internalizeNeighbour
in class BLSpanQuery
clause
- clause we want to internalizeaddToRight
- if true, clause is a right neighbour of this query; if
false, a left neighbourpublic 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.