Methods Summary |
---|
public org.apache.lucene.search.spans.SpanQuery[] | getClauses()Return the clauses whose spans are matched.
return (SpanQuery[])clauses.toArray(new SpanQuery[clauses.size()]);
|
public java.lang.String | getField() return field;
|
public int | getSlop()Return the maximum number of intervening unmatched positions permitted. return slop;
|
public org.apache.lucene.search.spans.Spans | getSpans(org.apache.lucene.index.IndexReader reader)
if (clauses.size() == 0) // optimize 0-clause case
return new SpanOrQuery(getClauses()).getSpans(reader);
if (clauses.size() == 1) // optimize 1-clause case
return ((SpanQuery)clauses.get(0)).getSpans(reader);
return new NearSpans(this, reader);
|
public java.util.Collection | getTerms()
Collection terms = new ArrayList();
Iterator i = clauses.iterator();
while (i.hasNext()) {
SpanQuery clause = (SpanQuery)i.next();
terms.addAll(clause.getTerms());
}
return terms;
|
public boolean | isInOrder()Return true if matches are required to be in-order. return inOrder;
|
public java.lang.String | toString(java.lang.String field)
StringBuffer buffer = new StringBuffer();
buffer.append("spanNear([");
Iterator i = clauses.iterator();
while (i.hasNext()) {
SpanQuery clause = (SpanQuery)i.next();
buffer.append(clause.toString(field));
if (i.hasNext()) {
buffer.append(", ");
}
}
buffer.append("], ");
buffer.append(slop);
buffer.append(", ");
buffer.append(inOrder);
buffer.append(")");
return buffer.toString();
|