Description
Fridolin Somers
2021-02-18 14:28:04 UTC
Created attachment 116991 [details] [review] 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] Created attachment 116996 [details] [review] Bug 27724: Add unit test Run t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t Created attachment 116997 [details] [review] 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] Created attachment 119062 [details] [review] 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> Sorry, I missed the first patch during the signoff, I correct that in a second ! Created attachment 119066 [details] [review] Bug 27724: Add unit test Run t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Created attachment 119067 [details] [review] 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> Created attachment 121002 [details] [review] Bug 27724: Add unit test Run t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Created attachment 121003 [details] [review] 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> As a step towards QA, here is another signoff. Created attachment 121041 [details] [review] Bug 27724: Add unit test Run t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t 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> Created attachment 121042 [details] [review] 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> Logically this makes sense to me.. works as described and includes expected tests.. Passing QA Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.06 Pushed to 20.05.x for 20.05.12 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. |