Lines 432-437
sub build_authorities_query_compat {
Link Here
|
432 |
|
432 |
|
433 |
# Convert to lower case |
433 |
# Convert to lower case |
434 |
$marclist = [map(lc, @{$marclist})]; |
434 |
$marclist = [map(lc, @{$marclist})]; |
|
|
435 |
$orderby = lc $orderby; |
435 |
|
436 |
|
436 |
# Make sure everything exists |
437 |
# Make sure everything exists |
437 |
foreach my $m (@$marclist) { |
438 |
foreach my $m (@$marclist) { |
Lines 454-460
sub build_authorities_query_compat {
Link Here
|
454 |
: ( $orderby =~ /^auth/ ) ? 'local-number' |
455 |
: ( $orderby =~ /^auth/ ) ? 'local-number' |
455 |
: undef; |
456 |
: undef; |
456 |
if ($sort_field) { |
457 |
if ($sort_field) { |
457 |
my $sort_order = ( $orderby =~ /Asc$/ ) ? 'asc' : 'desc'; |
458 |
my $sort_order = ( $orderby =~ /asc$/ ) ? 'asc' : 'desc'; |
458 |
%sort = ( $sort_field => $sort_order, ); |
459 |
%sort = ( $sort_field => $sort_order, ); |
459 |
} |
460 |
} |
460 |
my %search = ( |
461 |
my %search = ( |
Lines 887-893
operands and double quoted strings.
Link Here
|
887 |
|
888 |
|
888 |
=cut |
889 |
=cut |
889 |
|
890 |
|
890 |
my $tokenize_split_re = qr/((?:${field_name_pattern}${multi_field_pattern}:)?"[^"]+"|\s+)/; |
|
|
891 |
sub _truncate_terms { |
891 |
sub _truncate_terms { |
892 |
my ( $self, $query ) = @_; |
892 |
my ( $self, $query ) = @_; |
893 |
|
893 |
|
Lines 914-925
any field prefixes and quoted strings.
Link Here
|
914 |
|
914 |
|
915 |
=cut |
915 |
=cut |
916 |
|
916 |
|
|
|
917 |
my $tokenize_split_re = qr/((?:${field_name_pattern}${multi_field_pattern}:)?"[^"]+"|\s+)/; |
918 |
|
917 |
sub _split_query { |
919 |
sub _split_query { |
918 |
my ( $self, $query ) = @_; |
920 |
my ( $self, $query ) = @_; |
919 |
|
921 |
|
920 |
# '"donald duck" title:"the mouse" and peter" get split into |
922 |
# '"donald duck" title:"the mouse" and peter" get split into |
921 |
# ['', '"donald duck"', '', ' ', '', 'title:"the mouse"', '', ' ', 'and', ' ', 'pete'] |
923 |
# ['', '"donald duck"', '', ' ', '', 'title:"the mouse"', '', ' ', 'and', ' ', 'pete'] |
922 |
my @tokens = split /((?:[\w\-.]+:)?"[^"]+"|\s+)/, $query; |
924 |
my @tokens = split $tokenize_split_re, $query; |
923 |
|
925 |
|
924 |
# Filter out empty values |
926 |
# Filter out empty values |
925 |
@tokens = grep( /\S/, @tokens ); |
927 |
@tokens = grep( /\S/, @tokens ); |