Lines 192-198
subtest 'build_authorities_query_compat() tests' => sub {
Link Here
|
192 |
}; |
192 |
}; |
193 |
|
193 |
|
194 |
subtest 'build_query tests' => sub { |
194 |
subtest 'build_query tests' => sub { |
195 |
plan tests => 40; |
195 |
plan tests => 41; |
196 |
|
196 |
|
197 |
my $qb; |
197 |
my $qb; |
198 |
|
198 |
|
Lines 214-224
subtest 'build_query tests' => sub {
Link Here
|
214 |
'title__sort.phrase' => { |
214 |
'title__sort.phrase' => { |
215 |
'order' => 'asc' |
215 |
'order' => 'asc' |
216 |
} |
216 |
} |
|
|
217 |
}, |
218 |
{ |
219 |
'local-number.raw' => { |
220 |
'order' => 'desc' |
221 |
} |
217 |
} |
222 |
} |
218 |
], |
223 |
], |
219 |
"sort parameter properly formed" |
224 |
"sort parameter properly formed" |
220 |
); |
225 |
); |
221 |
|
226 |
|
|
|
227 |
$query = $qb->build_query('test', () ); |
228 |
|
229 |
is_deeply( |
230 |
$query->{sort}, |
231 |
[ |
232 |
{ |
233 |
'_score' => { |
234 |
'order' => 'desc' |
235 |
} |
236 |
}, |
237 |
{ |
238 |
'local-number.raw' => { |
239 |
'order' => 'desc' |
240 |
} |
241 |
} |
242 |
], |
243 |
"sort parameter properly formed if no sort passed" |
244 |
); |
245 |
|
246 |
|
247 |
|
222 |
t::lib::Mocks::mock_preference('FacetMaxCount','37'); |
248 |
t::lib::Mocks::mock_preference('FacetMaxCount','37'); |
223 |
$query = $qb->build_query('test', %options); |
249 |
$query = $qb->build_query('test', %options); |
224 |
ok( defined $query->{aggregations}{ccode}{terms}{size},'we need to ask for a size or we get only 5 facet' ); |
250 |
ok( defined $query->{aggregations}{ccode}{terms}{size},'we need to ask for a size or we get only 5 facet' ); |
225 |
- |
|
|