View | Details | Raw Unified | Return to bug 14567
Collapse All | Expand All

(-)a/Koha/ElasticSearch.pm (-4 / +21 lines)
Lines 1-6 Link Here
1
package Koha::ElasticSearch;
1
package Koha::ElasticSearch;
2
2
3
# Copyright 2013 Catalyst IT
3
# Copyright 2015 Catalyst IT
4
#
4
#
5
# This file is part of Koha.
5
# This file is part of Koha.
6
#
6
#
Lines 177-183 sub get_elasticsearch_mappings { Link Here
177
    my $marcflavour = lc C4::Context->preference('marcflavour');
177
    my $marcflavour = lc C4::Context->preference('marcflavour');
178
    $self->_foreach_mapping(
178
    $self->_foreach_mapping(
179
        sub {
179
        sub {
180
            my ( $name, $type, $facet, $marc_type ) = @_;
180
            my ( $name, $type, $facet, $suggestible, $marc_type ) = @_;
181
            return if $marc_type ne $marcflavour;
181
            return if $marc_type ne $marcflavour;
182
            # TODO if this gets any sort of complexity to it, it should
182
            # TODO if this gets any sort of complexity to it, it should
183
            # be broken out into its own function.
183
            # be broken out into its own function.
Lines 199-204 sub get_elasticsearch_mappings { Link Here
199
                        type            => "string",
199
                        type            => "string",
200
                        copy_to         => "_all.phrase",
200
                        copy_to         => "_all.phrase",
201
                    },
201
                    },
202
                    raw => {
203
                        "type" => "string",
204
                        "index" => "not_analyzed",
205
                    }
202
                },
206
                },
203
            };
207
            };
204
            $mappings->{data}{properties}{$name}{null_value} = 0
208
            $mappings->{data}{properties}{$name}{null_value} = 0
Lines 209-214 sub get_elasticsearch_mappings { Link Here
209
                    index => "not_analyzed",
213
                    index => "not_analyzed",
210
                };
214
                };
211
            }
215
            }
216
            if ($suggestible) {
217
                $mappings->{data}{properties}{ $name . '__suggestion' } = {
218
                    type => 'completion',
219
                    index_analyzer => 'simple',
220
                    search_analyzer => 'simple',
221
                };
222
            }
212
        }
223
        }
213
    );
224
    );
214
    return $mappings;
225
    return $mappings;
