Bug 42107 - Add score to staff search results
Summary: Add score to staff search results
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-16 12:57 UTC by Nick Clemens (kidclamp)
Modified: 2026-03-16 13:01 UTC (History)
0 users

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Crowdfunding committed: 0
Crowdfunding contact:
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 42107: Add search scores to staff results page (3.91 KB, patch)
2026-03-16 13:01 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2026-03-16 12:57:09 UTC
When changing search settings in ES it would be helpful to understand how the current results are being scored.
Comment 1 Nick Clemens (kidclamp) 2026-03-16 13:01:14 UTC
Created attachment 195476 [details] [review]
Bug 42107: Add search scores to staff results page

This patch ensures the scores from ES are passed through and added to the
search results in the staff side.

Initially hidden, the scores can be shown by entering the line below into the
JS console in developer tools in the browser, or added to IntranetUserJS to
make them always show:
$(".search_score").toggle();

To test:
1 - Have Koha using ES
2 - Do some searches, note results
3 - Apply patch, restart all
4 - Confirm results don't change
5 - Enter code from description into IntranetUserJS
6 - Do more searches
7 - Note the score is visible

To really note scores, you will need to add some weights to the ES config:
Set weights like:
title 32
author 16
subject 8