Index: SpanNearQuery.java =================================================================== --- SpanNearQuery.java (revision 233020) +++ SpanNearQuery.java (working copy) @@ -107,7 +107,9 @@ if (clauses.size() == 1) // optimize 1-clause case return ((SpanQuery)clauses.get(0)).getSpans(reader); - return new NearSpans(this, reader); + return inOrder + ? (Spans) new NearSpansOrdered(this, reader) + : (Spans) new NearSpans(this, reader); } /** Returns true iff o is equal to this. */