[Koha-bugs] [Bug 5555] New: ISBN search returns bad results
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Dec 30 10:23:09 CET 2010
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5555
Summary: ISBN search returns bad results
Change sponsored?: ---
Product: Koha
Version: rel_3_2
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P5
Component: Searching
AssignedTo: gmcharlt at gmail.com
ReportedBy: januszop at gmail.com
QAContact: koha-bugs at lists.koha-community.org
Estimated Hours: 0.0
When making ISBN search (having chosen ISBN from the menu, NOT using ccl query)
Koha generates fake results - instead of using nb (@attr 1=7) index it looks
for given string anywhere in records. This is, most probably, caused by
following fragment of C4::Search::buildQuery:
# ISBN,ISSN,Standard Number, don't need special treatment
elsif ( $index eq 'nb' || $index eq 'ns' ) {
$indexes_set++;
(
$stemming, $auto_truncation,
$weight_fields, $fuzzy_enabled,
$remove_stopwords
) = ( 0, 0, 0, 0, 0 );
}
Fast workaround could be as attached at the bottom, but maybe somebody would
propose a more elegant solution.
Best regards,
Janusz
--- Search.pm 2010-12-30 10:41:23.000000000 +0200
+++ /usr/share/koha/lib/C4/Search.pm 2010-12-30 10:33:35.000000000 +0200
@@ -1125,6 +1129,7 @@
unless ( $indexes_set || !$index || $index =~
/(st-|phr|ext|wrdl)/ ) {
$struct_attr = ",wrdl";
}
+$indexes_set = 0 if ( $index eq 'nb' || $index eq 'ns' );
# Some helpful index variants
my $index_plus = $index . $struct_attr . ':';
@@ -1307,7 +1312,7 @@
# This is flawed , means we can't search anything with : in it
# if user wants to do ccl or cql, start the query with that
# $query =~ s/:/=/g;
- $query =~ s/(?<=(ti|au|pb|su|an|kw|mc)):/=/g;
+ $query =~ s/(?<=(ti|au|pb|su|an|kw|mc|nb|nc)):/=/g;
$query =~ s/(?<=(wrdl)):/=/g;
$query =~ s/(?<=(trn|phr)):/=/g;
$limit =~ s/:/=/g;
--
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the Koha-bugs
mailing list