Skip to content

Conversation

germanosin
Copy link
Member

  • Breaking change? (if so, please describe the impact and migration path for existing application instances)

What changes did you make? (Give an overview)

Is there anything you'd like reviewers to focus on?

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

  • No need to
  • Manually (please, describe, if necessary)
  • Unit checks
  • Integration checks
  • Covered by existing automation

Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings (e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Check out Contributing and Code of Conduct

A picture of a cute animal (not mandatory but encouraged)

@germanosin germanosin requested a review from a team as a code owner October 13, 2025 15:51
@kapybro kapybro bot added status/triage Issues pending maintainers triage status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Oct 13, 2025
@germanosin germanosin linked an issue Oct 13, 2025 that may be closed by this pull request
2 tasks
@germanosin germanosin requested a review from Copilot October 13, 2025 19:41
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request implements sorting functionality based on prefix offsets for Lucene topic search. The changes improve search result ranking by prioritizing matches where search terms appear earlier in topic names.

  • Introduces a custom scoring function that calculates position-based scores for search prefixes
  • Adds support for offset tracking in the word analyzer and text field indexing
  • Implements comprehensive test coverage for the new ordering functionality

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ShortWordAnalyzer.java Modified to support offset tracking and moved to lucene package
IndexedTextField.java New custom text field implementation with offset support
NameDistanceScoringFunction.java New scoring function that ranks results by prefix position
PrefixQueryParser.java Enhanced to track search prefixes for scoring
LuceneTopicsIndex.java Updated to use new components and apply position-based scoring
ShortWordAnalyzerTest.java New test class validating analyzer offset behavior
LuceneTopicsIndexTest.java Enhanced with ordering tests and moved to lucene package

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

germanosin and others added 3 commits October 13, 2025 21:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/triage/completed Automatic triage completed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prioritize FTS search results based on position of occurrence

1 participant