tokenizer => 'standard',
filter => ['lowercase'],
},
- default => {
- tokenizer => 'keyword',
- filter => ['lowercase'],
- },
},
}
}
data => {
properties => {
record => {
- store => "yes",
+ store => "true",
include_in_all => JSON::false,
- type => "string",
+ type => "text",
},
}
}
sub {
my ( $name, $type, $facet, $suggestible, $sort, $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.
my $es_type =
$type eq 'boolean'
? 'boolean'
- : 'string';
+ : 'text';
if ($es_type eq 'boolean') {
$mappings->{data}{properties}{$name} = _elasticsearch_mapping_for_boolean( $name, $es_type, $facet, $suggestible, $sort, $marc_type );
if ($facet) {
$mappings->{data}{properties}{ $name . '__facet' } = {
- type => "string",
- index => "not_analyzed",
+ type => "keyword",
};
}
if ($suggestible) {
$mappings->{data}{properties}{ $name . '__sort' } = {
search_analyzer => "analyser_phrase",
analyzer => "analyser_phrase",
- type => "string",
+ type => "text",
include_in_all => JSON::false,
fields => {
phrase => {
search_analyzer => "analyser_phrase",
analyzer => "analyser_phrase",
- type => "string",
+ type => "text",
},
},
};
phrase => {
search_analyzer => "analyser_phrase",
analyzer => "analyser_phrase",
- type => "string",
+ type => "text",
},
raw => {
- type => "string",
- index => "not_analyzed",
+ type => "keyword",
}
},
};
)
);
}
- my $array_ref = $from->to_array;
+
+ #print Data::Dumper::Dumper( $from->to_array );
$self->store->bag->add_many($from);
$self->store->bag->commit;
return 1;
my $query = {
query => {
- filtered => {
- query => { match_all => {} },
+ bool => {
+# query => { match_all => {} },
filter => { term => { an => $authid } }
}
}
+++ /dev/null
-# 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, see <http://www.gnu.org/licenses>
-
-use strict;
-use warnings;
-
-use Test::More tests => 1; # last test to print
-
-use_ok('Koha::Search::Engine::Elasticsearch');
--- /dev/null
+# 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, see <http://www.gnu.org/licenses>
+
+use strict;
+use warnings;
+
+use Test::More tests => 1; # last test to print
+
+use_ok('Koha::SearchEngine::Elasticsearch');