SpansNot extends BLSpans { public SpansNot(LeafReader reader, String fieldName, BLSpans clause) { maxDoc = reader == null ? -1 : reader.maxDoc(); liveDocs = reader == null ? null : MultiFields.getLiveDocs(reader); subtractClosingToken = 1; this.lengthGetter = new DocFieldLengthGetter(reader, fieldName); this.clause = clause == null ? null : clause; } SpansNot(LeafReader reader, String fieldName, BLSpans clause); @Override int docID(); @Override int endPosition(); @Override int nextDoc(); @Override int nextStartPosition(); @Override int advanceStartPosition(int target); @Override int advance(int doc); @Override int startPosition(); @Override String toString(); @Override void passHitQueryContextToClauses(HitQueryContext context); @Override void getCapturedGroups(Span[] capturedGroups); @Override int width(); @Override void collect(SpanCollector collector); @Override float positionsCost();  }
@Test public void testSpansNot() throws IOException { Spans exp = MockSpans.fromLists( new int[] { 0, 1, 2, 2, 2, 4, 4, 4, 4, 4 }, new int[] { 4, 0, 0, 2, 4, 0, 1, 2, 3, 4 }, new int[] { 5, 1, 1, 3, 5, 1, 2, 3, 4, 5 }); TestUtil.assertEquals(exp, getSpans()); }