Methods Summary |
---|
public boolean | equals(java.lang.Object o)
if (this == o) return true;
if (!(o instanceof SpanFirstQuery)) return false;
SpanFirstQuery other = (SpanFirstQuery)o;
return this.end == other.end
&& this.match.equals(other.match)
&& this.getBoost() == other.getBoost();
|
public void | extractTerms(java.util.Set terms)
match.extractTerms(terms);
|
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()Returns a collection of all terms matched by this query. return match.getTerms();
|
public int | hashCode()
int h = match.hashCode();
h ^= (h << 8) | (h >>> 25); // reversible
h ^= Float.floatToRawIntBits(getBoost()) ^ end;
return h;
|
public org.apache.lucene.search.Query | rewrite(org.apache.lucene.index.IndexReader reader)
SpanFirstQuery clone = null;
SpanQuery rewritten = (SpanQuery) match.rewrite(reader);
if (rewritten != match) {
clone = (SpanFirstQuery) this.clone();
clone.match = rewritten;
}
if (clone != null) {
return clone; // some clauses rewrote
} else {
return this; // no clauses rewrote
}
|
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(")");
buffer.append(ToStringUtils.boost(getBoost()));
return buffer.toString();
|