Lines 222-228 sub get_fixer_rules { Link Here
222
    my @rules;
233
    my @rules;
223
    $self->_foreach_mapping(
234
    $self->_foreach_mapping(
224
        sub {
235
        sub {
225
            my ( $name, $type, $facet, $marc_type, $marc_field ) = @_;
236
            my ( $name, $type, $facet, $suggestible, $marc_type, $marc_field ) = @_;
226
            return if $marc_type ne $marcflavour;
237
            return if $marc_type ne $marcflavour;
227
            my $options = '';
238
            my $options = '';
228
239
Lines 235-240 sub get_fixer_rules { Link Here
235
            if ($facet) {
246
            if ($facet) {
236
                push @rules, "marc_map('$marc_field','${name}__facet', $options)";
247
                push @rules, "marc_map('$marc_field','${name}__facet', $options)";
237
            }
248
            }
249
            if ($suggestible) {
250
                push @rules,
251
"marc_map('$marc_field','${name}__suggestion.input.\$append', $options)";
252
            }
238
            if ( $type eq 'boolean' ) {
253
            if ( $type eq 'boolean' ) {
239
254
240
                # boolean gets special handling, basically if it doesn't exist,
255
                # boolean gets special handling, basically if it doesn't exist,
Lines 254-260 sub get_fixer_rules { Link Here
254
269
255
    $self->_foreach_mapping(
270
    $self->_foreach_mapping(
256
        sub {
271
        sub {
257
            my ( $name, $type, $facet, $marc_type, $marc_field ) = @_;
272
            my ( $name, $type, $facet, $suggestible, $marc_type, $marc_field ) = @_;
258
            return unless $marc_type eq 'marc21';
273
            return unless $marc_type eq 'marc21';
259
            print "Data comes from: " . $marc_field . "\n";
274
            print "Data comes from: " . $marc_field . "\n";
260
        }
275
        }
Lines 308-319 sub _foreach_mapping { Link Here
308
        my $marc_type = $row->marc_type;
323
        my $marc_type = $row->marc_type;
309
        my $marc_field = $row->marc_field;
324
        my $marc_field = $row->marc_field;
310
        my $facet = $row->facet;
325
        my $facet = $row->facet;
326
        my $suggestible = $row->suggestible;
311
        my $search_field = $row->search_fields();
327
        my $search_field = $row->search_fields();
312
        for my $sf ( $search_field->all ) {
328
        for my $sf ( $search_field->all ) {
313
            $sub->(
329
            $sub->(
314
                $sf->name,
330
                $sf->name,
315
                $sf->type,
331
                $sf->type,
316
                $facet,
332
                $facet,
333
                $suggestible,
317
                $marc_type,
334
                $marc_type,
318
                $marc_field,
335
                $marc_field,
319
            );
336
            );
(-)a/Koha/Schema/Result/SearchField.pm (-3 / +3 lines)
Lines 43-49 the name of the field as it will be stored in the search engine Link Here
43
  extra: {list => ["string","date","number","boolean","sum"]}
43
  extra: {list => ["string","date","number","boolean","sum"]}
44
  is_nullable: 0
44
  is_nullable: 0
45
45
46
what type of data this holds, relevant when storing it
46
what type of data this holds, relevant when storing it in the search engine
47
47
48
=cut
48
=cut
49
49
Lines 114-121 Composing rels: L</search_marc_to_fields> -> search_marc_map Link Here
114
__PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
114
__PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
115
115
116
116
117
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-06-10 14:32:07
117
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-07-24 15:59:15
118
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1pj98qkKkP9g0hJYExud0A
118
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pd5chYwH+KRhI2O8/e7bSg
119
119
120
120
121
# You can replace this text with custom code or comments, and it will be preserved on regeneration
121
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/SearchMarcMap.pm (-2 / +12 lines)
Lines 61-66 the MARC specifier for this field Link Here
61
61
62
true if a facet field should be generated for this
62
true if a facet field should be generated for this
63
63
64
=head2 suggestible
65
66
  data_type: 'tinyint'
67
  default_value: 0
68
  is_nullable: 1
69
70
true if this field can be used to generate suggestions
71
64
=cut
72
=cut
65
73
66
__PACKAGE__->add_columns(
74
__PACKAGE__->add_columns(
Lines 82-87 __PACKAGE__->add_columns( Link Here
82
  { data_type => "varchar", is_nullable => 0, size => 255 },
90
  { data_type => "varchar", is_nullable => 0, size => 255 },
83
  "facet",
91
  "facet",
84
  { data_type => "tinyint", default_value => 0, is_nullable => 1 },
92
  { data_type => "tinyint", default_value => 0, is_nullable => 1 },
93
  "suggestible",
94
  { data_type => "tinyint", default_value => 0, is_nullable => 1 },
85
);
95
);
86
96
87
=head1 PRIMARY KEY
97
=head1 PRIMARY KEY
Lines 142-149 Composing rels: L</search_marc_to_fields> -> search_field Link Here
142
__PACKAGE__->many_to_many("search_fields", "search_marc_to_fields", "search_field");
152
__PACKAGE__->many_to_many("search_fields", "search_marc_to_fields", "search_field");
143
153
144
154
145
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-06-10 14:32:07
155
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-07-24 15:59:15
146
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9Xz04ajKUJXxwJ5pdo+cUQ
156
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/6VCm/kMfCjtmD4Kx3HGMA
147
157
148
158
149
# You can replace this text with custom code or comments, and it will be preserved on regeneration
159
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/Koha/SearchEngine/Elasticsearch/Browse.pm (+185 lines)
Line 0 Link Here
1
package Koha::SearchEngine::Elasticsearch::Browse;
2
3
# Copyright 2015 Catalyst IT
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
=head1 NAME
21
22
Koha::SearchEngine::ElasticSearch::Browse - browse functions for Elasticsearch
23
24
=head1 SYNOPSIS
25
26
    my $browser =
27
      Koha::SearchEngine::Elasticsearch::Browse->new( { index => 'biblios' } );
28
    my $results = $browser->browse(
29
        'prefi', 'title',
30
        {
31
            results   => '500',
32
            fuzziness => 2,
33
        }
34
    );
35
    foreach my $r (@$results) {
36
        push @hits, $r->{text};
37
    }
38
39
=head1 DESCRIPTION
40
41
This provides an easy interface to the "browse" functionality. Essentially,
42
it does a fast prefix search on defined fields. The fields have to be marked
43
as "suggestible" in the database when indexing takes place.
44
45
=head1 METHODS
46
47
=cut
48
49
use base qw(Koha::ElasticSearch);
50
use Modern::Perl;
51
52
use Catmandu::Store::ElasticSearch;
53
54
use Carp;
55
use Data::Dumper;
56
57
Koha::SearchEngine::Elasticsearch::Browse->mk_accessors(qw( store ));
58
59
=head2 browse
60
61
    my $results = $browser->browse($prefix, $field, \%options);
62
63
Does a prefix search for C<$prefix>, looking in C<$field>. Options are:
64
65
=over 4
66
67
=item count
68
69
The number of results to return. For Koha browse purposes, this should
70
probably be fairly high. Defaults to 500.
71
72
=item fuzziness
73
74
How much allowing for typos and misspellings is done. If 0, then it must match
75
exactly. If unspecified, it defaults to '1', which is probably the most useful.
76
Otherwise, it is a number specifying the Levenshtein edit distance relative to
77
the string length, according to the following lengths:
78
79
=over 4
80
81
=item 0..2
82
83
must match exactly
84
85
=item 3..5
86
87
C<fuzziness> edits allowed
88
89
=item >5
90
91
C<fuzziness>+1 edits allowed
92
93
=back
94
95
In all cases the maximum number of edits allowed is two (an elasticsearch
96
restriction.)
97
98
=head3 Returns
99
100
This returns an arrayref of hashrefs. Each hashref contains a "text" element
101
that contains the field as returned. There may be other fields in that 
102
hashref too, but they're less likely to be important.
103
104
The array will be ordered as returned from Elasticsearch, which seems to be
105
in order of some form of relevance.
106
107
=cut
108
109
sub browse {
110
    my ($self, $prefix, $field, $options) = @_;
111
112
    my $params = $self->get_elasticsearch_params();
113
    $self->store(
114
        Catmandu::Store::ElasticSearch->new(
115
            %$params,
116
        )
117
    ) unless $self->store;
118
119
    my $query = $self->_build_query($prefix, $field, $options);
120
    my $results = $self->store->bag->search(%$query);
121
    return $results->{suggest}{suggestions}[0]{options};
122
}
123
124
=head2 _build_query
125
126
    my $query = $self->_build_query($prefix, $field, $options);
127
128
Arguments are the same as for L<browse>. This will return a query structure
129
for elasticsearch to use.
130
131
=cut
132
133
sub _build_query {
134
    my ( $self, $prefix, $field, $options ) = @_;
135
136
    $options = {} unless $options;
137
    my $f = $options->{fuzziness} // 1;
138
    my $l = length($prefix);
139
    my $fuzzie;
140
    if ( $l <= 2 ) {
141
        $fuzzie = 0;
142
    }
143
    elsif ( $l <= 5 ) {
144
        $fuzzie = $f;
145
    }
146
    else {
147
        $fuzzie = $f + 1;
148
    }
149
    $fuzzie = 2 if $fuzzie > 2;
150
151
    my $size = $options->{count} // 500;
152
    my $query = {
153
        # this is an annoying thing, if we set size to 0 it gets rewritten
154
        # to 10. There's a bug somewhere in one of the libraries.
155
        size    => 1,
156
        suggest => {
157
            suggestions => {
158
                text       => $prefix,
159
                completion => {
160
                    field => $field . '__suggestion',
161
                    size  => $size,
162
                    fuzzy => {
163
                        fuzziness => $fuzzie,
164
                    }
165
                }
166
            }
167
        }
168
    };
169
    return $query;
170
}
171
172
1;
173
174
__END__
175
176
=head1 AUTHOR
177
178
=over 4
179
180
=item Robin Sheat C<< <robin@catalyst.net.nz> >>
181
182
=back
183
184
=cut
185
(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-44 / +99 lines)
Lines 31-37 provides something that can be given to elasticsearch to get answers. Link Here
31
31
32
    use Koha::SearchEngine::Elasticsearch;
32
    use Koha::SearchEngine::Elasticsearch;
33
    $builder = Koha::SearchEngine::Elasticsearch->new();
33
    $builder = Koha::SearchEngine::Elasticsearch->new();
34
    my $simple_query = $builder->build_query("hello");
34
    my $simple_query = $builder->build_string_query("hello");
35
    # This is currently undocumented because the original code is undocumented
35
    # This is currently undocumented because the original code is undocumented
36
    my $adv_query = $builder->build_advanced_query($indexes, $operands, $operators);
36
    my $adv_query = $builder->build_advanced_query($indexes, $operands, $operators);
37
37
Lines 49-55 use Data::Dumper; # TODO remove Link Here
49
49
50
=head2 build_query
50
=head2 build_query
51
51
52
    my $simple_query = $builder->build_query("hello", %options)
52
    my $query = $builder->build_query($search, %options);
53
54
C<$search> is an arrayref where each element is a hashref containing
55
a part of the search.
56
57
The hashref must contain a 'term', which is the string, and may contain other
58
things to adjust how the search is performed:
59
60
=over 4
61
62
=item field
63
64
the field to search on, as defined in the C<search_field> table. If
65
unspecified, all fields will be searched over.
66
67
=item exact
68
69
do an exact, literal, phrase match rather than a tokenised search. This will
70
also ignore things like truncation and fuzziness.
71
72
=back
73
74
The C<%options> may be:
75
76
=over 4
77
78
=item and_or
79
80
either "and" or "or", and determines how multiple terms are combined. Default
81
is "and."
82
83
=back
84
85
=head3 Returns
86
87
a query structure intended to be passed to elasticsearch.
88
89
=head3 Note
90
91
This is pretty limited, it's intended that more options be added as necessary
92
to support new functionality.
93
94
=head3 Note 2
95
96
This ultimately ought to be replaced with a query parser driver, but that code
97
is not documented so it'll take a while to figure out.
98
99
=cut
100
101
sub build_query {
102
    my ( $self, $search, %options ) = @_;
103
104
    my @match_parts;
105
106
    foreach my $s (@$search) {
107
        my ( $m_type, $f_suffix, $query_name );
108
109
        # This accounts for different naming of things based on our options
110
        if ( $s->{exact} ) {
111
            $m_type     = 'term';
112
            $f_suffix   = '.raw';
113
            $query_name = 'value';
114
        }
115
        else {
116
            $m_type     = 'match';
117
            $f_suffix   = '';
118
            $query_name = 'query';
119
        }
120
        my $field = $s->{field} // "_all";
121
        my $m = {
122
            $m_type => {
123
                "$s->{field}$f_suffix" => {
124
                    $query_name => $s->{term},
125
                },
126
            },
127
        };
128
        push @match_parts, $m;
129
    }
130
    my $query;
131
    if ( $options{and_or} && lc( $options{and_or} ) eq 'or' ) {
132
        $query->{bool}{should} = \@match_parts;
133
    }
134
    else {
135
        $query->{bool}{must} = \@match_parts;
136
    }
137
    return { query => $query };
138
}
139
140
=head2 build_string_query
141
142
    my $simple_query = $builder->build_string_query("hello", %options)
53
143
54
This will build a query that can be issued to elasticsearch from the provided
144
This will build a query that can be issued to elasticsearch from the provided
55
string input. This expects a lucene style search form (see
145
string input. This expects a lucene style search form (see
Lines 70-78 according to these values. Valid values for C<direction> are 'asc' and 'desc'. Link Here
70
160
71
=back
161
=back
72
162
163
Note: This is mostly for compatibility, ideally it shouldn't get used
164
much.
165
73
=cut
166
=cut
74
167
75
sub build_query {
168
sub build_string_query {
76
    my ( $self, $query, %options ) = @_;
169
    my ( $self, $query, %options ) = @_;
77
170
78
    my $stemming         = C4::Context->preference("QueryStemming")        || 0;
171
    my $stemming         = C4::Context->preference("QueryStemming")        || 0;
Lines 114-157 sub build_query { Link Here
114
    return $res;
207
    return $res;
115
}
208
}
116
209
117
=head2 build_browse_query
118
119
    my $browse_query = $builder->build_browse_query($field, $query);
120
121
This performs a "starts with" style query on a particular field. The field
122
to be searched must have been indexed with an appropriate mapping as a
123
"phrase" subfield, which pretty much everything has.
124
125
=cut
126
# XXX this isn't really a browse query like we want in the end
127
sub build_browse_query {
128
    my ( $self, $field, $query ) = @_;
129
130
    my $fuzzy_enabled = C4::Context->preference("QueryFuzzy") || 0;
131
132
    return { query => '*' } if !defined $query;
133
134
    # TODO this should come from Koha::Elasticsearch
135
    my %field_whitelist = (
136
        title  => 1,
137
        author => 1,
138
    );
139
    $field = 'title' if !exists $field_whitelist{$field};
140
141
    my $res = {
142
        query => {
143
            match_phrase_prefix => {
144
                "$field.phrase" => {
145
                    query     => $query,
146
                    operator  => 'or',
147
                    fuzziness => $fuzzy_enabled ? 'auto' : '0',
148
                }
149
            }
150
        },
151
        sort => [ { "$field.phrase" => { order => "asc" } } ],
152
    };
153
}
154
155
=head2 build_query_compat
210
=head2 build_query_compat
156
211
157
    my (
212
    my (
Lines 208-214 sub build_query_compat { Link Here
208
    $query_str =~ s/^ AND //;
263
    $query_str =~ s/^ AND //;
209
    my %options;
264
    my %options;
210
    $options{sort} = \@sort_params;
265
    $options{sort} = \@sort_params;
211
    my $query = $self->build_query( $query_str, %options );
266
    my $query = $self->build_string_query( $query_str, %options );
212
267
213
    #die Dumper($query);
268
    #die Dumper($query);
214
    # We roughly emulate the CGI parameters of the zebra query builder
269
    # We roughly emulate the CGI parameters of the zebra query builder
Lines 436-442 sub build_authorities_query_compat { Link Here
436
Converts the zebra-style sort index information into elasticsearch-style.
491
Converts the zebra-style sort index information into elasticsearch-style.
437
492
438
C<@sort_by> is the same as presented to L<build_query_compat>, and it returns
493
C<@sort_by> is the same as presented to L<build_query_compat>, and it returns
439
something that can be sent to L<build_query>.
494
something that can be sent to L<build_string_query>.
440
495
441
=cut
496
=cut
442
497
Lines 473-479 sub _convert_sort_fields { Link Here
473
Converts zebra-style search index notation into elasticsearch-style.
528
Converts zebra-style search index notation into elasticsearch-style.
474
529
475
C<@indexes> is an array of index names, as presented to L<build_query_compat>,
530
C<@indexes> is an array of index names, as presented to L<build_query_compat>,
476
and it returns something that can be sent to L<build_query>.
531
and it returns something that can be sent to L<build_string_query>.
477
532
478
B<TODO>: this will pull from the elasticsearch mappings table to figure out
533
B<TODO>: this will pull from the elasticsearch mappings table to figure out
479
types.
534
types.
(-)a/Koha/SearchEngine/Elasticsearch/Search.pm (-21 / +51 lines)
Lines 66-102 an offset (i.e. the number of the record to start with), rather than a page. Link Here
66
66
67
=back
67
=back
68
68
69
Returns 
69
Returns a hashref containing:
70
71
=over 4
72
73
=item records
74
75
an array of hashrefs for each record. Each hashref contains C<marc>, which has
76
a MARC::Record instance, and C<id>, which is the biblionumber of this record.
77
78
=item facets
79
80
facet data from Elasticsearch
81
82
=item hits
83
84
the total number of hits for this search
70
85
71
=cut
86
=cut
72
87
73
sub search {
88
sub search {
74
    my ($self, $query, $page, $count, %options) = @_;
89
    my ( $self, $query, $page, $count, %options ) = @_;
75
90
76
    my $params = $self->get_elasticsearch_params();
91
    my $params = $self->get_elasticsearch_params();
77
    my %paging;
92
    my %paging;
93
78
    # 20 is the default number of results per page
94
    # 20 is the default number of results per page
79
    $paging{limit} = $count || 20;
95
    $paging{limit} = $count || 20;
96
80
    # ES/Catmandu doesn't want pages, it wants a record to start from.
97
    # ES/Catmandu doesn't want pages, it wants a record to start from.
81
    if (exists $options{offset}) {
98
    if ( exists $options{offset} ) {
82
        $paging{start} = $options{offset};
99
        $paging{start} = $options{offset};
83
    } else {
100
    }
84
        $page = (!defined($page) || ($page <= 0)) ? 0 : $page - 1;
101
    else {
102
        $page = ( !defined($page) || ( $page <= 0 ) ) ? 0 : $page - 1;
85
        $paging{start} = $page * $paging{limit};
103
        $paging{start} = $page * $paging{limit};
86
    }
104
    }
87
    $self->store(
105
    $self->store(
88
        Catmandu::Store::ElasticSearch->new(
106
        Catmandu::Store::ElasticSearch->new(
89
            %$params, trace_calls => 1,
107
            %$params, trace_to => 'Stderr',
90
        )
108
        )
91
    ) unless $self->store;
109
    ) unless $self->store;
92
    my $error;
93
    my $results = eval {
110
    my $results = eval {
94
        $self->store->bag->search( %$query, %paging );
111
        $self->store->bag->search( %$query, %paging );
95
    };
112
    };
96
    if ($@) {
113
    if ($@) {
97
        die $self->process_error($@);
114
        die $self->process_error($@);
98
    }
115
    }
99
    return $results;
116
    my @records;
117
    $results->each(
118
        sub {
119
            # The results come in an array for some reason
120
            my $marc_json = @_[0]->{record};
121
            my $marc      = $self->json2marc($marc_json);
122
            push @records, { marc => $marc, id => @_[0]->{_id} };
123
        }
124
    );
125
    return {
126
        records => \@records,
127
        facets  => $results->{facets},
128
        hits    => $results->total
129
    };
100
}
130
}
101
131
102
=head2 count
132
=head2 count
Lines 144-167 sub search_compat { Link Here
144
174
145
    my %options;
175
    my %options;
146
    $options{offset} = $offset;
176
    $options{offset} = $offset;
147
    my $results = $self->search($query, undef, $results_per_page, %options);
177
    my $all_results =
178
      $self->search( $query, undef, $results_per_page, %options );
179
    my $results = [ map { $_->{marc} } @{ $all_results->{records} } ];
180
181
    my ( @records, $index );
182
183
    # opac-search expects results to be put in the right place in the array,
184
    # according to $offset
185
    $records[$offset] = '';    # to grow the array
186
    splice( @records, $offset, scalar(@$results), @$results );
148
187
149
    # Convert each result into a MARC::Record
150
    my (@records, $index);
151
    $index = $offset; # opac-search expects results to be put in the
152
        # right place in the array, according to $offset
153
    $results->each(sub {
154
            # The results come in an array for some reason
155
            my $marc_json = @_[0]->{record};
156
            my $marc = $self->json2marc($marc_json);
157
            $records[$index++] = $marc;
158
        });
159
    # consumers of this expect a name-spaced result, we provide the default
188
    # consumers of this expect a name-spaced result, we provide the default
160
    # configuration.
189
    # configuration.
161
    my %result;
190
    my %result;
162
    $result{biblioserver}{hits} = $results->total;
191
    $result{biblioserver}{hits}    = $all_results->{hits};
163
    $result{biblioserver}{RECORDS} = \@records;
192
    $result{biblioserver}{RECORDS} = \@records;
164
    return (undef, \%result, $self->_convert_facets($results->{facets}));
193
    return ( undef, \%result,
194
        $self->_convert_facets( $all_results->{facets} ) );
165
}
195
}
166
196
167
=head2 search_auth_compat
197
=head2 search_auth_compat
(-)a/installer/data/mysql/elasticsearch_mapping.sql (-227 / +229 lines)
Lines 10-15 CREATE TABLE `elasticsearch_mapping` ( Link Here
10
  `mapping` varchar(255) DEFAULT NULL,
10
  `mapping` varchar(255) DEFAULT NULL,
11
  `type` varchar(255) NOT NULL,
11
  `type` varchar(255) NOT NULL,
12
  `facet` boolean DEFAULT FALSE,
12
  `facet` boolean DEFAULT FALSE,
13
  `suggestible` boolean DEFAULT FALSE,
13
  `marc21` varchar(255) DEFAULT NULL,
14
  `marc21` varchar(255) DEFAULT NULL,
14
  `unimarc` varchar(255) DEFAULT NULL,
15
  `unimarc` varchar(255) DEFAULT NULL,
15
  `normarc` varchar(255) DEFAULT NULL,
16
  `normarc` varchar(255) DEFAULT NULL,
Lines 20-26 CREATE TABLE `elasticsearch_mapping` ( Link Here
20
CREATE TABLE `search_field` (
21
CREATE TABLE `search_field` (
21
  `id` int(11) NOT NULL AUTO_INCREMENT,
22
  `id` int(11) NOT NULL AUTO_INCREMENT,
22
  `name` varchar(255) NOT NULL COMMENT 'the name of the field as it will be stored in the search engine',
23
  `name` varchar(255) NOT NULL COMMENT 'the name of the field as it will be stored in the search engine',
23
  `type` ENUM('string', 'date', 'number', 'boolean', 'sum') NOT NULL COMMENT 'what type of data this holds, relevant when storing it',
24
  `type` ENUM('string', 'date', 'number', 'boolean', 'sum') NOT NULL COMMENT 'what type of data this holds, relevant when storing it in the search engine',
24
  PRIMARY KEY (`id`),
25
  PRIMARY KEY (`id`),
25
  UNIQUE KEY (`name`)
26
  UNIQUE KEY (`name`)
26
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
27
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Lines 33-38 CREATE TABLE `search_marc_map` ( Link Here
33
    marc_type ENUM('marc21', 'unimarc', 'normarc') NOT NULL COMMENT 'what MARC type this map is for',
34
    marc_type ENUM('marc21', 'unimarc', 'normarc') NOT NULL COMMENT 'what MARC type this map is for',
34
    marc_field VARCHAR(255) NOT NULL COMMENT 'the MARC specifier for this field',
35
    marc_field VARCHAR(255) NOT NULL COMMENT 'the MARC specifier for this field',
35
    `facet` boolean DEFAULT FALSE COMMENT 'true if a facet field should be generated for this',
36
    `facet` boolean DEFAULT FALSE COMMENT 'true if a facet field should be generated for this',
37
    `suggestible` boolean DEFAULT FALSE COMMENT 'true if this field can be used to generate suggestions',
36
    PRIMARY KEY(`id`),
38
    PRIMARY KEY(`id`),
37
    INDEX (`index_name`),
39
    INDEX (`index_name`),
38
    UNIQUE KEY (index_name, marc_type, marc_field)
40
    UNIQUE KEY (index_name, marc_type, marc_field)
Lines 51-286 CREATE TABLE `search_marc_to_field` ( Link Here
51
    FOREIGN KEY(search_field_id) REFERENCES search_field(id)
53
    FOREIGN KEY(search_field_id) REFERENCES search_field(id)
52
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
54
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
53
55
54
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','llength',FALSE,'','leader_/1-5',NULL,'leader_/1-5');
56
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','llength',FALSE,FALSE,'','leader_/1-5',NULL,'leader_/1-5');
55
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','rtype',FALSE,'','leader_/6',NULL,'leader_/6');
57
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','rtype',FALSE,FALSE,'','leader_/6',NULL,'leader_/6');
56
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','bib-level',FALSE,'','leader_/7',NULL,'leader_/7');
58
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','bib-level',FALSE,FALSE,'','leader_/7',NULL,'leader_/7');
57
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','control-number',FALSE,'','001',NULL,'001');
59
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','control-number',FALSE,FALSE,'','001',NULL,'001');
58
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','Local-number',FALSE,'string',NULL,'001',NULL);
60
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','Local-number',FALSE,FALSE,'string',NULL,'001',NULL);
59
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','date-time-last-modified',FALSE,'','005','099d',NULL);
61
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','date-time-last-modified',FALSE,FALSE,'','005','099d',NULL);
60
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','microform-generation',FALSE,'','007_/11',NULL,'007_/11');
62
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','microform-generation',FALSE,FALSE,'','007_/11',NULL,'007_/11');
61
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','material-type',FALSE,'','007','','007');
63
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','material-type',FALSE,FALSE,'','007','','007');
62
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff7-00',FALSE,'','007_/1',NULL,'007_/1');
64
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff7-00',FALSE,FALSE,'','007_/1',NULL,'007_/1');
63
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff7-01',FALSE,'','007_/2',NULL,'007_/2');
65
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff7-01',FALSE,FALSE,'','007_/2',NULL,'007_/2');
64
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff7-02',FALSE,'','007_/3',NULL,'007_/3');
66
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff7-02',FALSE,FALSE,'','007_/3',NULL,'007_/3');
65
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff7-01-02',FALSE,'','007_/1-2',NULL,'007_/1-2');
67
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff7-01-02',FALSE,FALSE,'','007_/1-2',NULL,'007_/1-2');
66
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','date-entered-on-file',FALSE,'','008_/1-5','099c','008_/1-5');
68
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','date-entered-on-file',FALSE,FALSE,'','008_/1-5','099c','008_/1-5');
67
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','pubdate',FALSE,'','008_/7-10','100a_/9-12','008_/7-10');
69
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','pubdate',FALSE,FALSE,'','008_/7-10','100a_/9-12','008_/7-10');
68
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','pl',FALSE,'','008_/15-17','','008_/15-17');
70
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','pl',FALSE,FALSE,'','008_/15-17','','008_/15-17');
69
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ta',FALSE,'','008_/22','100a_/17','008_/22');
71
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ta',FALSE,FALSE,'','008_/22','100a_/17','008_/22');
70
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff8-23',FALSE,'','008_/23',NULL,'008_/23');
72
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff8-23',FALSE,FALSE,'','008_/23',NULL,'008_/23');
71
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff8-29',FALSE,'','008_/29','105a_/8','008_/29');
73
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ff8-29',FALSE,FALSE,'','008_/29','105a_/8','008_/29');
72
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','lf',FALSE,'','008_/33','105a_/11','008_/33');
74
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','lf',FALSE,FALSE,'','008_/33','105a_/11','008_/33');
73
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','bio',FALSE,'','008_/34','105a_/12','008_/34');
75
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','bio',FALSE,FALSE,'','008_/34','105a_/12','008_/34');
74
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ln',FALSE,'','008_/35-37','101a','008_/35-37');
76
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ln',FALSE,FALSE,'','008_/35-37','101a','008_/35-37');
75
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ctype',FALSE,'','008_/24-27','105a_/4-7','008_/24-27');
77
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','ctype',FALSE,FALSE,'','008_/24-27','105a_/4-7','008_/24-27');
76
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','record-source',FALSE,'','008_/39','','008_/39');
78
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','record-source',FALSE,FALSE,'','008_/39','','008_/39');
77
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','lc-cardnumber',FALSE,'','010','995j','010');
79
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','lc-cardnumber',FALSE,FALSE,'','010','995j','010');
78
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','lc-cardnumber',FALSE,'','011',NULL,NULL);
80
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','lc-cardnumber',FALSE,FALSE,'','011',NULL,NULL);
79
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,'','010',NULL,'010');
81
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,FALSE,'','010',NULL,'010');
80
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,'','011',NULL,NULL);
82
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,FALSE,'','011',NULL,NULL);
81
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','bnb-card-number',FALSE,'','015',NULL,'015');
83
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','bnb-card-number',FALSE,FALSE,'','015',NULL,'015');
82
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','bgf-number',FALSE,'','015',NULL,'015');
84
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','bgf-number',FALSE,FALSE,'','015',NULL,'015');
83
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','number-db',FALSE,'','015',NULL,'015');
85
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','number-db',FALSE,FALSE,'','015',NULL,'015');
84
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','number-natl-biblio',FALSE,'','015',NULL,'015');
86
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','number-natl-biblio',FALSE,FALSE,'','015',NULL,'015');
85
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,'','015',NULL,'015');
87
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,FALSE,'','015',NULL,'015');
86
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','number-legal-deposit',FALSE,'','017',NULL,NULL);
88
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','number-legal-deposit',FALSE,FALSE,'','017',NULL,NULL);
87
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,'','017',NULL,NULL);
89
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,FALSE,'','017',NULL,NULL);
88
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,'','018',NULL,NULL);
90
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,FALSE,'','018',NULL,NULL);
89
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,'','020a','010az','020a');
91
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,FALSE,'','020a','010az','020a');
90
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','isbn',FALSE,'','020a','010az','020a');
92
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','isbn',FALSE,FALSE,'','020a','010az','020a');
91
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,'','022a','011ayz','022a');
93
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','identifier-standard',FALSE,FALSE,'','022a','011ayz','022a');
92
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','issn',FALSE,'','022a','011ayz','022a');
94
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','issn',FALSE,FALSE,'','022a','011ayz','022a');
93
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,'string','100a','200f','100a');
95
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,TRUE,'string','100a','200f','100a');
94
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,'string','110a','200g','110a');
96
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,TRUE,'string','110a','200g','110a');
95
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,'string','111a',NULL,'111a');
97
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,TRUE,'string','111a',NULL,'111a');
96
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,'string','700a','700a','700a');
98
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',TRUE,TRUE,'string','700a','700a','700a');
97
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',FALSE,'string','245c','701','245c');
99
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','author',FALSE,FALSE,'string','245c','701','245c');
98
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','245a','200a','245a');
100
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,TRUE,'string','245a','200a','245a');
99
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','246','200c','246');
101
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,TRUE,'string','246','200c','246');
100
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','247','200d','247');
102
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,TRUE,'string','247','200d','247');
101
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','490','200e','490a');
103
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,TRUE,'string','490a','200e','490a');
102
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','505t','200h',NULL);
104
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,TRUE,'string','505t','200h',NULL);
103
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','711t','200i','711t');
105
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,TRUE,'string','711t','200i','711t');
104
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','700t','205','700t');
106
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,TRUE,'string','700t','205','700t');
105
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','710t','304a','710t');
107
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,TRUE,'string','710t','304a','710t');
106
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','730','327a','730');
108
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','730','327a','730');
107
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','740','327b','740');
109
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','740','327b','740');
108
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','780','327c','780');
110
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','780','327c','780');
109
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','785','327d','785');
111
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','785','327d','785');
110
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','130','327e','130');
112
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','130','327e','130');
111
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','210','327f','210');
113
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','210','327f','210');
112
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','211','327g',NULL);
114
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','211','327g',NULL);
113
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','212','327h',NULL);
115
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','212','327h',NULL);
114
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','214','327i',NULL);
116
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','214','327i',NULL);
115
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','222','328t','222');
117
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','222','328t','222');
116
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string','240','410t','240');
118
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string','240','410t','240');
117
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'411t',NULL);
119
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'411t',NULL);
118
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'412t',NULL);
120
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'412t',NULL);
119
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'413t',NULL);
121
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'413t',NULL);
120
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'421t',NULL);
122
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'421t',NULL);
121
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'422t',NULL);
123
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'422t',NULL);
122
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'423t',NULL);
124
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'423t',NULL);
123
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'424t',NULL);
125
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'424t',NULL);
124
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'425t',NULL);
126
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'425t',NULL);
125
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'430t',NULL);
127
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'430t',NULL);
126
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'431t',NULL);
128
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'431t',NULL);
127
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'432t',NULL);
129
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'432t',NULL);
128
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'433t',NULL);
130
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'433t',NULL);
129
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'434t',NULL);
131
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'434t',NULL);
130
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'435t',NULL);
132
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'435t',NULL);
131
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'436t',NULL);
133
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'436t',NULL);
132
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'437t',NULL);
134
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'437t',NULL);
133
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'440t',NULL);
135
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'440t',NULL);
134
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'441t',NULL);
136
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'441t',NULL);
135
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'442t',NULL);
137
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'442t',NULL);
136
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'443t',NULL);
138
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'443t',NULL);
137
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'444t',NULL);
139
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'444t',NULL);
138
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'445t',NULL);
140
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'445t',NULL);
139
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'446t',NULL);
141
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'446t',NULL);
140
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'447t',NULL);
142
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'447t',NULL);
141
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'448t',NULL);
143
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'448t',NULL);
142
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'451t',NULL);
144
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'451t',NULL);
143
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'452t',NULL);
145
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'452t',NULL);
144
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'453t',NULL);
146
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'453t',NULL);
145
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'454t',NULL);
147
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'454t',NULL);
146
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'455t',NULL);
148
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'455t',NULL);
147
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'456t',NULL);
149
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'456t',NULL);
148
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'461t',NULL);
150
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'461t',NULL);
149
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'462t',NULL);
151
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'462t',NULL);
150
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'463t',NULL);
152
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'463t',NULL);
151
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'464t',NULL);
153
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'464t',NULL);
152
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'470t',NULL);
154
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'470t',NULL);
153
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'481t',NULL);
155
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'481t',NULL);
154
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'482t',NULL);
156
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'482t',NULL);
155
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,'string',NULL,'488t',NULL);
157
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','title',FALSE,FALSE,'string',NULL,'488t',NULL);
156
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','600a','600a','600a');
158
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','600a','600a','600a');
157
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','600t','600','600t');
159
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','600t','600','600t');
158
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','610a','601','610a');
160
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','610a','601','610a');
159
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','610t','602','610t');
161
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','610t','602','610t');
160
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','611','604','611');
162
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','611','604','611');
161
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','630n','605','630n');
163
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','630n','605','630n');
162
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','630r','606','630r');
164
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','630r','606','630r');
163
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','650a','607','650a');
165
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','650a','607','650a');
164
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','650b',NULL,'650b');
166
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','650b',NULL,'650b');
165
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','650c',NULL,'650c');
167
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','650c',NULL,'650c');
166
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','650d',NULL,'650d');
168
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','650d',NULL,'650d');
167
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','650v',NULL,'650v');
169
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','650v',NULL,'650v');
168
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','650x',NULL,'650x');
170
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','650x',NULL,'650x');
169
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','650y',NULL,'650y');
171
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','650y',NULL,'650y');
170
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','650z',NULL,'650z');
172
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','650z',NULL,'650z');
171
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','651','608','651');
173
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','651','608','651');
172
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,'string','653a','610','653');
174
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','subject',TRUE,TRUE,'string','653a','610','653');
173
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','local-classification',FALSE,'','952o','995k','952o');
175
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','local-classification',FALSE,TRUE,'','952o','995k','952o');
174
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','local-classification',FALSE,'',NULL,'686',NULL);
176
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','local-classification',FALSE,FALSE,'',NULL,'686',NULL);
175
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','Local-number',FALSE,'string','999c','001','999c');
177
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','Local-number',FALSE,FALSE,'string','999c','001','999c');
176
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','Local-number',FALSE,'string',NULL,'0909',NULL);
178
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','Local-number',FALSE,FALSE,'string',NULL,'0909',NULL);
177
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','itype',TRUE,'string','942c','200b','942c');
179
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','itype',TRUE,FALSE,'string','942c','200b','942c');
178
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','itype',TRUE,'string','952y','995r','952y');
180
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','itype',TRUE,FALSE,'string','952y','995r','952y');
179
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','acqdate',FALSE,'date','952d','9955','952d');
181
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','acqdate',FALSE,FALSE,'date','952d','9955','952d');
180
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','place',TRUE,'string','260a','210a','260a');
182
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','place',TRUE,FALSE,'string','260a','210a','260a');
181
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','publisher',TRUE,'string','260b','210c','260b');
183
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','publisher',TRUE,FALSE,'string','260b','210c','260b');
182
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','copydate',TRUE,'date','260c',NULL,'260c'); -- No copydate for unimarc? Seems strange.
184
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','copydate',TRUE,FALSE,'date','260c',NULL,'260c'); -- No copydate for unimarc? Seems strange.
183
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','homebranch',TRUE,'string','952a','995b','952a');
185
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','homebranch',TRUE,FALSE,'string','952a','995b','952a');
184
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','holdingbranch',TRUE,'string','952b','995c','952b');
186
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','holdingbranch',TRUE,FALSE,'string','952b','995c','952b');
185
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','onloan',FALSE,'boolean','952q','995n','952q');
187
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','onloan',FALSE,FALSE,'boolean','952q','995n','952q');
186
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','itemnumber',FALSE,'number','9529','9959','9529');
188
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','itemnumber',FALSE,FALSE,'number','9529','9959','9529');
187
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','issues',FALSE,'sum','952l',NULL,'952l'); -- Apparently not tracked in unimarc
189
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','issues',FALSE,FALSE,'sum','952l',NULL,'952l'); -- Apparently not tracked in unimarc
188
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','1009','7009','1009');
190
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','1009','7009','1009');
189
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','1109','7019','1109');
191
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','1109','7019','1109');
190
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','1119','7029','1119');
192
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','1119','7029','1119');
191
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','1309','7109','1309');
193
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','1309','7109','1309');
192
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','2459','7119','2459');
194
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','2459','7119','2459');
193
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','4009','7129','4409');
195
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','4009','7129','4409');
194
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','4109','7169','4909');
196
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','4109','7169','4909');
195
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','4409','7209','6009');
197
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','4409','7209','6009');
196
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','4909','7219','6109');
198
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','4909','7219','6109');
197
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6009','7229','6119');
199
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6009','7229','6119');
198
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6109','7309','6309');
200
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6109','7309','6309');
199
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6119','5009','6509');
201
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6119','5009','6509');
200
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6309','5019','6519');
202
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6309','5019','6519');
201
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6509','5039','6529');
203
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6509','5039','6529');
202
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6519','5109','6539');
204
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6519','5109','6539');
203
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6529','5129','6549');
205
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6529','5129','6549');
204
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6539','5139','6559');
206
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6539','5139','6559');
205
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6549','5149','6569');
207
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6549','5149','6569');
206
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6559','5159','6579');
208
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6559','5159','6579');
207
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6569','5169','6909');
209
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6569','5169','6909');
208
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6579','5179','7009');
210
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6579','5179','7009');
209
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','6909','5189','7109');
211
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','6909','5189','7109');
210
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','7009','5199','7119');
212
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','7009','5199','7119');
211
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','7109','5209','7309');
213
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','7109','5209','7309');
212
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','7119','5309','8009');
214
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','7119','5309','8009');
213
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','7309','5319','8109');
215
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','7309','5319','8109');
214
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','7519','5329','8119');
216
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','7519','5329','8119');
215
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','8009','5409','8309');
217
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','8009','5409','8309');
216
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','8109','5419',NULL);
218
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','8109','5419',NULL);
217
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','8119','5459',NULL);
219
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','8119','5459',NULL);
218
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number','8309','5609',NULL);
220
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number','8309','5609',NULL);
219
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6009',NULL);
221
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6009',NULL);
220
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6019',NULL);
222
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6019',NULL);
221
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6029',NULL);
223
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6029',NULL);
222
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6049',NULL);
224
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6049',NULL);
223
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6059',NULL);
225
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6059',NULL);
224
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6069',NULL);
226
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6069',NULL);
225
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6079',NULL);
227
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6079',NULL);
226
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6089',NULL);
228
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6089',NULL);
227
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6109',NULL);
229
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6109',NULL);
228
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6159',NULL);
230
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6159',NULL);
229
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6169',NULL);
231
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6169',NULL);
230
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6179',NULL);
232
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6179',NULL);
231
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6209',NULL);
233
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6209',NULL);
232
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,'number',NULL,'6219',NULL);
234
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','an',FALSE,FALSE,'number',NULL,'6219',NULL);
233
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','Host-Item-Number',FALSE,'number','7739','4619','7739');
235
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('biblios','Host-Item-Number',FALSE,FALSE,'number','7739','4619','7739');
234
236
235
-- Authorities: incomplete 
237
-- Authorities: incomplete 
236
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Local-number',FALSE,'string','001',NULL,'001');
238
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Local-number',FALSE,FALSE,'string','001',NULL,'001');
237
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','authtype',FALSE,'','942a',NULL,'942a');
239
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','authtype',FALSE,FALSE,'','942a',NULL,'942a');
238
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Kind-of-record',FALSE,'','008_/9',NULL,'008_/9');
240
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Kind-of-record',FALSE,FALSE,'','008_/9',NULL,'008_/9');
239
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Descriptive-cataloging-rules',FALSE,'','008_/10',NULL,'008_/10');
241
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Descriptive-cataloging-rules',FALSE,FALSE,'','008_/10',NULL,'008_/10');
240
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Subject-heading-thesaurus',FALSE,'','008_/11',NULL,'008_/11');
242
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Subject-heading-thesaurus',FALSE,FALSE,'','008_/11',NULL,'008_/11');
241
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading-use-main-or-added-entry',FALSE,'','008_/14',NULL,'008_/14');
243
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading-use-main-or-added-entry',FALSE,FALSE,'','008_/14',NULL,'008_/14');
242
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading-use-subject-added-entry',FALSE,'','008_/15',NULL,'008_/15');
244
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading-use-subject-added-entry',FALSE,FALSE,'','008_/15',NULL,'008_/15');
243
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading-use-series-added-entry',FALSE,'','008_/16',NULL,'008_/16');
245
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading-use-series-added-entry',FALSE,FALSE,'','008_/16',NULL,'008_/16');
244
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','LC-card-number',FALSE,'','010az',NULL,'010az');
246
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','LC-card-number',FALSE,FALSE,'','010az',NULL,'010az');
245
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Record-source',FALSE,'','040acd',NULL,'040acd');
247
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Record-source',FALSE,FALSE,'','040acd',NULL,'040acd');
246
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Personal-name',FALSE,'','100abcdefghjklmnopqrstvxyz',NULL,'100abcdefghjklmnopqrstvxyz');
248
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Personal-name',FALSE,FALSE,'','100abcdefghjklmnopqrstvxyz',NULL,'100abcdefghjklmnopqrstvxyz');
247
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Personal-name-heading',FALSE,'','100abcdefghjklmnopqrstvxyz',NULL,'100abcdefghjklmnopqrstvxyz');
249
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Personal-name-heading',FALSE,FALSE,'','100abcdefghjklmnopqrstvxyz',NULL,'100abcdefghjklmnopqrstvxyz');
248
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading',FALSE,'','100abcdefghjklmnopqrstvxyz',NULL,'100abcdefghjklmnopqrstvxyz');
250
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading',FALSE,FALSE,'','100abcdefghjklmnopqrstvxyz',NULL,'100abcdefghjklmnopqrstvxyz');
249
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading-main',FALSE,'','100a',NULL,'100a');
251
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading-main',FALSE,FALSE,'','100a',NULL,'100a');
250
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,'','100abcdefghjklmnopqrstvxyz',NULL,'100abcdefghjklmnopqrstvxyz');
252
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,FALSE,'','100abcdefghjklmnopqrstvxyz',NULL,'100abcdefghjklmnopqrstvxyz');
251
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match-heading',FALSE,'','100abcdefghjklmnopqrstvxyz',NULL,'100abcdefghjklmnopqrstvxyz');
253
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match-heading',FALSE,FALSE,'','100abcdefghjklmnopqrstvxyz',NULL,'100abcdefghjklmnopqrstvxyz');
252
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Personal-name-see-from',FALSE,'','400abcdefghjklmnopqrstvxyz',NULL,'400abcdefghjklmnopqrstvxyz');
254
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Personal-name-see-from',FALSE,FALSE,'','400abcdefghjklmnopqrstvxyz',NULL,'400abcdefghjklmnopqrstvxyz');
253
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-from',FALSE,'','400abcdefghjklmnopqrstvxyz',NULL,'400abcdefghjklmnopqrstvxyz');
255
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-from',FALSE,FALSE,'','400abcdefghjklmnopqrstvxyz',NULL,'400abcdefghjklmnopqrstvxyz');
254
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,'','400abcdefghjklmnopqrstvxyz',NULL,'400abcdefghjklmnopqrstvxyz');
256
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,FALSE,'','400abcdefghjklmnopqrstvxyz',NULL,'400abcdefghjklmnopqrstvxyz');
255
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match-heading-see-from',FALSE,'','400abcdefghjklmnopqrstvxyz',NULL,'400abcdefghjklmnopqrstvxyz');
257
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match-heading-see-from',FALSE,FALSE,'','400abcdefghjklmnopqrstvxyz',NULL,'400abcdefghjklmnopqrstvxyz');
256
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Personal-name-see-also-from',FALSE,'','500abcdefghjklmnopqrstvxyz',NULL,'500abcdefghjklmnopqrstvxyz');
258
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Personal-name-see-also-from',FALSE,FALSE,'','500abcdefghjklmnopqrstvxyz',NULL,'500abcdefghjklmnopqrstvxyz');
257
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-also-from',FALSE,'','500abcdefghjklmnopqrstvxyz',NULL,'500abcdefghjklmnopqrstvxyz');
259
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-also-from',FALSE,FALSE,'','500abcdefghjklmnopqrstvxyz',NULL,'500abcdefghjklmnopqrstvxyz');
258
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,'','500abcdefghjklmnopqrstvxyz',NULL,'500abcdefghjklmnopqrstvxyz');
260
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,FALSE,'','500abcdefghjklmnopqrstvxyz',NULL,'500abcdefghjklmnopqrstvxyz');
259
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Corporate-name-see-from',FALSE,'','410abcdefghklmnoprstvxyz',NULL,'410abcdefghklmnoprstvxyz');
261
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Corporate-name-see-from',FALSE,FALSE,'','410abcdefghklmnoprstvxyz',NULL,'410abcdefghklmnoprstvxyz');
260
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-from',FALSE,'','410abcdefghklmnoprstvxyz',NULL,'410abcdefghklmnoprstvxyz');
262
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-from',FALSE,FALSE,'','410abcdefghklmnoprstvxyz',NULL,'410abcdefghklmnoprstvxyz');
261
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,'','410abcdefghklmnoprstvxyz',NULL,'410abcdefghklmnoprstvxyz');
263
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,FALSE,'','410abcdefghklmnoprstvxyz',NULL,'410abcdefghklmnoprstvxyz');
262
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match-heading-see-from',FALSE,'','410abcdefghklmnoprstvxyz',NULL,'410abcdefghklmnoprstvxyz');
264
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match-heading-see-from',FALSE,FALSE,'','410abcdefghklmnoprstvxyz',NULL,'410abcdefghklmnoprstvxyz');
263
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Corporate-name-see-also-from',FALSE,'','510abcdefghklmnoprstvxyz',NULL,'510abcdefghklmnoprstvxyz');
265
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Corporate-name-see-also-from',FALSE,FALSE,'','510abcdefghklmnoprstvxyz',NULL,'510abcdefghklmnoprstvxyz');
264
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-also-from',FALSE,'','510abcdefghklmnoprstvxyz',NULL,'510abcdefghklmnoprstvxyz');
266
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-also-from',FALSE,FALSE,'','510abcdefghklmnoprstvxyz',NULL,'510abcdefghklmnoprstvxyz');
265
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,'','510abcdefghklmnoprstvxyz',NULL,'510abcdefghklmnoprstvxyz');
267
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,FALSE,'','510abcdefghklmnoprstvxyz',NULL,'510abcdefghklmnoprstvxyz');
266
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Meeting-name',FALSE,'','111acdefghjklnpqstvxyz',NULL,'111acdefghjklnpqstvxyz');
268
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Meeting-name',FALSE,FALSE,'','111acdefghjklnpqstvxyz',NULL,'111acdefghjklnpqstvxyz');
267
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Meeting-name-heading',FALSE,'','111acdefghjklnpqstvxyz',NULL,'111acdefghjklnpqstvxyz');
269
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Meeting-name-heading',FALSE,FALSE,'','111acdefghjklnpqstvxyz',NULL,'111acdefghjklnpqstvxyz');
268
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading',FALSE,'','111acdefghjklnpqstvxyz',NULL,'111acdefghjklnpqstvxyz');
270
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading',FALSE,FALSE,'','111acdefghjklnpqstvxyz',NULL,'111acdefghjklnpqstvxyz');
269
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading-Main',FALSE,'','111a',NULL,'111a');
271
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Heading-Main',FALSE,FALSE,'','111a',NULL,'111a');
270
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,'','111acdefghjklnpqstvxyz',NULL,'111acdefghjklnpqstvxyz');
272
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,FALSE,'','111acdefghjklnpqstvxyz',NULL,'111acdefghjklnpqstvxyz');
271
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match-heading',FALSE,'','111acdefghjklnpqstvxyz',NULL,'111acdefghjklnpqstvxyz');
273
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match-heading',FALSE,FALSE,'','111acdefghjklnpqstvxyz',NULL,'111acdefghjklnpqstvxyz');
272
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Meeting-name-see-from',FALSE,'','411acdefghjklnpqstvxyz',NULL,'411acdefghjklnpqstvxyz');
274
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Meeting-name-see-from',FALSE,FALSE,'','411acdefghjklnpqstvxyz',NULL,'411acdefghjklnpqstvxyz');
273
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-from',FALSE,'','411acdefghjklnpqstvxyz',NULL,'411acdefghjklnpqstvxyz');
275
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-from',FALSE,FALSE,'','411acdefghjklnpqstvxyz',NULL,'411acdefghjklnpqstvxyz');
274
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,'','411acdefghjklnpqstvxyz',NULL,'411acdefghjklnpqstvxyz');
276
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,FALSE,'','411acdefghjklnpqstvxyz',NULL,'411acdefghjklnpqstvxyz');
275
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match-heading-see-from',FALSE,'','411acdefghjklnpqstvxyz',NULL,'411acdefghjklnpqstvxyz');
277
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match-heading-see-from',FALSE,FALSE,'','411acdefghjklnpqstvxyz',NULL,'411acdefghjklnpqstvxyz');
276
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Meeting-name-see-also-from',FALSE,'','511acdefghjklnpqstvxyz',NULL,'511acdefghjklnpqstvxyz');
278
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Meeting-name-see-also-from',FALSE,FALSE,'','511acdefghjklnpqstvxyz',NULL,'511acdefghjklnpqstvxyz');
277
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-also-from',FALSE,'','511acdefghjklnpqstvxyz',NULL,'511acdefghjklnpqstvxyz');
279
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','See-also-from',FALSE,FALSE,'','511acdefghjklnpqstvxyz',NULL,'511acdefghjklnpqstvxyz');
278
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,'','511acdefghjklnpqstvxyz',NULL,'511acdefghjklnpqstvxyz');
280
INSERT INTO `elasticsearch_mapping` (`indexname`, `mapping`, `facet`, `suggestible`, `type`, `marc21`, `unimarc`, `normarc`) VALUES ('authorities','Match',FALSE,FALSE,'','511acdefghjklnpqstvxyz',NULL,'511acdefghjklnpqstvxyz');
279
281
280
-- temporary to convert into new table form
282
-- temporary to convert into new table form
281
insert into search_marc_map(index_name, marc_type, marc_field, facet) select distinct indexname, 'marc21', marc21, facet from elasticsearch_mapping where marc21 is not null;
283
insert into search_marc_map(index_name, marc_type, marc_field, facet, suggestible) select distinct indexname, 'marc21', marc21, facet, suggestible from elasticsearch_mapping where marc21 is not null;
282
insert into search_marc_map(index_name, marc_type, marc_field, facet) select distinct indexname, 'unimarc', unimarc, facet from elasticsearch_mapping where unimarc is not null;
284
insert into search_marc_map(index_name, marc_type, marc_field, facet, suggestible) select distinct indexname, 'unimarc', unimarc, facet, suggestible from elasticsearch_mapping where unimarc is not null;
283
insert into search_marc_map(index_name, marc_type, marc_field, facet) select distinct indexname, 'normarc', normarc, facet from elasticsearch_mapping where normarc is not null;
285
insert into search_marc_map(index_name, marc_type, marc_field, facet, suggestible) select distinct indexname, 'normarc', normarc, facet, suggestible from elasticsearch_mapping where normarc is not null;
284
insert into search_field (name, type) select distinct mapping, type from elasticsearch_mapping;
286
insert into search_field (name, type) select distinct mapping, type from elasticsearch_mapping;
285
287
286
insert into search_marc_to_field(search_marc_map_id, search_field_id) select search_marc_map.id,search_field.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='marc21' AND indexname='biblios' AND index_name='biblios';
288
insert into search_marc_to_field(search_marc_map_id, search_field_id) select search_marc_map.id,search_field.id from search_field, search_marc_map, elasticsearch_mapping where elasticsearch_mapping.mapping=search_field.name AND elasticsearch_mapping.marc21=search_marc_map.marc_field AND search_marc_map.marc_type='marc21' AND indexname='biblios' AND index_name='biblios';
(-)a/opac/opac-browse.pl (+136 lines)
Line 0 Link Here
1
#!/usr/bin/perl 
2
3
# This is a CGI script that handles the browse feature.
4
5
# Copyright 2015 Catalyst IT
6
#
7
# This file is part of Koha.
8
#
9
# Koha is free software; you can redistribute it and/or modify it under the
10
# terms of the GNU General Public License as published by the Free Software
11
# Foundation; either version 3 of the License, or (at your option) any later
12
# version.
13
#
14
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License along
19
# with Koha; if not, write to the Free Software Foundation, Inc.,
20
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22
use Modern::Perl;
23
use CGI qw( -utf8 :standard );
24
25
use C4::Auth;
26
use C4::Context;
27
28
use Koha::ElasticSearch;
29
use Koha::SearchEngine::Elasticsearch::Browse;
30
use Koha::SearchEngine::Elasticsearch::QueryBuilder;
31
use Koha::SearchEngine::Elasticsearch::Search;
32
33
use JSON;
34
use Unicode::Collate;
35
36
my $query = new CGI;
37
binmode STDOUT, ':utf8';
38
39
# This is the temporary entrance point to the API. Once bug #13799 is settled,
40
# it should be ported to using that.
41
my $api = $query->param('api');
42
43
if ( !$api ) {
44
45
    # No parameters, so we just render the template.
46
47
}
48
elsif ( $api eq 'GetSuggestions' ) {
49
    my $fuzzie = $query->param('fuzziness');
50
    my $prefix = $query->param('prefix');
51
    my $field  = $query->param('field');
52
53
# Under a persistant environment, we should probably not reinit this every time.
54
    my $browser =
55
      Koha::SearchEngine::Elasticsearch::Browse->new( { index => 'biblios' } );
56
    my $res = $browser->browse( $prefix, $field, { fuzziness => $fuzzie } );
57
    my $collator = Unicode::Collate->new();
58
59
    # possible optimisation is to cache the collated values and do a straight
60
    # cmp.
61
    my @sorted = sort { $collator->cmp( $a->{text}, $b->{text} ) } @$res;
62
    print header(
63
        -type    => 'application/json',
64
        -charset => 'utf-8'
65
    );
66
    print to_json( \@sorted );
67
}
68
elsif ( $api eq 'GetResults' ) {
69
    my $term  = $query->param('term');
70
    my $field = $query->param('field');
71
72
    my $builder  = Koha::SearchEngine::Elasticsearch::QueryBuilder->new();
73
    my $searcher = Koha::SearchEngine::Elasticsearch::Search->new(
74
        { index => $Koha::ElasticSearch::BIBLIOS_INDEX } );
75
76
    my $query = $builder->build_query(
77
        [ { term => $term, field => $field, exact => 1 } ] );
78
    my $results = $searcher->search( $query, undef, 500 );
79
    my @output = _filter_for_output( $results->{records} );
80
    print header(
81
        -type    => 'application/json',
82
        -charset => 'utf-8'
83
    );
84
    print to_json( \@output );
85
}
86
87
# This is a temporary, MARC21-only thing that will grab titles, authors,
88
# and subjects. This should probably be done with some templatey gizmo
89
# in the future.
90
sub _filter_for_output {
91
    no warnings 'qw';    # it doesn't like the , in the qw
92
    my ($records) = @_;
93
94
    my @author_marc = qw(100,a 110,a 111,a 700,a 710,a 711,a);
95
    my @subjects_marc =
96
      qw(600 610 611 630 648 650 651);
97
    my @output;
98
    foreach my $rec (@$records) {
99
        my $marc = $rec->{marc};
100
        my $title;
101
        {
102
            # we do an ugly hack to fix up a little bit of bad formatting.
103
            my ($t_a, $t_b, $t_c) =
104
            (( $marc->subfield( 245, 'a' ) // '' ),
105
             ( $marc->subfield( 245, 'b' ) // '' ),
106
             ( $marc->subfield( 245, 'c' ) // '' ));
107
            $t_a .= ' ' unless $t_a =~ / $/;
108
            $t_b .= ' ' unless $t_b =~ / $/;
109
            $title = $t_a . $t_b . $t_c;
110
        }
111
        my @authors;
112
        foreach my $m (@author_marc) {
113
            push @authors, ( $marc->subfield( split( ',', $m ) ) // () );
114
        }
115
        my @subj_fields;
116
        foreach my $m (@subjects_marc) {
117
            # first collect all the fields
118
            push @subj_fields, $marc->field($m);
119
        }
120
        # Now grab the a and x from each field and reformat it
121
        my @subjects;
122
        foreach my $s (@subj_fields) {
123
            my @vals = (scalar($s->subfield('a')), $s->subfield('x'));
124
            next unless @vals;
125
            push @subjects, join( ' -- ', @vals );
126
        }
127
        push @output,
128
          {
129
            id => $rec->{id},
130
            title    => $title,
131
            authors  => \@authors,
132
            subjects => \@subjects,
133
          };
134
    }
135
    return @output;
136
}
(-)a/t/Koha_SearchEngine_Elasticsearch_Browse.t (-1 / +68 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# Copyright 2015 Catalyst IT
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Test::More;
23
24
use_ok('Koha::SearchEngine::Elasticsearch::Browse');
25
26
# testing browse itself not implemented as it'll require a running ES
27
can_ok('Koha::SearchEngine::Elasticsearch::Browse',
28
    qw/ _build_query browse /);
29
30
subtest "_build_query tests" => sub {
31
    plan tests => 2;
32
33
    my $browse = Koha::SearchEngine::Elasticsearch::Browse->new({index=>'dummy'});
34
    my $q = $browse->_build_query('foo', 'title');
35
    is_deeply($q, { size => 1,
36
        suggest => {
37
            suggestions => {
38
                text       => 'foo',
39
                completion => {
40
                    field => 'title__suggestion',
41
                    size  => 500,
42
                    fuzzy => {
43
                        fuzziness => 1,
44
                    }
45
                }
46
            }
47
        }
48
    }, 'No fuzziness or size specified');
49
50
    # Note that a fuzziness of 4 will get reduced to 2.
51
    $q = $browse->_build_query('foo', 'title', { fuzziness => 4, count => 400 });
52
    is_deeply($q, { size => 1,
53
        suggest => {
54
            suggestions => {
55
                text       => 'foo',
56
                completion => {
57
                    field => 'title__suggestion',
58
                    size  => 400,
59
                    fuzzy => {
60
                        fuzziness => 2,
61
                    }
62
                }
63
            }
64
        }
65
    }, 'Fuzziness and size specified');
66
};
67
68
done_testing();

Return to bug 14567