From 6cfc26f8563f5841780cf84822d70358467b8bc8 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Wed, 24 Oct 2007 13:34:11 -0500 Subject: [PATCH] defaut search on kw,wrdl without this, the search is done on kw, and truncation is not possible. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Search.pm | 2 +- catalogue/search.pl | 6 +++++- opac/opac-search.pl | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index d32a3d8d1a..eeb893312c 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -608,7 +608,7 @@ sub buildQuery { } if ( $operands[$i] ) { - $operand =~ s/^(and |or |not )//i; + $operand =~ s/^(and |or |not )//i; # STEMMING FIXME: need to refine the field weighting so stemmed operands don't disrupt the query ranking if ($stemming) { diff --git a/catalogue/search.pl b/catalogue/search.pl index fff41df184..2f05649709 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -337,7 +337,11 @@ my @operators; # indexes are query qualifiers, like 'title', 'author', etc. They # can be simple or complex my @indexes; -@indexes = split("\0",$params->{'idx'}) if $params->{'idx'}; +if ($params->{'idx'}) { + @indexes = split("\0",$params->{'idx'}); +} else { + $indexes[0] = 'kw,wrdl'; +} # an operand can be a single term, a phrase, or a complete ccl query my @operands; diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 90ed8c35e5..8c56245a9d 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -370,7 +370,11 @@ my @operators; # indexes are query qualifiers, like 'title', 'author', etc. They # can be simple or complex my @indexes; -@indexes = split( "\0", $params->{'idx'} ) if $params->{'idx'}; +if ($params->{'idx'}) { + @indexes = split("\0",$params->{'idx'}); +} else { + $indexes[0] = 'kw,wrdl'; +} # an operand can be a single term, a phrase, or a complete ccl query my @operands; -- 2.39.2