Bug 21084: Fix automatic truncation in authority search
authorEre Maijala <ere.maijala@helsinki.fi>
Wed, 5 Dec 2018 14:27:43 +0000 (16:27 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 18 Jan 2019 20:18:31 +0000 (20:18 +0000)
commit0d9a42b492ca21cc14fab69d0facb80aeb8dcff4
treee3d4d4d073fc7ce4d6d347472727c4a7eb154400
parent9a8828850a23d592275ab4d48fae61b89c0a9868
Bug 21084: Fix automatic truncation in authority search

- Makes token splitting work like in biblio search
- Only adds right hand truncation since that's what Zebra also does
- Only adds truncation if the token is not a phrase and ends in a word character
- Adds tests to existing and new QueryBuilder functions

Test plan:

1. Create an authority record for "Duck, Donald"
2. Try contains type authority searches with the following terms and make sure they find the record:
Duck, Donald
donald duck
don duck
"Duck, Donald"
3. Make sure the following search works but does not find anything:
"Duck, Don"

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
t/Koha/SearchEngine/Elasticsearch/QueryBuilder.t [new file with mode: 0644]
t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t