|
Lines 60-66
subtest 'reset_elasticsearch_mappings() tests' => sub {
Link Here
|
| 60 |
marc_field => '024a', |
60 |
marc_field => '024a', |
| 61 |
facet => 1, |
61 |
facet => 1, |
| 62 |
suggestible => 1, |
62 |
suggestible => 1, |
| 63 |
sort => 1}); |
63 |
sort => 1, |
|
|
64 |
filter => 'punctuation'}); |
| 64 |
ok($rv, 'Given a mapping table with a custom search field'); |
65 |
ok($rv, 'Given a mapping table with a custom search field'); |
| 65 |
eval { |
66 |
eval { |
| 66 |
$rv = Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings(); |
67 |
$rv = Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings(); |
|
Lines 78-84
subtest 'reset_elasticsearch_mappings() tests' => sub {
Link Here
|
| 78 |
|
79 |
|
| 79 |
subtest 'get_search_mappings() tests' => sub { |
80 |
subtest 'get_search_mappings() tests' => sub { |
| 80 |
|
81 |
|
| 81 |
plan tests => 13; |
82 |
plan tests => 14; |
| 82 |
|
83 |
|
| 83 |
my ($mappings, $mapping); |
84 |
my ($mappings, $mapping); |
| 84 |
|
85 |
|
|
Lines 92-97
subtest 'get_search_mappings() tests' => sub {
Link Here
|
| 92 |
is($mapping->get_column('suggestible'), '0', 'And the search mapping "suggestible" matches'); |
93 |
is($mapping->get_column('suggestible'), '0', 'And the search mapping "suggestible" matches'); |
| 93 |
is($mapping->get_column('sort'), '1', 'And the search mapping "sort" matches'); |
94 |
is($mapping->get_column('sort'), '1', 'And the search mapping "sort" matches'); |
| 94 |
is($mapping->get_column('search'), '1', 'And the search mapping "search" matches'); |
95 |
is($mapping->get_column('search'), '1', 'And the search mapping "search" matches'); |
|
|
96 |
is($mapping->get_column('filter'), '', 'And the searc mapping "filter" matches'); |
| 95 |
is($mapping->get_column('marc_type'), 'marc21', 'And the search mapping "marc_type" matches'); |
97 |
is($mapping->get_column('marc_type'), 'marc21', 'And the search mapping "marc_type" matches'); |
| 96 |
is($mapping->get_column('marc_field'), '007_/0', 'And the search mapping "marc_field" matches'); |
98 |
is($mapping->get_column('marc_field'), '007_/0', 'And the search mapping "marc_field" matches'); |
| 97 |
|
99 |
|
|
Lines 117-123
subtest 'add_mapping() tests' => sub {
Link Here
|
| 117 |
marc_field => '024a', |
119 |
marc_field => '024a', |
| 118 |
facet => 1, |
120 |
facet => 1, |
| 119 |
suggestible => 1, |
121 |
suggestible => 1, |
| 120 |
sort => 1}); |
122 |
sort => 1, |
|
|
123 |
filter => 'punctuation'}); |
| 121 |
$rv = Koha::SearchMappingManager::add_mapping({name => 'ln-test', |
124 |
$rv = Koha::SearchMappingManager::add_mapping({name => 'ln-test', |
| 122 |
label => 'original language', |
125 |
label => 'original language', |
| 123 |
type => '', |
126 |
type => '', |
|
Lines 126-132
subtest 'add_mapping() tests' => sub {
Link Here
|
| 126 |
marc_field => '024a', |
129 |
marc_field => '024a', |
| 127 |
facet => 1, |
130 |
facet => 1, |
| 128 |
suggestible => 1, |
131 |
suggestible => 1, |
| 129 |
sort => 1}); |
132 |
sort => 1, |
|
|
133 |
filter => 'punctuation'}); |
| 130 |
ok(1, "When the same search mapping is added twice"); |
134 |
ok(1, "When the same search mapping is added twice"); |
| 131 |
|
135 |
|
| 132 |
$mappings = Koha::SearchMappingManager::get_search_mappings({index_name => 'biblios', name => 'ln-test'}); |
136 |
$mappings = Koha::SearchMappingManager::get_search_mappings({index_name => 'biblios', name => 'ln-test'}); |
| 133 |
- |
|
|