Seunghan-Jung commented on code in PR #2697:
URL: https://github.com/apache/solr/pull/2697#discussion_r1779530690


##########
solr/core/src/java/org/apache/solr/highlight/UnifiedSolrHighlighter.java:
##########
@@ -314,6 +343,24 @@ protected PassageFormatter getFormatter(String fieldName) {
       return new DefaultPassageFormatter(preTag, postTag, ellipsis, 
"html".equals(encoder));
     }
 
+    @Override
+    protected Comparator<Passage> getPassageSortComparator(String fieldName) {
+      PassageSort passageSort =
+          PassageSort.parse(
+              params.getFieldParam(fieldName, HighlightParams.PASSAGE_SORT, 
PassageSort.START_OFFSET.key));
+
+      switch (passageSort) {
+        case START_OFFSET:
+          return Comparator.comparingInt(Passage::getStartOffset);
+        case END_OFFSET:
+          return Comparator.comparingInt(Passage::getEndOffset);
+        case SCORE:
+          return Comparator.comparingDouble(Passage::getScore);
+        default:
+          throw new AssertionError();

Review Comment:
   It was fixed in this commit: 
https://github.com/apache/solr/pull/2697/commits/deafe902701bf33013a5c694fc1e85e9c7530818.



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