[GitHub] [lucene-solr] jpountz commented on a change in pull request #1610: LUCENE-9384: Backport for field sort optimization

2020-07-30 Thread GitBox


jpountz commented on a change in pull request #1610:
URL: https://github.com/apache/lucene-solr/pull/1610#discussion_r463156089



##
File path: lucene/core/src/java/org/apache/lucene/search/SortField.java
##
@@ -428,7 +428,6 @@ public boolean equals(Object o) {
   && other.reverse == this.reverse
   && Objects.equals(this.comparatorSource, other.comparatorSource)
   && Objects.equals(this.missingValue, other.missingValue)
-  && other.skipNonCompetitiveDocs == this.skipNonCompetitiveDocs

Review comment:
   Can you add a comment to say that we're not taking it into account on 
purpose? I foresee that someone will file a PR to add it after running a code 
analysis tool that would complain that not all fields are taken into account 
for equals otherwise.





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.

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



[GitHub] [lucene-solr] jpountz commented on a change in pull request #1610: LUCENE-9384: Backport for field sort optimization

2020-07-15 Thread GitBox


jpountz commented on a change in pull request #1610:
URL: https://github.com/apache/lucene-solr/pull/1610#discussion_r454999807



##
File path: lucene/core/src/java/org/apache/lucene/search/SortField.java
##
@@ -394,6 +399,21 @@ public String toString() {
 return buffer.toString();
   }
 
+
+  /**
+   * For numeric sort fields, setting this field, indicates that
+   * the same numeric data has been indexed with two fields: doc values and 
points and
+   * that these fields have the same name.
+   * This allows to use sort optimization and skip non-competitive documents.
+   */
+  public void setSkipNonCompetitiveDocs() {

Review comment:
   IMO `setCanUsePoints` is good enough since this is a "SortField" so it 
should be obvious that this is for sorting?

##
File path: lucene/core/src/java/org/apache/lucene/search/SortField.java
##
@@ -408,6 +428,7 @@ public boolean equals(Object o) {
   && other.reverse == this.reverse
   && Objects.equals(this.comparatorSource, other.comparatorSource)
   && Objects.equals(this.missingValue, other.missingValue)
+  && other.skipNonCompetitiveDocs == this.skipNonCompetitiveDocs

Review comment:
   I wonder if we should actually take it into account for equals/hashcode 
as this could disable index sorting optimizations, which check for equality of 
the index-time and search-time SortField instances.





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.

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