Bug 27770: ES: Deprecated aggregation order key [_term] used, replaced by [_key]
Starting in Elasticsearch 6.0 _key should be used instead of _term to order
buckets by their term
To test:
1) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
2) If you observe an error about types, apply patch for bug 25669
3) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
4) Observe if you get a deprecation warning about order key
5) Apply patch
6) Run prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t
7) Observe no deprecation warning about order key
8) Sign off
Sponsored-by: Lund University Library
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2cd93d8ea6
)
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
parent
b32611ab55
commit
ef98fbfb62
2 changed files with 4 additions and 4 deletions
|
@ -543,8 +543,8 @@ sub _build_scan_query {
|
|||
$index => {
|
||||
terms => {
|
||||
field => $index . '__facet',
|
||||
order => { '_term' => 'asc' },
|
||||
include => $self->_create_regex_filter($self->_clean_search_term($term)) . '.*'
|
||||
order => { '_key' => 'asc' },
|
||||
include => $self->_create_regex_filter($self->clean_search_term($term)) . '.*'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -499,7 +499,7 @@ subtest 'build_query tests' => sub {
|
|||
$query->{aggregations}{'author'}{'terms'},
|
||||
{
|
||||
field => 'author__facet',
|
||||
order => { '_term' => 'asc' },
|
||||
order => { '_key' => 'asc' },
|
||||
include => '[nN][eE][wW].*'
|
||||
},
|
||||
"scan aggregation request is properly formed"
|
||||
|
@ -517,7 +517,7 @@ subtest 'build_query tests' => sub {
|
|||
$query->{aggregations}{'subject'}{'terms'},
|
||||
{
|
||||
field => 'subject__facet',
|
||||
order => { '_term' => 'asc' },
|
||||
order => { '_key' => 'asc' },
|
||||
include => '[nN][eE][wW].*'
|
||||
},
|
||||
"scan aggregation request is properly formed"
|
||||
|
|
Loading…
Reference in a new issue