Bug 1688 - search string starting with '*' kills search
Summary: search string starting with '*' kills search
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: Macintosh All
: P3 major
Assignee: Galen Charlton
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-21 02:39 UTC by Galen Charlton
Modified: 2016-08-13 17:59 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

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 00:33:28 UTC


---- Reported by gmcharlt@gmail.com 2007-12-21 14:39:39 ----

In OPAC or staff interface, try a search on '*stanbul' (or any search string starting with '*').

Expected result:

Either a normal screen showing no results found or a search of all records containing terms ending in 'stanbul', whatever the supported search syntax is.

Actual result:

CGI::Carp with following message:

Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE stanbul/ at /home/gmc/koha/production/intranet/modules/C4/Search.pm line 1079.



---- Additional Comments From jmf@liblime.com 2007-12-21 15:01:27 ----

Can you verify that you're running Zebra version 2.0.18 or greater?



---- Additional Comments From gmcharlt@gmail.com 2007-12-21 15:21:14 ----

Running version 2.0.14 (on arwen).  Does that matter?  The failing regex is in search term highlight code, not from a ZOOM exception.

        my $searchhighlightblob;
        for my $highlight_field ($marcrecord->fields) {
            next if $highlight_field->tag() =~ /(^00)/; # skip fixed fields
            my $match;
            my $field = $highlight_field->as_string();
            for my $term ( keys %$span_terms_hashref ) {
                if (($field =~ /$term/i) && (length($term) > 3)) {
                    $field =~ s/$term/<span class=\"term\">$&<\/span>/gi;
                    $match++;
                }
            }



---- Additional Comments From jmf@liblime.com 2007-12-23 13:00:12 ----

Ahh, right, the version of ZEbra only matters if you're doing right and left truncation ( *stanbu* for instance ). Need Zebra > 2.0.18 for that.

I was missing '*' as a list of things to sanitize from the term, fixed now, thanks for the report.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:33 UTC  ---

This bug was previously known as _bug_ 1688 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=1688

Actual time not defined. Setting to 0.0
The original assignee of this bug does not have
   an account here. Reassigning to the default assignee
   for the component, gmcharlt@gmail.com.
   Previous assignee was jmf@liblime.com.

Comment 1 Nightly Build Bot 2016-08-13 17:59:09 UTC
This is a test