romseygeek commented on a change in pull request #1440:
URL: https://github.com/apache/lucene-solr/pull/1440#discussion_r412786736



##########
File path: lucene/core/src/java/org/apache/lucene/search/SortField.java
##########
@@ -392,4 +491,31 @@ public SortField rewrite(IndexSearcher searcher) throws 
IOException {
   public boolean needsScores() {
     return type == Type.SCORE;
   }
+
+  /**
+   * Returns an {@link IndexSorter} used for sorting index segments by this 
SortField.
+   *
+   * If the SortField cannot be used for index sorting (for example, if it 
uses scores or
+   * other query-dependent values) then this method should return {@code null}
+   *
+   * SortFields that implement this method should also implement a constructor 
that
+   * takes a {@link DataInput} for deserialization, to match the {@link 
IndexSorter#serialize(DataOutput)}
+   * method on the returned IndexSorter
+   */

Review comment:
       I'm not sure this API is particularly internal? If people want to 
implement their own SortFields and make them indexable they will need to 
implement this method, which makes it public IMO.
   
   We should probably take `@lucene.experimental` off `getFieldComparator()` as 
well, it's been there since 2004...




----------------------------------------------------------------
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

Reply via email to