solr icon indicating copy to clipboard operation
solr copied to clipboard

SOLR-17310: Configurable LeafSorter to customize segment search order

Open weiwang19 opened this issue 1 year ago • 2 comments

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

Description

Lucene's IndexWriterConfig provides the option to sort leaf readers when a custom LeafSorter is provided. The functionality is currently not directly exposed in Solr. There are cases where we would like to customize the segment visit order, for example, visit the recently updated segments first when early termination is applied.

Solution

The SegmentTimeLeafSorter sorts the LeafReaders by time stamp, in ascending or descending order. It can be enabled by adding the segmentSort config in solrconfig.xml. Without the config, no sorting is applied by default.

Tests

Added unit test and verified all tests pass.

Checklist

Please review the following and check all that apply:

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

weiwang19 avatar May 24 '24 04:05 weiwang19

Tagging @cpoerschke for review; I figure you're a better reviewer here. I haven't used this aspect of Lucene before.

dsmiley avatar Jun 10 '24 21:06 dsmiley

This PR has had no activity for 60 days and is now labeled as stale. Any new activity or converting it to draft will remove the stale label. To attract more reviewers, please tag people who might be familiar with the code area and/or notify the [email protected] mailing list. Thank you for your contribution!

github-actions[bot] avatar Aug 23 '24 00:08 github-actions[bot]

This PR has had no activity for 60 days and is now labeled as stale. Any new activity will remove the stale label. To attract more reviewers, please tag people who might be familiar with the code area and/or notify the [email protected] mailing list. To exempt this PR from being marked as stale, make it a draft PR or add the label "exempt-stale". If left unattended, this PR will be closed after another 60 days of inactivity. Thank you for your contribution!

github-actions[bot] avatar Dec 03 '24 00:12 github-actions[bot]

This PR is now closed due to 60 days of inactivity after being marked as stale. Re-opening this PR is still possible, in which case it will be marked as active again.

github-actions[bot] avatar Feb 02 '25 00:02 github-actions[bot]

keep it open

weiwang19 avatar Feb 02 '25 04:02 weiwang19

Seems like this ticket and https://github.com/apache/solr/pull/313 both have stalled out... Thoughts on a thread on the dev mailing list to see if we think moving forward with this or the #313 approach gets us moving?

epugh avatar Feb 02 '25 13:02 epugh

Thanks for bringing this up. Would definitely like to have a discussion about moving this forward.

Thanks, Wei

On Sun, Feb 2, 2025 at 5:20 AM Eric Pugh @.***> wrote:

Seems like this ticket and #313 https://github.com/apache/solr/pull/313 both have stalled out... Thoughts on a thread on the dev mailing list to see if we think moving forward with this or the #313 https://github.com/apache/solr/pull/313 approach gets us moving?

— Reply to this email directly, view it on GitHub https://github.com/apache/solr/pull/2477#issuecomment-2629393983, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHFRMAHANN5EOQ377KR34FD2NYLQ5AVCNFSM6AAAAABIG2LSHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRZGM4TGOJYGM . You are receiving this because you authored the thread.Message ID: @.***>

weiwang19 avatar Feb 03 '25 05:02 weiwang19