weiwang19 commented on code in PR #2477:
URL: https://github.com/apache/solr/pull/2477#discussion_r1616508184


##########
solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java:
##########
@@ -285,6 +294,21 @@ public IndexWriterConfig toIndexWriterConfig(SolrCore 
core) throws IOException {
       iwc.setMergedSegmentWarmer(warmer);
     }
 
+    if (segmentSort != null) {
+      try {
+        SegmentSort sortEnum = SegmentSort.valueOf(segmentSort);
+        LeafSorter sorter = new SegmentTimeLeafSorter(sortEnum);
+        Comparator<LeafReader> leafSorter = sorter.getLeafSorter();
+        if (leafSorter != null) {
+          iwc.setLeafSorter(leafSorter);
+          if (log.isDebugEnabled()) {
+            log.debug("Segment sort enabled:  {}", sorter.toString());
+          }
+        }
+      } catch (IllegalArgumentException e) {
+        log.error("Invalid segmentSort option: ", segmentSort);

Review Comment:
   changed to fail hard. 



-- 
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...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to