org.apache.lucene.search.spans

Class SpanNearQuery

public class SpanNearQuery extends SpanQuery

Matches spans which are near one another. One can specify slop, the maximum number of intervening unmatched positions, as well as whether matches are required to be in-order.
Constructor Summary
SpanNearQuery(SpanQuery[] clauses, int slop, boolean inOrder)
Construct a SpanNearQuery.
Method Summary
booleanequals(Object o)
Returns true iff o is equal to this.
voidextractTerms(Set terms)
SpanQuery[]getClauses()
Return the clauses whose spans are matched.
StringgetField()
intgetSlop()
Return the maximum number of intervening unmatched positions permitted.
SpansgetSpans(IndexReader reader)
CollectiongetTerms()
Returns a collection of all terms matched by this query.
inthashCode()
booleanisInOrder()
Return true if matches are required to be in-order.
Queryrewrite(IndexReader reader)
StringtoString(String field)

Constructor Detail

SpanNearQuery

public SpanNearQuery(SpanQuery[] clauses, int slop, boolean inOrder)
Construct a SpanNearQuery. Matches spans matching a span from each clause, with up to slop total unmatched positions between them. * When inOrder is true, the spans from each clause must be * ordered as in clauses.

Method Detail

equals

public boolean equals(Object o)
Returns true iff o is equal to this.

extractTerms

public void extractTerms(Set terms)

getClauses

public SpanQuery[] getClauses()
Return the clauses whose spans are matched.

getField

public String getField()

getSlop

public int getSlop()
Return the maximum number of intervening unmatched positions permitted.

getSpans

public Spans getSpans(IndexReader reader)

getTerms

public Collection getTerms()

Deprecated: use extractTerms instead

Returns a collection of all terms matched by this query.

See Also: extractTerms

hashCode

public int hashCode()

isInOrder

public boolean isInOrder()
Return true if matches are required to be in-order.

rewrite

public Query rewrite(IndexReader reader)

toString

public String toString(String field)
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.