Bug 28316: escape ES ranges if QueryAutoTruncate is enabled
authorPetro Vashchuk <stalkernoid@gmail.com>
Mon, 6 Sep 2021 13:46:45 +0000 (16:46 +0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 1 Oct 2021 18:15:27 +0000 (14:15 -0400)
commite84759dfee9a4323a17146b88aba9d717ca0bb75
tree92a503cfa99d00f8c3abbc8dfe55911fa9a97658
parent59c26ce5f35f3f18830090b048d0cd6c2a1eb6fc
Bug 28316: escape ES ranges if QueryAutoTruncate is enabled

if QueryAutoTruncate enabled we will have any special operators ruined
for example: "test [6 TO 7]" will be converted to "test* [6* TO* 7]"
so no reason to keep ranges when QueryAutoTruncate set to "enabled"

1) enable QueryAutoTruncate at your sysprefs.
2) perform a search using range, for example: "[1999 TO 2020]",
it shouldn't work the way it's supposed to.
3) apply the patch.
4) perform the same search with range, ensure that it works correctly.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm