Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-17444: Add Passage Sorting Option in UnifiedSolrHighlighter #2697

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Seunghan-Jung
Copy link

@Seunghan-Jung Seunghan-Jung commented Sep 8, 2024

https://issues.apache.org/jira/browse/SOLR-17444

Description

We will add the passageSortComparator option, introduced in the UnifiedHighlighter in the Lucene 9.11 project, to the Solr highlighter parameters, enabling its functionality within Solr.

For reference, here is the related Lucene project commit:

apache/lucene@8773725
 

Solution

  1. Added the parameter name PASSAGE_SORT to HighlightParams to support the related functionality.
  2. In the UnifiedSolrHighlighter.SolrExtendedUnifiedHighlighter class, I overrode the getPassageSortComparator method from the superclass UnifiedHighlighter. The PASSAGE_SORT parameter from the request is parsed and the corresponding Comparator<Passage> object is used.

Tests

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@github-actions github-actions bot added client:solrj cat:search documentation Improvements or additions to documentation labels Sep 8, 2024
@Seunghan-Jung Seunghan-Jung marked this pull request as ready for review September 8, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:search client:solrj documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant