From ccbaeaf2ef545689b3de85b82b907bc814b1c85d 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 the date of publication or date of acquisition indexes from advanced search, there are several bugs : - The search is performed on specific index, using only search term. - 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 the operand. This patch corrects this. Test plan : - Go to advanced search in the staff interface - 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 Signed-off-by: Galen Charlton --- C4/Search.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 65ad919..d3a1bbe 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1369,14 +1369,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.10.4