Bugzilla – Attachment 139969 Details for
Bug 27153
ElasticSearch should search keywords apostrophe blind
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27153: POC
Bug-27153-POC.patch (text/plain), 1.87 KB, created by
Nick Clemens (kidclamp)
on 2022-08-29 22:34:59 UTC
(
hide
)
Description:
Bug 27153: POC
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-08-29 22:34:59 UTC
Size:
1.87 KB
patch
obsolete
>From df5b51acfe8aabef66e1732a76bb46fe0ff3bd9e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 29 Aug 2022 22:32:05 +0000 >Subject: [PATCH] Bug 27153: POC > >This is a small example to show that we can add an extra field to our default indexing that >removes punctuation. > >If we then add that field to the fields we push, we can sarch both the regular and the punctuation stripped version > >To complete this we would need to add a 'search variations' field to the ES config page, for the user to decide which >fields should be searched in all variations, and which shouldn't > >Or we could add this to all 'simple searches' from the search bar, and only search exact on advanced searches. > >I am happy to explore either option >--- > Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 1 + > admin/searchengine/elasticsearch/field_config.yaml | 3 +++ > 2 files changed, 4 insertions(+) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 174ba62626..0524071bfb 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -197,6 +197,7 @@ sub build_query { > if ($options{whole_record}) { > push @$fields, 'marc_data_array.*'; > } >+ push @$fields, 'title.punc_removed'; > $res->{query} = { > query_string => { > query => $query, >diff --git a/admin/searchengine/elasticsearch/field_config.yaml b/admin/searchengine/elasticsearch/field_config.yaml >index cf90482aa2..6b64eec968 100644 >--- a/admin/searchengine/elasticsearch/field_config.yaml >+++ b/admin/searchengine/elasticsearch/field_config.yaml >@@ -53,6 +53,9 @@ search: > ci_raw: > type: keyword > normalizer: icu_folding_normalizer >+ punc_removed: >+ type: text >+ analyzer: analyzer_stdno > # Facets > facet: > default: >-- >2.30.2
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 27153
:
114234
|
139969
|
155145
|
155146
|
155147
|
155148
|
155149
|
155230
|
155502
|
155508
|
155509
|
155510
|
155511
|
155512
|
155513
|
155514
|
155515
|
155516
|
155517
|
157732
|
157733
|
157734
|
157735
|
157736
|
157737