+1 for this patch, it is very nice. I love that now spans share both conjunction and disjunction logic and support two-phase execution everywhere.
I benchmarked and found no performance regressions with a variety of tasks, like filter intersection with disjunctions, minshouldmatch queries, etc.
I created a contrived benchmark for SpanOr, "spanMultiPhrase" which just reuses the same tasks file from
LUCENE-6421, but instead executes as SpanNear(SpanOr, ...). It takes 15 minutes per iteration, and isn't the greatest benchmark but so far i see up to 10% improvement in some cases for that benchmark.
I will do some final tests and plan to commit this soon.