Bugzilla – Attachment 104422 Details for
Bug 24555
POC Elasticsearch - Use boolean queries instead of full text queries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24555: Use 'cross_fields' type for multi_match queries
Bug-24555-Use-crossfields-type-for-multimatch-quer.patch (text/plain), 1.59 KB, created by
Julian Maurice
on 2020-05-06 13:50:16 UTC
(
hide
)
Description:
Bug 24555: Use 'cross_fields' type for multi_match queries
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2020-05-06 13:50:16 UTC
Size:
1.59 KB
patch
obsolete
>From 748975269f0ad3ecc2f374d313d2a7e6a09a748d Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 6 May 2020 15:17:17 +0200 >Subject: [PATCH] Bug 24555: Use 'cross_fields' type for multi_match queries > >It allows to search in all fields as if it were one big field. > >It also uses 'and' as operator, which means that all searched terms must >appear at least in one field for a document to match > >https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-multi-match-query.html#type-cross-fields >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 50d42ec2b1..1f6f600800 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -275,6 +275,8 @@ sub _create_match_expression { > my $expression = {}; > unless (defined($search_param->{field})) { > $expression->{multi_match} = { >+ type => 'cross_fields', >+ operator => 'and', > query => $search_param->{operand}, > lenient => JSON::true > >@@ -342,6 +344,8 @@ sub build_authorities_query { > # but not "quick brown fox". > push @query_parts, { > multi_match => { >+ type => 'cross_fields', >+ operator => 'and', > query => $val, > fields => $self->_search_fields({ subfield => 'ci_raw' }), > } >-- >2.20.1
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 24555
:
98242
|
98243
|
98247
|
98248
|
104419
| 104422 |
105061
|
105470
|
105471
|
105472
|
105744