Bugzilla – Attachment 103700 Details for
Bug 25278
Search fields cache must be separate for different indexes under Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25278: Unit tests
Bug-25278-Unit-tests.patch (text/plain), 2.69 KB, created by
Nick Clemens (kidclamp)
on 2020-04-24 16:33:04 UTC
(
hide
)
Description:
Bug 25278: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-04-24 16:33:04 UTC
Size:
2.69 KB
patch
obsolete
>From 54723c386e12bf0796ef6b70f8528103d1152c35 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 24 Apr 2020 16:32:06 +0000 >Subject: [PATCH] Bug 25278: Unit tests > >--- > .../Koha/SearchEngine/Elasticsearch/QueryBuilder.t | 36 +++++++++++++++++++++- > 1 file changed, 35 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >index 3992e09b18..d1e5a5cab3 100644 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >@@ -548,10 +548,32 @@ subtest 'build query from form subtests' => sub { > }; > > subtest 'build_query with weighted fields tests' => sub { >- plan tests => 4; >+ plan tests => 6; > > $se->mock( '_load_elasticsearch_mappings', sub { > return { >+ authorities => { >+ heading => { >+ label => 'heading', >+ type => 'string', >+ opac => 0, >+ staff_client => 1, >+ mappings => [{ >+ marc_field => '150', >+ marc_type => 'marc21', >+ }] >+ }, >+ headingmain => { >+ label => 'headingmain', >+ type => 'string', >+ opac => 1, >+ staff_client => 1, >+ mappings => [{ >+ marc_field => '150', >+ marc_type => 'marc21', >+ }] >+ } >+ }, > biblios => { > abstract => { > label => 'abstract', >@@ -636,6 +658,18 @@ subtest 'build_query with weighted fields tests' => sub { > ['abstract'], > 'Only OPAC search fields are used when opac search is performed' > ); >+ >+ $qb = Koha::SearchEngine::Elasticsearch::QueryBuilder->new( { index => 'authorities' } ); >+ ( undef, $query ) = $qb->build_query_compat( undef, ['title:"donald duck"'], undef, undef, >+ undef, undef, undef, { weighted_fields => 1 }); >+ $fields = $query->{query}{query_string}{fields}; >+ is_deeply( [sort @$fields], ['heading','headingmain'],'Authorities fields retrieve for authorities index'); >+ >+ ( undef, $query ) = $qb->build_query_compat( undef, ['title:"donald duck"'], undef, undef, >+ undef, undef, undef, { weighted_fields => 1, is_opac => 1 }); >+ $fields = $query->{query}{query_string}{fields}; >+ is_deeply($fields,['headingmain'],'Only opac authorities fields retrieved for authorities index is is_opac'); >+ > }; > > subtest "_convert_sort_fields() tests" => sub { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25278
:
103697
|
103699
|
103700
|
103793
|
104896
|
104897
|
104898
|
104939
|
104944
|
104945
|
104946
|
104947