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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-4 / +4 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',
93
            default_field    => '_record',
94
            lenient          => JSON::true,
94
            lenient          => JSON::true,
95
            fields           => $options{fields} || [],
95
            fields           => $options{fields} || [],
96
        }
96
        }
Lines 230-236 sub build_query_compat { Link Here
230
        join( ' ', $self->_create_query_string(@search_params) ) || (),
230
        join( ' ', $self->_create_query_string(@search_params) ) || (),
231
        $self->_join_queries( $self->_convert_index_strings(@$limits) ) || () );
231
        $self->_join_queries( $self->_convert_index_strings(@$limits) ) || () );
232
232
233
    my @fields = '_all';
233
    my @fields = '_record';
234
    if ( defined($params->{weighted_fields}) && $params->{weighted_fields} ) {
234
    if ( defined($params->{weighted_fields}) && $params->{weighted_fields} ) {
235
        push @fields, sprintf("%s^%s", $_->name, $_->weight) for Koha::SearchFields->weighted_fields;
235
        push @fields, sprintf("%s^%s", $_->name, $_->weight) for Koha::SearchFields->weighted_fields;
236
    }
236
    }
Lines 301-307 sub build_authorities_query { Link Here
301
301
302
    foreach my $s ( @{ $search->{searches} } ) {
302
    foreach my $s ( @{ $search->{searches} } ) {
303
        my ( $wh, $op, $val ) = @{$s}{qw(where operator value)};
303
        my ( $wh, $op, $val ) = @{$s}{qw(where operator value)};
304
        $wh = '_all' if $wh eq '';
304
        $wh = '_record' if $wh eq '';
305
        if ( $op eq 'is' || $op eq '='  || $op eq 'exact' ) {
305
        if ( $op eq 'is' || $op eq '='  || $op eq 'exact' ) {
306
306
307
            # look for something that matches a term completely
307
            # look for something that matches a term completely
Lines 519-525 types. Link Here
519
=cut
519
=cut
520
520
521
our %index_field_convert = (
521
our %index_field_convert = (
522
    'kw' => '_all',
522
    'kw' => '_record',
523
    'ab' => 'abstract',
523
    'ab' => 'abstract',
524
    'au' => 'author',
524
    'au' => 'author',
525
    'lcn' => 'local-classification',
525
    'lcn' => 'local-classification',
(-)a/admin/searchengine/elasticsearch/field_config.yaml (-6 / +5 lines)
Lines 1-9 Link Here
1
---
1
---
2
# General field configuration
2
# General field configuration
3
general:
3
general:
4
  _all:
5
    type: string
6
    analyzer: analyser_standard
7
  properties:
4
  properties:
8
    marc_data:
5
    marc_data:
9
      store: true
6
      store: true
Lines 15-20 general: Link Here
15
      type: text
12
      type: text
16
      analyzer: keyword
13
      analyzer: keyword
17
      index: false
14
      index: false
15
    _record:
16
      type: text
17
      analyzer: analyser_standard
18
18
19
# Search fields
19
# Search fields
20
search:
20
search:
Lines 35-41 search: Link Here
35
        search_analyzer: analyser_stdno
35
        search_analyzer: analyser_stdno
36
      raw:
36
      raw:
37
        type: keyword
37
        type: keyword
38
    copy_to: _all
38
    copy_to: _record
39
  default:
39
  default:
40
    type: text
40
    type: text
41
    analyzer: analyser_standard
41
    analyzer: analyser_standard
Lines 50-56 search: Link Here
50
      lc_raw:
50
      lc_raw:
51
        type: keyword
51
        type: keyword
52
        normalizer: my_normalizer
52
        normalizer: my_normalizer
53
    copy_to: _all
53
    copy_to: _record
54
# Facets
54
# Facets
55
facet:
55
facet:
56
  default:
56
  default:
57
- 

Return to bug 18969