]> git.koha-community.org Git - koha.git/commit
Bug 30152: Elasticsearch - queries with OR don't work with limits
authorKevin Carnes <kevin.carnes@ub.lu.se>
Tue, 22 Feb 2022 13:29:15 +0000 (14:29 +0100)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Fri, 12 Aug 2022 07:29:38 +0000 (09:29 +0200)
commit718ef54855db04191b3b460ef3ab7c574d5b6208
tree6d21172f374e886d2ddaafc1dd31f81b459a7282
parent8352334a1273c4d13ddba44db7a1053322467511
Bug 30152: Elasticsearch - queries with OR don't work with limits

When a query with "OR" is combined with a limit in Elasticsearch, the precedence is not preserved and the results are not correct.

To test:
1) Set SearchEngine to Elasticsearch
2) Index records in Elasticsearch
3) Do an advanced search
4) Select More options
5) Enter a value for the first Keyword (e.g. Novels)
6) Change "and" before the second Keyword to "or"
7) Enter another value for the second Keyword (e.g. Prose)
8) Limit the search (e.g. Item type Books)
9) Do the search
10) Observe that records with the first keyword are not in the results
11) Apply the patch
12) Repeat the search
13) Observe that results with both keywords are in the results
14) Sign off

Sponsored-by: Lund University Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3ed649a0e09d4ab96ed117ec2dc2446c9da71d34)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d6a3a10fc7cd7e15ffcdd03e089d565764f5e1b3)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t