|
Lines 90-96
sub build_query {
Link Here
|
| 90 |
query => $query, |
90 |
query => $query, |
| 91 |
fuzziness => $fuzzy_enabled ? 'auto' : '0', |
91 |
fuzziness => $fuzzy_enabled ? 'auto' : '0', |
| 92 |
default_operator => 'AND', |
92 |
default_operator => 'AND', |
| 93 |
default_field => '_all', |
93 |
default_field => '_record', |
| 94 |
lenient => JSON::true, |
94 |
lenient => JSON::true, |
| 95 |
fields => $options{fields} || [], |
95 |
fields => $options{fields} || [], |
| 96 |
} |
96 |
} |
|
Lines 230-236
sub build_query_compat {
Link Here
|
| 230 |
join( ' ', $self->_create_query_string(@search_params) ) || (), |
230 |
join( ' ', $self->_create_query_string(@search_params) ) || (), |
| 231 |
$self->_join_queries( $self->_convert_index_strings(@$limits) ) || () ); |
231 |
$self->_join_queries( $self->_convert_index_strings(@$limits) ) || () ); |
| 232 |
|
232 |
|
| 233 |
my @fields = '_all'; |
233 |
my @fields = '_record'; |
| 234 |
if ( defined($params->{weighted_fields}) && $params->{weighted_fields} ) { |
234 |
if ( defined($params->{weighted_fields}) && $params->{weighted_fields} ) { |
| 235 |
push @fields, sprintf("%s^%s", $_->name, $_->weight) for Koha::SearchFields->weighted_fields; |
235 |
push @fields, sprintf("%s^%s", $_->name, $_->weight) for Koha::SearchFields->weighted_fields; |
| 236 |
} |
236 |
} |
|
Lines 301-307
sub build_authorities_query {
Link Here
|
| 301 |
|
301 |
|
| 302 |
foreach my $s ( @{ $search->{searches} } ) { |
302 |
foreach my $s ( @{ $search->{searches} } ) { |
| 303 |
my ( $wh, $op, $val ) = @{$s}{qw(where operator value)}; |
303 |
my ( $wh, $op, $val ) = @{$s}{qw(where operator value)}; |
| 304 |
$wh = '_all' if $wh eq ''; |
304 |
$wh = '_record' if $wh eq ''; |
| 305 |
if ( $op eq 'is' || $op eq '=' || $op eq 'exact' ) { |
305 |
if ( $op eq 'is' || $op eq '=' || $op eq 'exact' ) { |
| 306 |
|
306 |
|
| 307 |
# look for something that matches a term completely |
307 |
# look for something that matches a term completely |
|
Lines 519-525
types.
Link Here
|
| 519 |
=cut |
519 |
=cut |
| 520 |
|
520 |
|
| 521 |
our %index_field_convert = ( |
521 |
our %index_field_convert = ( |
| 522 |
'kw' => '_all', |
522 |
'kw' => '_record', |
| 523 |
'ab' => 'abstract', |
523 |
'ab' => 'abstract', |
| 524 |
'au' => 'author', |
524 |
'au' => 'author', |
| 525 |
'lcn' => 'local-classification', |
525 |
'lcn' => 'local-classification', |