https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23649

--- Comment #63 from Pedro Amorim (ammopt) <[email protected]> ---
Created attachment 211649
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211649&action=edit
Bug 23649: (follow-up) Multiply overlapping relevance boosts instead of summing
them

score_mode 'sum' added the weights of every boost a record matched, so
a penalty added to an already boosted record raised its score: itype
BK 2.00 plus location GEN 0.50 gave 2.50, above the 2.00 of BK alone.
score_mode is now 'multiply', so BK 2.00 and GEN 0.50 give 1.00, and
two promoting boosts still stack (2.00 and 2.00 give 4.00).

The value boost tests in QueryBuilder.t were always skipped, as an
earlier subtest deletes all search fields. The itype search field is
now created when missing.

Test plan:
0) Launch ktd with Elasticsearch:
   ktd --search-engine es8 up
1) Add the following to the 'IntranetUserJS' system preference:
   $(".search_score").toggle();
2) Go to
http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
   'Bibliographic records' tab, 'Relevance boosts' section, add:
   - 'Item types (itype)' = 'BK', weight '2.00'
   - 'Location (location)' = 'GEN', weight '0.50'
3) Before applying the patch, search for 'john':
   http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=john
   Notice BK records with GEN items score 2.5, higher than the BK boost
   alone (2). The penalty raised them.
4) Apply the patch and restart plack:
   koha-plack --restart kohadev
5) Search for 'john' again. Notice the same records now score 1 (2 x 0.5).
6) Go back to
http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
   'Bibliographic records' tab. Notice the 'Relevance boosts' hint text now
   says matching weights are multiplied together.
7) Run the tests, confirm none are skipped:
    prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t

Sponsored-by: Southeast Kansas Library System

Co-Authored-By: Claude Opus 5.5 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to