From eb5937cb98b924523e316d1153c6b619fd9c7180 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Tue, 8 Jan 2013 18:03:37 +0100 Subject: [PATCH] Bug 9368: specific behavior of yr and acqdate indexes When searching on date of publication or date of acquisition index from advanced search, there are several bugs : - The search is performed on no index, using only search therm. - The next or previous pages lead to an empty result page. This comes from specific behavior in C4/Search.pm, $indexes_set flag is used but the index is not added to operand. This patch corrects this. Test plan : - Go to advance search - Select publication date or acquisition date - Enter a valid search term (you must have several pages of results) - Click on search => result page shows a correct result number - Click on page 2 => next results are shown --- C4/Search.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 50f7d2b..376f0e8 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1313,14 +1313,14 @@ sub buildQuery { # Add index-specific attributes # Date of Publication if ( $index eq 'yr' ) { - $index .= ",st-numeric"; + $operand = "$index,st-numeric=$operand"; $indexes_set++; $stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; } # Date of Acquisition elsif ( $index eq 'acqdate' ) { - $index .= ",st-date-normalized"; + $operand = "$index,st-date-normalized=$operand"; $indexes_set++; $stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; } -- 1.7.9.5