public SpanNotQuery(SpanQuery include, SpanQuery exclude, int pre, int post) {this.include = Objects.requireNonNull(include);this.exclude = Objects.requireNonNull(exclude);this.pre = pre;this.post = post;if (include.getField() != null && exclude.getField() != null && !include.getField().equals(exclude.getField()))throw new IllegalArgumentException("Clauses must have same field.");}
public SpanNotQuery(SpanQuery include, SpanQuery exclude, int pre, int post){this.include = include;this.exclude = exclude;this.pre = (pre >= 0) ? pre : 0;this.post = (post >= 0) ? post : 0;if (include.Field != null && exclude.Field != null && !include.Field.Equals(exclude.Field, StringComparison.Ordinal)){throw new System.ArgumentException("Clauses must have same field.");}}