]> git.koha-community.org Git - koha.git/commit
Bug 27724: Use lenient also in Elasticsearch authorities search
authorFridolin Somers <fridolin.somers@biblibre.com>
Thu, 18 Feb 2021 14:37:15 +0000 (15:37 +0100)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Tue, 25 May 2021 14:04:35 +0000 (14:04 +0000)
commitd1e1b00b95cb514702a0dd4b82a14cd6365a34d3
treedfdbf2b4c39d551ba383e3191566c334f6ef500e
parent668ddfc2ef7a7857ff016afb7b4616f89a60dcef
Bug 27724: Use lenient also in Elasticsearch authorities search

In Elasticsearch, query for biblios uses lenient=true.
This is also needed for authorities search.
In case a search field is defined as type numeric.

Test plan :
1) Use Elasticsearch searchengine
2) Define a search field 'local-number' as type 'Number'
3) Be sure to us 'local-number' in autorities mapping
4) Rebuild autorities
5) Performe a search for autorities with 'Search entire record' and
   'contains' with term '123'
=> Without patch you get error :
[query_shard_exception] Can only use prefix queries on keyword and text fields - not on [local-number] which is of type [integer]

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 32f2026c1b6d5b97e6594020383940063d2b6fca)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit adac91502fe208a827cec71055bce9d5434c70dd)

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