A Spans that is formed from the ordered subspans of a SpanNearQuery
/// where the subspans do not overlap and have a maximum slop between them.
///
/// The formed spans only contains minimum slop matches.
/// The matching slop is computed from the distance(s) between
/// the non overlapping matching Spans.
/// Successive matches are always formed from the successive Spans
/// of the SpanNearQuery.
///
/// The formed spans may contain overlaps when the slop is at least 1.
/// For example, when querying using
///
t1 t2 t3
/// with slop at least 1, the fragment:
/// t1 t2 t1 t3 t2 t3
/// matches twice:
/// t1 t2 .. t3
/// t1 .. t2 t3
///
class NearSpansOrdered : Spans
{
internal class AnonymousClassComparator : System.Collections.IComparer
{
public AnonymousClassComparator(NearSpansOrdered enclosingInstance)
{
InitBlock(enclosingInstance);
}
private void InitBlock(NearSpansOrdered enclosingInstance)
{
this.enclosingInstance = enclosingInstance;
}
private NearSpansOrdered enclosingInstance;
public NearSpansOrdered Enclosing_Instance
{
get
{
return enclosingInstance;
}
}
public virtual int Compare(System.Object o1, System.Object o2)
{
return ((Spans) o1).Doc() - ((Spans) o2).Doc();
}
}
private void InitBlock()
{
spanDocComparator = new AnonymousClassComparator(this);
}
private int allowedSlop;
private bool firstTime = true;
private bool more = false;
///