[Koha-bugs] [Bug 20151] Search is broken when stemming has no language

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Feb 7 16:30:30 CET 2018


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

--- Comment #1 from Fridolin SOMERS <fridolin.somers at biblibre.com> ---
Created attachment 71285
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71285&action=edit
Bug 20151: always use current language for stemming

When stemming is enable in catalog searching,
C4::Search::_build_stemmed_operand will transform operand into stemmed operand
using stemmer Lingua::Stem::Snowball with a specified language.
This stemmer returns undef is no language is defined.

In classic catalog search, current language is used.
But in other pages acqui/neworderbiblio.pl and cataloguing/addbooks.pl no
language is defined so operand is empty.
Any search returns entire catalog.

This patch corrects by returning operand without change if no langage is
defined in C4::Search::_build_stemmed_operand. And uses current langage in
pages acqui/neworderbiblio.pl and cataloguing/addbooks.pl.

Test plan :
1) Enable system preferences QueryStemming and QueryWeightFields
2) Disable system preferences QueryAutoTruncate, QueryFuzzy and UseQueryParser
3) Perform an search in catalog (without index) that uses the stemming, for
example "historical" will search "histor*"
4) Go to "Cataloging"
5) Perform a search on same word in "Cataloging search"
6) Without patch you have entire catalog, with patch you have correct number of
results
7) Go to aquisition on a basket and click "Add to basket"
8) Perform search in "From an existing record"
9) Without patch you have entire catalog, with patch you have correct number of
results

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list