Bugzilla – Attachment 85892 Details for
Bug 18163
Elasticsearch advanced search by item type not working with item-level_itypes turned off (biblio record)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18163: Pass through limits in ES
Bug-18163-Pass-through-limits-in-ES.patch (text/plain), 2.50 KB, created by
Josef Moravec
on 2019-03-01 09:20:22 UTC
(
hide
)
Description:
Bug 18163: Pass through limits in ES
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-03-01 09:20:22 UTC
Size:
2.50 KB
patch
obsolete
>From 81541b7b211ea8b9264a9d6ae7aa709c7527e86b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 25 May 2018 13:06:16 +0000 >Subject: [PATCH] Bug 18163: Pass through limits in ES > >Before these patches we only allow a small subset of indexes to be used >as limits - if we are going to let users add new fields eventually we >probably don't want to strip out terms we didn't plan for. > >To test: >1 - Enable ES >2 - Using sample kohadevbox data try a search like this (or adjust as necessary): >http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=kw&idx=kw&idx=kw&limit=subject%2Cphr%3Astreet&sort_by=relevance&do=Search >3 - Note nothing is found >4 - Apply patches >5 - Repeat search >6 - It works! >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 6d79807e2c..5374e9033d 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -198,13 +198,13 @@ sub build_query_compat { > my ( $self, $operators, $operands, $indexes, $orig_limits, $sort_by, $scan, > $lang, $params ) > = @_; >- > #die Dumper ( $self, $operators, $operands, $indexes, $orig_limits, $sort_by, $scan, $lang ); > my @sort_params = $self->_convert_sort_fields(@$sort_by); > my @index_params = $self->_convert_index_fields(@$indexes); > my $limits = $self->_fix_limit_special_cases($orig_limits); > if ( $params->{suppress} ) { push @$limits, "suppress:0"; } > >+ > # Merge the indexes in with the search terms and the operands so that > # each search thing is a handy unit. > unshift @$operators, undef; # The first one can't have an op >@@ -543,7 +543,7 @@ sub _convert_index_fields { > # If a field starts with mc- we save it as it's used (and removed) later > # when joining things, to indicate we make it an 'OR' join. > # (Sorry, this got a bit ugly after special cases were found.) >- grep { $_->{field} } map { >+ map { > my ( $f, $t ) = split /,/; > my $mc = ''; > if ($f =~ /^mc-/) { >@@ -551,7 +551,7 @@ sub _convert_index_fields { > $f =~ s/^mc-//; > } > my $r = { >- field => $index_field_convert{$f}, >+ field => $index_field_convert{$f} // $f, > type => $index_type_convert{ $t // '__default' } > }; > $r->{field} = ($mc . $r->{field}) if $mc && $r->{field}; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18163
:
75564
|
75565
|
85891
| 85892