[Bug 38130] New: Cannot filter items on library name
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Bug ID: 38130 Summary: Cannot filter items on library name Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Staff interface Assignee: jonathan.druart@gmail.com Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Depends on: 33568 On the item list of the bibliographic record page you actually can filter items by library, either using the dropdown list on top of the column or using the library_id (branchcode) in the global search. But you cannot search using the library's name in the global search. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33568 [Bug 33568] Use the REST API to display items on the staff biblio detail view -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=38130 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 172559 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172559&action=edit Bug 38130: Add the ability to filter item by library name On the item list of the bibliographic record page you actually can filter items by library, either using the dropdown list on top of the column or using the library_id (branchcode) in the global search. But you cannot search using the library's name in the global search. This patch add yet other embeds to allow this. I am not sure this is needed, we won't be able to do the same for item type and AV, so maybe it is not worth 2 additional JOINS. Maybe we should tell people you should use the column filters when a dropdown list is there, instead of: "it works, sometimes". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 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=38130 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #172559|0 |1 is obsolete| | --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 172574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172574&action=edit Bug 38130: Add the ability to filter item by library name On the item list of the bibliographic record page you actually can filter items by library, either using the dropdown list on top of the column or using the library_id (branchcode) in the global search. But you cannot search using the library's name in the global search. This patch add yet other embeds to allow this. I am not sure this is needed, we won't be able to do the same for item type and AV, so maybe it is not worth 2 additional JOINS. Maybe we should tell people you should use the column filters when a dropdown list is there, instead of: "it works, sometimes". 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=38130 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Version|unspecified |Main 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=38130 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #172574|0 |1 is obsolete| | --- Comment #3 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 172578 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172578&action=edit Bug 38130: Add the ability to filter item by library name On the item list of the bibliographic record page you actually can filter items by library, either using the dropdown list on top of the column or using the library_id (branchcode) in the global search. But you cannot search using the library's name in the global search. This patch add yet other embeds to allow this. I am not sure this is needed, we won't be able to do the same for item type and AV, so maybe it is not worth 2 additional JOINS. Maybe we should tell people you should use the column filters when a dropdown list is there, instead of: "it works, sometimes". Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #4 from Lucas Gass <lucas@bywatersolutions.com> --- Since Brendan signed off here after me I'll use my sign-off as QA. The script is happy, the change is trivial, it makes sense, fixes the problem. PQA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |lucas@bywatersolutions.com |y.org | Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- """ I am not sure this is needed, we won't be able to do the same for item type and AV, so maybe it is not worth 2 additional JOINS. Maybe we should tell people you should use the column filters when a dropdown list is there, instead of: "it works, sometimes". """ I would like us to discuss this part before we push it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #6 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- This is very similar to another bug I filed: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38333 In the end, I think it is much more important to be able to sort/filter on the name/description than it would be the code. That goes for branches, item types, and any AV. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38333 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #7 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> ---
Maybe we should tell people you should use the column filters when a dropdown list is there, instead of: "it works, sometimes". """
Our libraries very much need to be able to sort by branch name, especially holding/home library. If we take Jonathan's patch and flip the order of the joins ( data: "holding_library.name:me.holding_library_id" ) it works for sorting and filtering. Prior to 24.05 one could not filter by branchcode, only name, so we won't be losing any previous functionality. We ultimately need to need to fix sorting/filtering by item type/collection as well. ( descriptions not codes ) but we are hearing from our libraries right now that home/holding library sorting/filtering is especially important. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Lucas Gass (lukeg) from comment #7)
Maybe we should tell people you should use the column filters when a dropdown list is there, instead of: "it works, sometimes". """
Our libraries very much need to be able to sort by branch name, especially holding/home library.
If we do it for the library names on this view, we need to do it for all the library columns (thinking about patrons right now but I am sure there are others). And to be consistent, for all the other coded values: "special AVs" (item types, cn source), regular AVs, patron category codes, etc. We will introduce additional JOINs and so maybe performance problems. This needs to be investigated before we take this route IMO. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #172578|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 174103 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174103&action=edit Bug 38130: Allow sorting and filtering on library id and name On the item list of the bib detail page and the patron search we want the library columns ('holding library', 'home library' and 'library') to be sorted by library names and to make them searchable on library id and name. Concerns about this approach (comment #8): """ If we do it for the library names on this view, we need to do it for all the library columns (thinking about patrons right now but I am sure there are others). And to be consistent, for all the other coded values: "special AVs" (item types, cn source), regular AVs, patron category codes, etc. We will introduce additional JOINs and so maybe performance problems. This needs to be investigated before we take this route IMO. """ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #172578|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- So.. I advocate for some real benchmarks to actually prove the hypothesis here. In a related query though.. I'd be interested in investigating dbic's join vs prefetch pragma's... I think some of our performance challenges come from the fact we force prefetch on the API for all embeds. Whilst this makes sense from the perspective of having consistent data returned in the responses.. a simple join without the automatic collapse (grabbing all related fields instead of just the ones you are interested in) might be more performant for cases like this where we're not so much interested in all the fields as we are a select few. This is again conjecture though without a benchmark. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com, | |pedro.amorim@ptfs-europe.co | |m --- Comment #11 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #9)
If we do it for the library names on this view, we need to do it for all the library columns (thinking about patrons right now but I am sure there are others). And to be consistent, for all the other coded values: "special AVs" (item types, cn source), regular AVs, patron category codes, etc.
Agreed.
We will introduce additional JOINs and so maybe performance problems. This needs to be investigated before we take this route IMO. """
I've tested using Nick's randitems: https://github.com/kidclamp/handy-koha-script/blob/main/randitems.pl Before patches: searching for "cpl" using the datatable search input - average of 0.27 secs for 300 items. - average of 0.37 secs for 3000 items. After patches: searching for "centerville" (or cpl) using the datatable search input - average of 0.3 secs for 300 items. - average of 0.45 secs for 3000 items. This exercise should also be done for patrons (when that time comes) but from my testing, the performance impact seems negligible on this table. For me, this is enough to not block this, the enhancement is clearly needed and makes sense. As a rule of thumb, anything that is displayed on the table should be retrievable by a keyword search. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #172578|0 |1 is obsolete| | --- Comment #12 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 174189 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174189&action=edit Bug 38130: Add the ability to filter item by library name On the item list of the bibliographic record page you actually can filter items by library, either using the dropdown list on top of the column or using the library_id (branchcode) in the global search. But you cannot search using the library's name in the global search. This patch add yet other embeds to allow this. I am not sure this is needed, we won't be able to do the same for item type and AV, so maybe it is not worth 2 additional JOINS. Maybe we should tell people you should use the column filters when a dropdown list is there, instead of: "it works, sometimes". Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Pedro Amorim <pedro.amorim@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=38130 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #174103|0 |1 is obsolete| | --- Comment #13 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 174190 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174190&action=edit Bug 38130: Allow sorting and filtering on library id and name On the item list of the bib detail page and the patron search we want the library columns ('holding library', 'home library' and 'library') to be sorted by library names and to make them searchable on library id and name. Concerns about this approach (comment #8): """ If we do it for the library names on this view, we need to do it for all the library columns (thinking about patrons right now but I am sure there are others). And to be consistent, for all the other coded values: "special AVs" (item types, cn source), regular AVs, patron category codes, etc. We will introduce additional JOINs and so maybe performance problems. This needs to be investigated before we take this route IMO. """ Signed-off-by: Pedro Amorim <pedro.amorim@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=38130 --- Comment #14 from Jonathan Druart <jonathan.druart@gmail.com> --- I am seeing, for 1000 items: 700ms without this patch 950ms with this patch Also there is a bottleneck somewhere else, the UI is very slow to refresh (JS-side then). If we are adding 150ms per JOIN and are adding 3,4 per table, it's not a good... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #15 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #14)
Also there is a bottleneck somewhere else, the UI is very slow to refresh (JS-side then).
Found something, see bug 38391. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38391 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #16 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #14)
I am seeing, for 1000 items: 700ms without this patch 950ms with this patch
Interesting, I wonder why our times differ so much, just tested again with patches still applied searching for 'centerville' 3000 items: 480ms, 434ms, 449ms, 455ms -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #17 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #14)
If we are adding 150ms per JOIN and are adding 3,4 per table, it's not a good...
I don't think we can affirm this just yet. Additional embeds need to be added to test this (e.g. status and/or collection) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #18 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Pedro Amorim from comment #16)
(In reply to Jonathan Druart from comment #14)
I am seeing, for 1000 items: 700ms without this patch 950ms with this patch
Interesting, I wonder why our times differ so much, just tested again with patches still applied searching for 'centerville' 3000 items: 480ms, 434ms, 449ms, 455ms
Do you want to swap our laptops? :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #19 from Jonathan Druart <jonathan.druart@gmail.com> --- To summary PM between Pedro and me. We should not use library's name to compare with and without the patch, we should compare with the same number of results returned (ofc!) Tested with the following script: use t::lib::TestBuilder; my $builder = t::lib::TestBuilder->new; my @branchcodes = Koha::Libraries->search->get_column('branchcode'); my $biblio = $builder->build_sample_biblio; for my $i ( 1..1000 ) { say $i; my $branchcode = @branchcodes[int(rand(scalar @branchcodes))]; $builder->build_sample_item({biblionumber => $biblio->biblionumber, library => $branchcode }); } say "biblionumber=".$biblio->biblionumber; Search "2024" in the global search to make sure 20 items will be displayed and the JOIN will happen. No need to use the column filters. I confirm the previous numbers ~700ms without vs ~900ms with those 2 patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #20 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Pedro Amorim from comment #17)
(In reply to Jonathan Druart from comment #14)
If we are adding 150ms per JOIN and are adding 3,4 per table, it's not a good...
I don't think we can affirm this just yet. Additional embeds need to be added to test this (e.g. status and/or collection)
FYI status is happening on bug 37334, but is totally different. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|lucas@bywatersolutions.com |pedro.amorim@ptfs-europe.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I'm not sure about the state of the discussion here. Should this be pushed or are the benchmarks/performance tests a blocker? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #22 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Katrin Fischer from comment #21)
I'm not sure about the state of the discussion here. Should this be pushed or are the benchmarks/performance tests a blocker?
Not blocker. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 --- Comment #23 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35361 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.11.00 |24.11.00,24.05.06 released in| | Status|Pushed to main |Pushed to stable --- Comment #24 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to oldstable |Needs documenting --- Comment #25 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 33568 not in 23.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=39011 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=39921 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 Bug 38130 depends on bug 33568, which changed state. Bug 33568 Summary: Use the REST API to display items on the staff biblio detail view https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33568 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38130 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #26 from David Nind <david@davidnind.com> --- Bug fix, no changes to the manual required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org