Bugzilla – Attachment 1438 Details for
Bug 3571
AutoTruncation is not allowed alone
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
this patch enables autotruncation when QueryAutoTruncate Is set
0001-Adding-autotruncation.patch (text/plain), 1.87 KB, created by
Chris Cormack
on 2009-09-02 13:49:00 UTC
(
hide
)
Description:
this patch enables autotruncation when QueryAutoTruncate Is set
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2009-09-02 13:49:00 UTC
Size:
1.87 KB
patch
obsolete
>From 92169af31586f5f0feba60b964d48bd098b37848 Mon Sep 17 00:00:00 2001 >From: Henri-Damien LAURENT <henridamien.laurent@biblibre.com> >Date: Wed, 2 Sep 2009 15:17:28 +0200 >Subject: [PATCH] Adding autotruncation > >Allow autotruncation to be set on its own >This simply reprocess operands in order to add * at lefthandside >It is a problem with non LTR scripts. But works fine with all the latin scripts >--- > C4/Search.pm | 18 ++++++++---------- > 1 files changed, 8 insertions(+), 10 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 484b2f4..cd17d50 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -903,16 +903,6 @@ sub buildQuery { > # Some helpful index variants > my $index_plus = $index . $struct_attr . ":" if $index; > my $index_plus_comma = $index . $struct_attr . "," if $index; >- if ($auto_truncation){ >-# FIXME Auto Truncation is only valid for LTR languages >-# use C4::Output; >-# use C4::Languages qw(regex_lang_subtags get_bidi); >-# $lang = $query->cookie('KohaOpacLanguage') if (defined $query && $query->cookie('KohaOpacLanguage')); >-# my $current_lang = regex_lang_subtags($lang); >-# my $bidi; >-# $bidi = get_bidi($current_lang->{script}) if $current_lang->{script}; >- $index_plus_comma .= "rtrn:"; >- } > > # Remove Stopwords > if ($remove_stopwords) { >@@ -923,6 +913,14 @@ sub buildQuery { > if ( $stopwords_removed && $DEBUG ); > } > >+ if ($auto_truncation){ >+ #FIXME only valid with LTR scripts >+ $operand=join(" ",map{ >+ "$_*" >+ }split (/\s+/,$operand)); >+ warn $operand if $DEBUG; >+ } >+ > # Detect Truncation > my $truncated_operand; > my( $nontruncated, $righttruncated, $lefttruncated, >-- >1.6.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3571
: 1438