Methods Summary |
---|
public int | getEnd()Return the maximum end position permitted in a match. return end;
|
public java.lang.String | getField() return match.getField();
|
public org.apache.lucene.search.spans.SpanQuery | getMatch()Return the SpanQuery whose matches are filtered. return match;
|
public org.apache.lucene.search.spans.Spans | getSpans(org.apache.lucene.index.IndexReader reader)
return new Spans() {
private Spans spans = match.getSpans(reader);
public boolean next() throws IOException {
while (spans.next()) { // scan to next match
if (end() <= end)
return true;
}
return false;
}
public boolean skipTo(int target) throws IOException {
if (!spans.skipTo(target))
return false;
if (spans.end() <= end) // there is a match
return true;
return next(); // scan to next match
}
public int doc() { return spans.doc(); }
public int start() { return spans.start(); }
public int end() { return spans.end(); }
public String toString() {
return "spans(" + SpanFirstQuery.this.toString() + ")";
}
};
|
public java.util.Collection | getTerms() return match.getTerms();
|
public java.lang.String | toString(java.lang.String field)
StringBuffer buffer = new StringBuffer();
buffer.append("spanFirst(");
buffer.append(match.toString(field));
buffer.append(", ");
buffer.append(end);
buffer.append(")");
return buffer.toString();
|