[Bug 36633] New: Support anti-the at REST API level
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36633 Bug ID: 36633 Summary: Support anti-the at REST API level Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@gmail.com CC: tomascohen@gmail.com Coming from bug 35560. If we migrate UI tables to DT using the REST API we need support the anti-the sorting type. -- 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=36633 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Martin, Tomas, did you think about that already? -- 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=36633 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |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=36633 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Not thought about this at all yet, but it's a really sensible question. I'll at as RT to ponder it. -- 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=36633 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 165306 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165306&action=edit Bug 36633: Add anti-the support -- 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=36633 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Patch for discussion (to apply on top of bug 35560) It is suggesting to add a "modifier" to the order by attribute: +biblio.title/anti-the the remove a, an, the. Would that work? It's not really nice but I do not find something better for now. TODO: * tests * escape $param (see FIXME) * translatability of the stopwords -- 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=36633 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- Martin, Tomas, ping? -- 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=36633 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- I like the idea. 'anti-the' feels very 'koha' specific though.. I think what we're talking about here is known as 'natural sorting without articles' and the 'articles' are often defined as a stopwords list. I wonder if we could improve this with definable 'stopwords' lists for different languages and use the term 'ignore-stopwords' or similar in the sort attribute.. even now it's not just 'the' being filtered. -- 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=36633 --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 190567 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190567&action=edit Bug 36633: Add article-ignoring sort support to REST API This patch adds support for ignoring leading articles (a, an, the, etc.) when sorting via the Koha REST API using an /ignore-articles suffix modifier on _order_by parameters. We add a new system preference 'ArticleSortStopwords' (default: "a|an|the") expecting a pipe-delimited list of articles to ignore when sorting. Usage examples: GET /api/v1/biblios?_order_by=+biblio.title/ignore-articles GET /api/v1/biblios?_order_by=-biblio.title/ignore-articles Test plan: 1. Apply patch and run database update 2. Run: prove t/db_dependent/Koha/REST/Plugin/Objects.t 3. Verify all tests pass 4. Test via REST API with /ignore-articles modifier 5. Configure ArticleSortStopwords system preference 6. Verify sorting ignores configured articles correctly -- 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=36633 --- Comment #8 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- My proposed alternative -- 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=36633 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I like the idea of a configurable list. I have been wondering about this bit: + 'Pipe-delimited list of articles to ignore when sorting (e.g., a|an|the). Used by REST API /ignore-articles sort modifier and can be used by other sorting features. Articles are matched case-insensitively at the start of strings when followed by a space.', Maybe it would be safer to ask people to add the space in the list, as I think it won't work with the space for some languages like Arabic and Hebrew (IIRC). Maybe even French? (L'hotel ?) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org