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
Contributor

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 germanosin self-assigned this Oct 31, 2025
@germanosin germanosin merged commit 9e1f9d6 into main Oct 31, 2025
14 checks passed
@germanosin germanosin deleted the issues/1332-be branch October 31, 2025 16:38
@Haarolean Haarolean changed the title BE: Issue#1332 Sort based on prefix offsets BE: FTS: Sort based on prefix offsets Nov 10, 2025
@Haarolean Haarolean added type/enhancement En enhancement/improvement to an already existing feature scope/backend Related to backend changes labels Nov 10, 2025
@Haarolean Haarolean added this to the 1.4 milestone Nov 10, 2025
@Haarolean Haarolean moved this from Todo to Done in Release 1.4 Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/backend Related to backend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Prioritize FTS search results based on position of occurrence

3 participants