jpountz commented on a change in pull request #767: URL: https://github.com/apache/lucene/pull/767#discussion_r840305767
########## File path: lucene/core/src/java/org/apache/lucene/search/DocValuesFieldExistsQuery.java ########## @@ -31,42 +28,21 @@ /** * A {@link Query} that matches documents that have a value for a given field as reported by doc * values iterators. + * + * @deprecated Use {@link org.apache.lucene.search.FieldExistsQuery} instead. */ -public final class DocValuesFieldExistsQuery extends Query { - - private final String field; +@Deprecated +public final class DocValuesFieldExistsQuery extends FieldExistsQuery { + private String field; /** Create a query that will match documents which have a value for the given {@code field}. */ public DocValuesFieldExistsQuery(String field) { + super(field); this.field = Objects.requireNonNull(field); } - public String getField() { - return field; - } - - @Override - public boolean equals(Object other) { - return sameClassAs(other) && field.equals(((DocValuesFieldExistsQuery) other).field); - } - - @Override - public int hashCode() { - return 31 * classHash() + field.hashCode(); - } - - @Override - public String toString(String field) { - return "DocValuesFieldExistsQuery [field=" + this.field + "]"; - } - - @Override - public void visit(QueryVisitor visitor) { - if (visitor.acceptField(field)) { - visitor.visitLeaf(this); - } - } - + // nocommit this seems to be generalizable to norms and knn as well given LUCENE-9334, and thus + // could be moved to the new FieldExistsQuery? Review comment: It would be nice if we could detect when all documents have a doc value but unfortunately we do not have an inedx statistic we can use to check. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org