[Bug 27316] New: In mappings use yes/no for sortable
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Bug ID: 27316 Summary: In mappings use yes/no for sortable Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: fridolin.somers@biblibre.com In search engine configuration (Elasticsearch), there is a colum 'sortable'. It contains 'Undef', 0 or 1. 0 and 1 are not really friendly values for a boolean. And also the translation seems to replace 0 by empty string (seen in fr-FR translation). I propose to replace by Yes/No like other boolean. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |fridolin.somers@biblibre.co |ity.org |m Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |String patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #1 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 114743 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114743&action=edit Bug 27316: In Elasticsearch mappings use yes/no for sortable In search engine configuration (Elasticsearch), there is a colum 'sortable'. It contains 'Undef', 0 or 1. 0 and 1 are not really friendly values for a boolean. And also the translation seems to replace 0 by empty string (seen in fr-FR translation). I propose to replace by Yes/No like other boolean. Test plan : 1) Without patch, look at Administration > Search engine configuration (Elasticsearch) 2) Look at tab 'Bibliographic records' 3) Look at a row containing 0 and a row containing 1 4) Apply patch 5) Refresh page 6) Check 0 is now 'No' and 1 is now 'Yes' 7) Check creating a new row with 'Yes' or 'No' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=20588 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- much more user friendly, thank you -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114743|0 |1 is obsolete| | --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 114752 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114752&action=edit Bug 27316: In Elasticsearch mappings use yes/no for sortable In search engine configuration (Elasticsearch), there is a colum 'sortable'. It contains 'Undef', 0 or 1. 0 and 1 are not really friendly values for a boolean. And also the translation seems to replace 0 by empty string (seen in fr-FR translation). I propose to replace by Yes/No like other boolean. Test plan : 1) Without patch, look at Administration > Search engine configuration (Elasticsearch) 2) Look at tab 'Bibliographic records' 3) Look at a row containing 0 and a row containing 1 4) Apply patch 5) Refresh page 6) Check 0 is now 'No' and 1 is now 'Yes' 7) Check creating a new row with 'Yes' or 'No' Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 114943 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114943&action=edit Bug 27316: [alternate] Convert 'undef' for sort to Yes and use Yes/No instead of 0/1 This patch changes the interface to remove the undef option We also update existing mappings and set default of 1 Comment previously indicated undef was treated differently, but in the code we treat undef as 1 That code is untoched to avoid creating problems for older mappings that may be reloaded To test: 1 - View the ES mappings, note you can set columns to Undef, 0, 1 2 - Set some to undef 3 - Apply patches 4 - Update database 5 - Undef now show as 'Yes' 6 - Confirm you can set columns as Yes/no 7 - Confirm that mandatory columns display correct value when readonly (see issues field) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- Lets remove the ambiguity of 'Undef' which we treat as 'Yes' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 114955 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114955&action=edit Bug 27316: (follow-up) Default to 1 if undef in mappings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It looks like the alternate patch hasn't been signed off. Nick, can you please clarify which patches need to be applied and maybe Lucas could test again? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Frido, can you compare my patches and see if you approve? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Nick Clemens from comment #5)
Lets remove the ambiguity of 'Undef' which we treat as 'Yes'
Ok indeed, this is misleading. I'll validate. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114752|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #10 from Fridolin Somers <fridolin.somers@biblibre.com> --- DEV atomic update: bug_23716_update_sort_mappings.perl Upgrade to XXX done [15:35:00]: Bug 27316 - Description I've set description : "In Elastisearch mappings convert NULL (Undef) for sort to 1 (Yes)" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 115938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115938&action=edit Bug 27316: Convert 'undef' for sort to Yes and use Yes/No instead of 0/1 This patch changes the interface to remove the undef option We also update existing mappings and set default of 1 Comment previously indicated undef was treated differently, but in the code we treat undef as 1 That code is untoched to avoid creating problems for older mappings that may be reloaded To test: 1 - View the ES mappings, note you can set columns to Undef, 0, 1 2 - Set some to undef 3 - Apply patches 4 - Update database 5 - Undef now show as 'Yes' 6 - Confirm you can set columns as Yes/no 7 - Confirm that mandatory columns display correct value when readonly (see issues field) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114955|0 |1 is obsolete| | --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 115939 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115939&action=edit Bug 27316: (follow-up) Default to 1 if undef in mappings Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Should we also change mappings.yaml to use only 0 and 1 ? With 1 on fields actually sortable : https://git.koha-community.org/Koha-community/Koha/src/commit/6b23c0634b43a6... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Fridolin Somers from comment #13)
Should we also change mappings.yaml to use only 0 and 1 ?
With 1 on fields actually sortable :
https://git.koha-community.org/Koha-community/Koha/src/commit/ 6b23c0634b43a60f0a434d4c43a3e57718ad0806/Koha/SearchEngine/Elasticsearch/ QueryBuilder.pm#L694
Nick and others more familiar with Elasticsearch than me - can you answer Frido's question? :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #15 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #14)
(In reply to Fridolin Somers from comment #13)
Should we also change mappings.yaml to use only 0 and 1 ?
With 1 on fields actually sortable :
https://git.koha-community.org/Koha-community/Koha/src/commit/ 6b23c0634b43a60f0a434d4c43a3e57718ad0806/Koha/SearchEngine/Elasticsearch/ QueryBuilder.pm#L694
Nick and others more familiar with Elasticsearch than me - can you answer Frido's question? :)
That would make sense, we should be able to simply apply the patches and generate the new mappings via export I believe -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- See Bug 24997 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Attachment #114943|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=24997 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115938|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 117429 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117429&action=edit Bug 27316: Convert 'undef' for sort to Yes and use Yes/No instead of 0/1 This patch changes the interface to remove the undef option We also update existing mappings and set default of 1 Comment previously indicated undef was treated differently, but in the code we treat undef as 1 That code is untoched to avoid creating problems for older mappings that may be reloaded To test: 1 - View the ES mappings, note you can set columns to Undef, 0, 1 2 - Set some to undef 3 - Apply patches 4 - Update database 5 - Undef now show as 'Yes' 6 - Confirm you can set columns as Yes/no 7 - Confirm that mandatory columns display correct value when readonly (see issues field) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115939|0 |1 is obsolete| | --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 117430 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117430&action=edit Bug 27316: (follow-up) Default to 1 if undef in mappings Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works nicely and is much cleaner/clearer. No regressions found.. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|21.05.00 |21.05.00,20.11.04 released in| | --- Comment #21 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |27856 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27856 [Bug 27856] Update mappings.yaml after bug 27316 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 --- Comment #22 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Nick Clemens from comment #15)
(In reply to Katrin Fischer from comment #14)
(In reply to Fridolin Somers from comment #13)
Should we also change mappings.yaml to use only 0 and 1 ?
With 1 on fields actually sortable :
https://git.koha-community.org/Koha-community/Koha/src/commit/ 6b23c0634b43a60f0a434d4c43a3e57718ad0806/Koha/SearchEngine/Elasticsearch/ QueryBuilder.pm#L694
Nick and others more familiar with Elasticsearch than me - can you answer Frido's question? :)
That would make sense, we should be able to simply apply the patches and generate the new mappings via export I believe
Created Bug 27856 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com --- Comment #23 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Doesn't apply cleanly to 20.05. Please rebase if needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28279 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28279 [Bug 28279] mappings.yaml no longer in sync -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27316 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|27856 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27856 [Bug 27856] Update mappings.yaml after bug 27316 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org