Skip to content

Reduce fulltext match boost - #992

Open
JPrevost wants to merge 1 commit into
mainfrom
use-723-reduce-fulltext-boost
Open

JPrevost wants to merge 1 commit into
mainfrom
use-723-reduce-fulltext-boost

Conversation

@JPrevost

Copy link
Copy Markdown
Member

Why are these changes being introduced:

  • Fulltext fields are very large blocks of text compared to other metadata-only fields.
  • Reducing the boost for fulltext fields ensures that matches in smaller, more specific metadata fields are not overshadowed by matches in large text blocks.
  • We had evidence that relevance scores as measured by Quepid were being negatively affected under some conditions.

Relevant ticket(s):

How does this address that need:

  • Reduced the boost for fulltext fields in the search query.

Developer

  • All new ENV is documented in README
  • All new ENV has been added to Heroku Pipeline, Staging and Prod
  • ANDI or Wave has been run in accordance to
    our guide and
    all issues introduced by these changes have been resolved or opened as new
    issues (link to those issues in the Pull Request details above)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • There are appropriate tests covering any new functionality
  • The documentation has been updated or is unnecessary
  • The changes have been verified
  • New dependencies are appropriate or there were no changes

Requires database migrations?

NO

Includes new or updated dependencies?

NO

Why are these changes being introduced:

* Fulltext fields are very large blocks of text compared to other
  metadata-only fields.
* Reducing the boost for fulltext fields ensures that matches in
  smaller, more specific metadata fields are not overshadowed by matches
  in large text blocks.
* We had evidence that relevance scores as measured by Quepid were
  being negatively affected under some conditions.

Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/USE-723

How does this address that need:

* Reduced the boost for fulltext fields in the search query.
@qltysh

qltysh Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

All good ✅

Comment thread test/models/lexical_query_builder_test.rb
Comment thread test/models/lexical_query_builder_test.rb

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The boost change and corresponding test update are reviewed with no unresolved issues.

0 open findings

What changed in this PR

Reduces the relevance boost for fulltext matches so more specific metadata fields rank higher.

Changes:

  • Applies a 0.1 boost to fulltext.
  • Updates the query-builder test expectation.
File Summary
test/​models/​lexical_query_builder_test.rb Verifies the updated field boost.
app/​models/​lexical_query_builder.rb Lowers the fulltext field boost.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch was successfully deployed

1 active deployment
timdex-api-p-use-723-re-f6fom5 — 5d077052 Deployed Oct 13, 2026 by mitlib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants