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