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

(-)a/Koha/SearchEngine/Elasticsearch.pm (-5 / +4 lines)
Lines 173-183 sub get_elasticsearch_mappings { Link Here
173
    # TODO cache in the object?
173
    # TODO cache in the object?
174
    my $mappings = {
174
    my $mappings = {
175
        data => {
175
        data => {
176
            _all => {type => "string", analyzer => "analyser_standard"},
177
            properties => {
176
            properties => {
178
                record => {
177
                record => {
179
                    store          => "true",
178
                    store          => "true",
180
                    include_in_all => JSON::false,
181
                    type           => "text",
179
                    type           => "text",
182
                },
180
                },
183
            }
181
            }
Lines 226-232 sub get_elasticsearch_mappings { Link Here
226
                    search_analyzer => "analyser_phrase",
224
                    search_analyzer => "analyser_phrase",
227
                    analyzer  => "analyser_phrase",
225
                    analyzer  => "analyser_phrase",
228
                    type            => "text",
226
                    type            => "text",
229
                    include_in_all  => JSON::false,
230
                    fields          => {
227
                    fields          => {
231
                        phrase => {
228
                        phrase => {
232
                            type            => "keyword",
229
                            type            => "keyword",
Lines 254-260 sub _elasticsearch_mapping_for_boolean { Link Here
254
251
255
    return {
252
    return {
256
        type            => $type,
253
        type            => $type,
257
        null_value      => 0,
254
        null_value      => 'false',
258
    };
255
    };
259
}
256
}
260
257
Lines 344-350 sub get_fixer_rules { Link Here
344
                # boolean gets special handling, basically if it doesn't exist,
341
                # boolean gets special handling, basically if it doesn't exist,
345
                # it's added and set to false. Otherwise we can't query it.
342
                # it's added and set to false. Otherwise we can't query it.
346
                push @rules,
343
                push @rules,
347
                  "unless exists('$name') add_field('$name', 0) end";
344
                  "unless exists('$name') add_field('$name', 'false') end";
345
                push @rules,
346
                  "if exists('$name') add_field('$name', 'true') end";
348
            }
347
            }
349
            if ($type eq 'sum' ) {
348
            if ($type eq 'sum' ) {
350
                push @rules, "sum('$name')";
349
                push @rules, "sum('$name')";
(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-3 / +1 lines)
Lines 90-96 sub build_query { Link Here
90
            query            => $query,
90
            query            => $query,
91
            fuzziness        => $fuzzy_enabled ? 'auto' : '0',
91
            fuzziness        => $fuzzy_enabled ? 'auto' : '0',
92
            default_operator => 'AND',
92
            default_operator => 'AND',
93
            default_field    => '_all',
94
            lenient          => JSON::true,
93
            lenient          => JSON::true,
95
        }
94
        }
96
    };
95
    };
Lines 513-519 types. Link Here
513
=cut
512
=cut
514
513
515
our %index_field_convert = (
514
our %index_field_convert = (
516
    'kw'      => '_all',
515
    'kw'      => '',
517
    'ti'      => 'title',
516
    'ti'      => 'title',
518
    'au'      => 'author',
517
    'au'      => 'author',
519
    'su'      => 'subject',
518
    'su'      => 'subject',
520
- 

Return to bug 18969