[Bug 23887] New: Add support for client-specified sort order in Z3950Responder
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 Bug ID: 23887 Summary: Add support for client-specified sort order in Z3950Responder Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Z39.50 / SRU / OpenSearch Servers Assignee: koha-bugs@lists.koha-community.org Reporter: ere.maijala@helsinki.fi QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl GenericSession doesn't currently handle sorting specified by the client. This needs to be added. -- 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=23887 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |ere.maijala@helsinki.fi |ity.org | See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=13937 Status|NEW |ASSIGNED -- 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=23887 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Depends on| |23089 Patch complexity|--- |Trivial patch Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23089 [Bug 23089] Elasticsearch - cannot sort on non-text fields -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 --- Comment #1 from Ere Maijala <ere.maijala@helsinki.fi> --- Created attachment 94655 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94655&action=edit Bug 23887: Add support for sorting in Z3950Responder. Also enables sorting by any field that supports sorting and no longer ignores invalid or unsupported sorts. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |johanna.raisa@koha-suomi.fi --- Comment #2 from Johanna Räisä <johanna.raisa@koha-suomi.fi> --- Is there some kind of test plan? I didn't quite understand where to put the sorting value by looking the code. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 --- Comment #3 from Ere Maijala <ere.maijala@helsinki.fi> --- Sorry, got a mid-air collision when I was adding this: Test plan: Start responder: misc/z3950responder.pl Use browser to search: http://localhost:2100/biblios?version=1.2&operation=searchRetrieve&query=misth%20sortby%20title/ascending&maximumRecords=10&recordSchema=marcxml Compare with: http://localhost:2100/biblios?version=1.2&operation=searchRetrieve&query=misth%20sortby%20title/descending&maximumRecords=10&recordSchema=marcxml -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 --- Comment #4 from Ere Maijala <ere.maijala@helsinki.fi> --- Note that you could use any ES field as long as it's marked sortable in the search engine configuration. You can also specify multiple sort fields separated by a space: http://localhost:2100/biblios?version=1.2&operation=searchRetrieve&query=misth%20sortby%20title/ascending%20author&maximumRecords=10&recordSchema=marcxml -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- URL| |http://www.loc.gov/standard | |s/sru/cql/contextSets/sort- | |context-set.html --- Comment #5 from Ere Maijala <ere.maijala@helsinki.fi> --- I added the url to SRU docs about sorting. Note that we currently only support specifying sort fields and direction. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #6 from David Nind <david@davidnind.com> --- Hi Ere. Could you provide some more information on how to get the z3950responder.pl working and I'd be happy to test? I've looked at https://wiki.koha-community.org/wiki/Setting_up_the_Z39.50_and_SRU_Server but I get an error when going koha-z3950-responder --enable kohadev (using koha-testing-docker): cp: cannot stat '/etc/koha/z3950/*': No such file or directory David Nind -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 --- Comment #7 from Ere Maijala <ere.maijala@helsinki.fi> --- David, Sorry for the slow response, I was away. I think the enabling script should take care of that, but apparently it doesn't, so could you try creating the directory manually e.g. by running `mkdir -p /etc/koha/z3950` ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 --- Comment #8 from David Nind <david@davidnind.com> --- Thanks Ere! No problem, will have a look at testing this as soon as I can. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #94655|0 |1 is obsolete| | --- Comment #9 from Ere Maijala <ere.maijala@helsinki.fi> --- Created attachment 117290 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117290&action=edit Bug 23887: Add support for sorting in Z3950Responder. Also enables sorting by any field that supports sorting and no longer ignores invalid or unsupported sorts. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #10 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Ere Maijala from comment #3)
Test plan:
Start responder: misc/z3950responder.pl
At this stage I get an error: syntax error at /kohadevbox/koha/Koha/Z3950Responder/GenericSession.pm line 135, near "}" Compilation failed in require at /kohadevbox/koha/Koha/Z3950Responder.pm line 161. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Z3950Responder.pm line 161. Compilation failed in require at misc/z3950_responder.pl line 28. BEGIN failed--compilation aborted at misc/z3950_responder.pl line 28. Could you add the test plan to the commit message when you revise it? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #117290|0 |1 is obsolete| | --- Comment #11 from Ere Maijala <ere.maijala@helsinki.fi> --- Created attachment 117967 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117967&action=edit Bug 23887: Add support for sorting in Z3950Responder. Also enables sorting by any field that supports sorting and no longer ignores invalid or unsupported sorts. Test plan: 1. Run tests: prove -v t/db_dependent/Koha/Z3950Responder/ 2. Start responder: misc/z3950responder.pl 3. Use browser to search: http://localhost:2100/biblios?version=1.2&operation=searchRetrieve&query=misth%20sortby%20title/ascending&maximumRecords=10&recordSchema=marcxml 4. Compare with: http://localhost:2100/biblios?version=1.2&operation=searchRetrieve&query=misth%20sortby%20title/descending&maximumRecords=10&recordSchema=marcxml -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 --- Comment #12 from Ere Maijala <ere.maijala@helsinki.fi> --- Sorry, the patch was somehow completely broken. Now fixed, and I added a test while at it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23887 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #13 from David Nind <david@davidnind.com> --- The patch still applies, however the sorting doesn't work for me. Testing notes using koha-testing-docker: - Getting the Z3950Responder to work in koha-testing-docker: . the Z3950Responder is setup and running by default (but you can't accessing using your browser) . commands: ~ koha-z3950-responder --stop kohadev ~ koha-z3950-responder --start kohadev ~ a restart_all will also reload it . it is running on port 2100, however this is not accessible using the browser . to enable access using the browser: ~ edit your docker-compose.yml file in koha-testing-docker ~ add port 2100 in the koha services section, for example: ports: - "8080:8080" - "8081:8081" - "2100:2100" <== this was added ~ close koha-testing-docker down and restart (Ctrl-C and kd, then ku) - Alternative: use the queries with curl from kshell and output to a file to make it easier to review the results: curl "queries from the next step" > filename - I changed the query to search for perl, as "misth" is not in the sample data: . http://localhost:2100/biblios?version=1.2&operation=searchRetrieve&query=perl sortby title/ascending&maximumRecords=10&recordSchema=marcxml" . http://localhost:2100/biblios?version=1.2&operation=searchRetrieve&query=perl sortby title/descending&maximumRecords=10&recordSchema=marcxml" - For me, the order of the results didn't change, and they appeared in this order before and after the patch was applied, and when using ascending and descending: Perl best practices CGI programming with Perl Programming the Perl DBI Perl Hacks Intermediate Perl Effective Perl programming The definitive guide to Catalyst Higher-order Perl Perl Better Practices Perl template toolkit - The tests passed before and after the patch was applied - Tip: Firefox returns raw XML, I used Google Chrome so that the page was more readable -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org