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 226-234
sub build_query_compat {
Link Here
|
226 |
join( ' ', $self->_create_query_string(@search_params) ) || (), |
228 |
join( ' ', $self->_create_query_string(@search_params) ) || (), |
227 |
$self->_join_queries( $self->_convert_index_strings(@$limits) ) || () ); |
229 |
$self->_join_queries( $self->_convert_index_strings(@$limits) ) || () ); |
228 |
|
230 |
|
|
|
231 |
my @weights = $params->{weight}; |
232 |
my @w_fields = $params->{w_fields}; |
233 |
my @fields = '_all'; |
234 |
if ( defined $weights[0] ) { |
235 |
for (my $i = 0 ; $i < (scalar @weights) ; $i++ ){ |
236 |
push @fields, "$w_fields[$i]^$weights[$i]"; |
237 |
} |
238 |
} |
239 |
|
229 |
# If there's no query on the left, let's remove the junk left behind |
240 |
# If there's no query on the left, let's remove the junk left behind |
230 |
$query_str =~ s/^ AND //; |
241 |
$query_str =~ s/^ AND //; |
231 |
my %options; |
242 |
my %options; |
|
|
243 |
$options{fields} = \@fields; |
232 |
$options{sort} = \@sort_params; |
244 |
$options{sort} = \@sort_params; |
233 |
$options{expanded_facet} = $params->{expanded_facet}; |
245 |
$options{expanded_facet} = $params->{expanded_facet}; |
234 |
my $query = $self->build_query( $query_str, %options ); |
246 |
my $query = $self->build_query( $query_str, %options ); |