Lines 92-97
sub build_query {
Link Here
|
92 |
default_operator => 'AND', |
92 |
default_operator => 'AND', |
93 |
default_field => '_all', |
93 |
default_field => '_all', |
94 |
lenient => JSON::true, |
94 |
lenient => JSON::true, |
|
|
95 |
fields => $options{fields}, |
96 |
use_dis_max => JSON::true, |
95 |
} |
97 |
} |
96 |
}; |
98 |
}; |
97 |
|
99 |
|
Lines 228-236
sub build_query_compat {
Link Here
|
228 |
join( ' ', $self->_create_query_string(@search_params) ) || (), |
230 |
join( ' ', $self->_create_query_string(@search_params) ) || (), |
229 |
$self->_join_queries( $self->_convert_index_strings(@$limits) ) || () ); |
231 |
$self->_join_queries( $self->_convert_index_strings(@$limits) ) || () ); |
230 |
|
232 |
|
|
|
233 |
my @weights = $params->{weight}; |
234 |
my @w_fields = $params->{w_fields}; |
235 |
my @fields = '_all'; |
236 |
if ( defined $weights[0] ) { |
237 |
for (my $i = 0 ; $i < (scalar @weights) ; $i++ ){ |
238 |
push @fields, "$w_fields[$i]^$weights[$i]"; |
239 |
} |
240 |
} |
241 |
|
231 |
# If there's no query on the left, let's remove the junk left behind |
242 |
# If there's no query on the left, let's remove the junk left behind |
232 |
$query_str =~ s/^ AND //; |
243 |
$query_str =~ s/^ AND //; |
233 |
my %options; |
244 |
my %options; |
|
|
245 |
$options{fields} = \@fields; |
234 |
$options{sort} = \@sort_params; |
246 |
$options{sort} = \@sort_params; |
235 |
$options{expanded_facet} = $params->{expanded_facet}; |
247 |
$options{expanded_facet} = $params->{expanded_facet}; |
236 |
my $query = $self->build_query( $query_str, %options ); |
248 |
my $query = $self->build_query( $query_str, %options ); |