Bug 21534: Always compute wildcards
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 29 May 2019 13:20:41 +0000 (15:20 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Sat, 15 Jun 2019 07:00:40 +0000 (08:00 +0100)
commit001d433b427731a6efd55208ac3169107c830730
tree2d22ab8c570feee8e82dbd484f8ebb699e47cf4f
parentd2dc504ec1d87b74ea424d27462a214e7027385c
Bug 21534: Always compute wildcards

You get no results when searching with an hyphen + with * in query string (or with preference QueryAutoTruncate) :
ie /cgi-bin/koha/opac-search.pl?q=saints-anges*

Looks like query-string by default does not compute wildcards, see analyze_wildcard in :
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

Test plan :
1) Use Elasticsearch
2) Create a record with "saints-anges"
3) Search for "saints-anges" => you get results
4) Search for "saints-anges*" => you get results
5) Search for "saints-ang*" => you get results

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm