@@ -, +, @@ --- C4/Search.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) --- a/C4/Search.pm +++ a/C4/Search.pm @@ -1273,6 +1273,8 @@ sub buildQuery { my $fuzzy_enabled = C4::Context->preference("QueryFuzzy") || 0; my $remove_stopwords = C4::Context->preference("QueryRemoveStopwords") || 0; + my $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser')); + my $query = $operands[0]; my $simple_query = $operands[0]; @@ -1367,14 +1369,24 @@ sub buildQuery { # Add index-specific attributes # Date of Publication if ( $index eq 'yr' ) { - $operand = "$index,st-numeric=$operand"; + if ($QParser) { + $index .= ",st-numeric"; + } + else { + $operand = "$index,st-numeric=$operand"; + } $indexes_set++; $stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; } # Date of Acquisition elsif ( $index eq 'acqdate' ) { - $operand = "$index,st-date-normalized=$operand"; + if ($QParser) { + $index .= ",st-date-normalized"; + } + else { + $operand = "$index,st-date-normalized=$operand"; + } $indexes_set++; $stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; } --