Bugzilla – Attachment 81011 Details for
Bug 18316
Add weighting/relevancy options to ElasticSearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18316: (follow-up) Fix tests and update statement
Bug-18316-follow-up-Fix-tests-and-update-statement.patch (text/plain), 3.29 KB, created by
Ere Maijala
on 2018-10-23 12:06:49 UTC
(
hide
)
Description:
Bug 18316: (follow-up) Fix tests and update statement
Filename:
MIME Type:
Creator:
Ere Maijala
Created:
2018-10-23 12:06:49 UTC
Size:
3.29 KB
patch
obsolete
>From 5c40177c230e09836c2b86adc3d55e0fecb8969a Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 4 Sep 2018 12:46:30 +0000 >Subject: [PATCH] Bug 18316: (follow-up) Fix tests and update statement > >Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> >--- > .../data/mysql/atomicupdate/bug_18316_add-weight-column.perl | 2 +- > t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t | 7 +++---- > t/db_dependent/Koha/SearchField.t | 8 ++++---- > 3 files changed, 8 insertions(+), 9 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_18316_add-weight-column.perl b/installer/data/mysql/atomicupdate/bug_18316_add-weight-column.perl >index a076d8b..7e6710e 100644 >--- a/installer/data/mysql/atomicupdate/bug_18316_add-weight-column.perl >+++ b/installer/data/mysql/atomicupdate/bug_18316_add-weight-column.perl >@@ -1,7 +1,7 @@ > $DBversion = 'XXX'; > if( CheckVersion( $DBversion ) ) { > if( !column_exists( 'search_field', 'weight' ) ) { >- $dbh->do( "ALTER TABLE `search_field` ADD COLUMN `weight` decimal(5,2) DEFAULT NULL" ); >+ $dbh->do( "ALTER TABLE `search_field` ADD COLUMN `weight` decimal(5,2) DEFAULT NULL AFTER `type`" ); > } > > SetVersion( $DBversion ); >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >index a526604..5c1f7f2 100644 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >@@ -17,9 +17,9 @@ > > use Modern::Perl; > >-use Test::More tests => 2; > use C4::Context; > use Test::Exception; >+use t::lib::TestBuilder; > use Test::More tests => 3; > > use Koha::Database; >@@ -160,11 +160,10 @@ subtest 'build_query with weighted fields tests' => sub { > undef, undef, undef, { weighted_fields => 1 }); > > my $fields = $query->{query}{query_string}{fields}; >- > is(scalar(@$fields), 3, 'Search is done on 3 fields'); > is($fields->[0], '_all', 'First search field is _all'); >- is($fields->[1], 'title^25', 'Second search field is title'); >- is($fields->[2], 'subject^15', 'Third search field is subject'); >+ is($fields->[1], 'title^25.00', 'Second search field is title'); >+ is($fields->[2], 'subject^15.00', 'Third search field is subject'); > }; > > $schema->storage->txn_rollback; >diff --git a/t/db_dependent/Koha/SearchField.t b/t/db_dependent/Koha/SearchField.t >index 737d78b..af8f35d 100644 >--- a/t/db_dependent/Koha/SearchField.t >+++ b/t/db_dependent/Koha/SearchField.t >@@ -193,10 +193,10 @@ my @w_fields = Koha::SearchFields->weighted_fields(); > is(scalar(@w_fields), 3, 'weighted_fields should return 3 weighted fields.'); > > is($w_fields[0]->name, 'title', 'First field is title.'); >-is($w_fields[0]->weight, 25, 'Title weight is 25.'); >+is($w_fields[0]->weight+0, 25, 'Title weight is 25.'); > is($w_fields[1]->name, 'subject', 'Second field is subject.'); >-is($w_fields[1]->weight, 15, 'Subject weight is 15.'); >+is($w_fields[1]->weight+0, 15, 'Subject weight is 15.'); > is($w_fields[2]->name, 'author', 'Third field is author.'); >-is($w_fields[2]->weight, 5, 'Author weight is 5.'); >+is($w_fields[2]->weight+0, 5, 'Author weight is 5.'); > >-$schema->storage->txn_rollback; >\ No newline at end of file >+$schema->storage->txn_rollback; >-- >2.7.4
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 18316
:
61472
|
73139
|
73140
|
73492
|
73493
|
73600
|
73601
|
74112
|
74115
|
74116
|
74117
|
74714
|
74720
|
74751
|
74752
|
74753
|
74754
|
75073
|
75074
|
75075
|
75076
|
75458
|
75490
|
75519
|
75520
|
75521
|
75522
|
75523
|
75524
|
75525
|
75526
|
75527
|
75528
|
75529
|
75530
|
75531
|
75536
|
75537
|
75538
|
75539
|
75540
|
75541
|
75699
|
75730
|
77661
|
77662
|
77663
|
77664
|
77665
|
77666
|
77667
|
78396
|
78397
|
78398
|
78399
|
78400
|
78401
|
78402
|
78403
|
80278
|
80335
|
81004
|
81005
|
81006
|
81007
|
81008
|
81009
|
81010
|
81011
|
81012
|
81507
|
81508
|
81509
|
81510
|
81511
|
81512
|
81513
|
81514
|
81515
|
81516
|
82050