]> git.koha-community.org Git - koha.git/commit
Bug 24567: Don't strip spaces along with dangling colons
authorNick Clemens <nick@bywatersolutions.com>
Tue, 27 Oct 2020 11:26:53 +0000 (11:26 +0000)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Tue, 23 Mar 2021 14:20:04 +0000 (14:20 +0000)
commitab363966b39b7b5010391dd82fcccaf6017ca0a0
tree3f8c23f0973652c670264bd3f94007942287b34a
parentfabba02dd86fb93c92c0c762737006aec0e07a2c
Bug 24567: Don't strip spaces along with dangling colons

This updates the regex used for removing colons to capture those with space on either side, and remove the colon
while preserving the space

To test:
 1 - Have Koha using ES
 2 - Search for:
    ti:chess AND chess
 3 - You should get a result in sample data, otherwise replace 'chess' with a title in your catalogue
 4 - Search for:
    ti:chess AND kw:chess
 5 - No result
 6 - Enable  DumpTemplateVarsIntranet  and  DumpSearchQueryTemplate
 7 - Repeate search and check page source
 8 - search_query has:
    title:chess ANDchess
 9 - Apply patch
10 - Repeat
11 - Seaerch works!
12 - query is now:
     title:chess AND chess

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Bug 24567: (follow-up) Use dollar sign to refer to captures

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6ce56f1134d99280af30e128f57189b285966180)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
t/Koha/SearchEngine/Elasticsearch/QueryBuilder.t