apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.46k stars 979 forks source link

Add 'passageSortComparator' option in FieldHighlighter #13276

Closed Seunghan-Jung closed 1 month ago

Seunghan-Jung commented 2 months ago

Description

FieldHighlighter always sorts the final selected passages based on startOffset, but this may not align with the user's intentions.

For example, in the case of Solr's multiValue fields, the order might just be a simple listing of items without any significance. In such cases, the order in which passages appear is not important. It might be more effective to maintain sorting by score in these situations.

Therefore, it seems necessary to allow for the final sorting criteria to be determined in accordance with the user's intentions.

github-actions[bot] commented 2 months ago

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!

github-actions[bot] commented 1 month ago

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!

dsmiley commented 1 month ago

I like this change; very nice! I shall merge it. Please share how I shall list you in CHANGES.txt.

Proposed text under improvements to 9.11:

GITHUB#13276: UnifiedHighlighter: new 'passageSortComparator' option to not do offset order (YOUR NAME)