Bug 26860 - Add search limit for records without items
Summary: Add search limit for records without items
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin Somers
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-29 13:33 UTC by Fridolin Somers
Modified: 2023-12-28 20:42 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Can be hidden with CSS, using the #withoutitems_id selector. RM NOTE: Reverted
Version(s) released in:


Attachments
Bug 26860: facets.inc refactor availability facet (2.87 KB, patch)
2020-11-02 16:10 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26860: Add without items facet (6.83 KB, patch)
2020-11-02 16:11 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26860: facets.inc refactor availability facet (3.01 KB, patch)
2020-11-03 11:46 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 26860: Add without items facet (6.99 KB, patch)
2020-11-03 11:46 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 26860: facets.inc refactor availability facet (3.07 KB, patch)
2020-11-03 14:38 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 26860: Add without items facet (7.04 KB, patch)
2020-11-03 14:38 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 26860: (follow-up) case requesting zebra with ccl query (2.21 KB, patch)
2020-11-06 09:18 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26860: facets.inc refactor availability facet (3.12 KB, patch)
2021-04-02 10:14 UTC, David Nind
Details | Diff | Splinter Review
Bug 26860: Add without items facet (7.12 KB, patch)
2021-04-02 10:14 UTC, David Nind
Details | Diff | Splinter Review
Bug 26860: (follow-up) case requesting zebra with ccl query (2.25 KB, patch)
2021-04-02 10:14 UTC, David Nind
Details | Diff | Splinter Review
Bug 26860: facets.inc refactor availability facet (3.19 KB, patch)
2021-05-14 17:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 26860: facets.inc refactor availability facet (3.17 KB, patch)
2021-08-26 22:09 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26860: Add without items facet (7.03 KB, patch)
2021-08-26 22:09 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26860: (follow-up) case requesting zebra with ccl query (2.25 KB, patch)
2021-08-26 22:10 UTC, Fridolin Somers
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2020-10-29 13:33:14 UTC
May libraries ask for a way to search biblio records without items.
In order to clean the catalogue or acquire items.
I propose to add a search limit and facet.
Only in staff interface for start.
Comment 1 Andrew Fuerste-Henry 2020-10-29 14:35:01 UTC
+1, this would be handy
Comment 2 Fridolin Somers 2020-11-02 16:10:44 UTC
Created attachment 112858 [details] [review]
Bug 26860: facets.inc refactor availability facet

To prepare new facet, this patch refactors the availability facet,
without any change in restult.
Appart from an id 'facet-availability', like other facets.

Test plan:
1) Perform a search in staff interface
2) Check availability facet displays well
3) Click on it
4) Check availability facet displays well
Comment 3 Fridolin Somers 2020-11-02 16:11:03 UTC
Created attachment 112859 [details] [review]
Bug 26860: Add without items facet

Many libraries ask for a way to search biblio records without items.
In order to clean the catalogue or acquire items.
I propose to add a search limit and facet.
Only in staff interface for start.

I choose to use homebranch index, should always be defined on items.
Looks like itemnumber index can not be used because of its configuration in ccl.properties.

Test plan :
1) Check with both Zebra and Elasticsearch
2) Perform a search on staff interface returning some records with and some without items
3) Click on 'Limit to records without items'
4) Check you see only records without items
5) Click on 'Show all records'
6) Check you see all records again
Comment 4 Fridolin Somers 2020-11-02 16:12:54 UTC
I've add a TODO for code dealing with "ccl=".
I will create a follow-up
Comment 5 Séverine Queune 2020-11-03 11:46:09 UTC
Created attachment 112913 [details] [review]
Bug 26860: facets.inc refactor availability facet

To prepare new facet, this patch refactors the availability facet,
without any change in restult.
Appart from an id 'facet-availability', like other facets.

Test plan:
1) Perform a search in staff interface
2) Check availability facet displays well
3) Click on it
4) Check availability facet displays well

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 6 Séverine Queune 2020-11-03 11:46:12 UTC
Created attachment 112914 [details] [review]
Bug 26860: Add without items facet

Many libraries ask for a way to search biblio records without items.
In order to clean the catalogue or acquire items.
I propose to add a search limit and facet.
Only in staff interface for start.

I choose to use homebranch index, should always be defined on items.
Looks like itemnumber index can not be used because of its configuration in ccl.properties.

Test plan :
1) Check with both Zebra and Elasticsearch
2) Perform a search on staff interface returning some records with and some without items
3) Click on 'Limit to records without items'
4) Check you see only records without items
5) Click on 'Show all records'
6) Check you see all records again

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 7 Séverine Queune 2020-11-03 11:47:52 UTC
Can't test with Zebra, I only validate the very good behaviour with ES.
Thanks Frido for this nice patch :)
Comment 8 Tomás Cohen Arazi 2020-11-03 14:38:14 UTC
Created attachment 112931 [details] [review]
Bug 26860: facets.inc refactor availability facet

To prepare new facet, this patch refactors the availability facet,
without any change in restult.
Appart from an id 'facet-availability', like other facets.

Test plan:
1) Perform a search in staff interface
2) Check availability facet displays well
3) Click on it
4) Check availability facet displays well

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Tomás Cohen Arazi 2020-11-03 14:38:18 UTC
Created attachment 112932 [details] [review]
Bug 26860: Add without items facet

Many libraries ask for a way to search biblio records without items.
In order to clean the catalogue or acquire items.
I propose to add a search limit and facet.
Only in staff interface for start.

I choose to use homebranch index, should always be defined on items.
Looks like itemnumber index can not be used because of its configuration in ccl.properties.

Test plan :
1) Check with both Zebra and Elasticsearch
2) Perform a search on staff interface returning some records with and some without items
3) Click on 'Limit to records without items'
4) Check you see only records without items
5) Click on 'Show all records'
6) Check you see all records again

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 10 Jonathan Druart 2020-11-04 13:52:22 UTC
Comment on attachment 112932 [details] [review]
Bug 26860: Add without items facet

Review of attachment 112932 [details] [review]:
-----------------------------------------------------------------

::: C4/Search.pm
@@ +1322,4 @@
>              }
>              $q .= ' and '.join(' and ', @limits) if @limits;
>          }
> +        #TODO withoutitems limit

What is this TODO about?
Comment 11 Jonathan Druart 2020-11-04 13:53:01 UTC
(In reply to Fridolin SOMERS from comment #4)
> I've add a TODO for code dealing with "ccl=".
> I will create a follow-up

Still waiting the follow-up then?
Comment 12 Fridolin Somers 2020-11-06 09:10:14 UTC
CCL part refers to :
Bug 17278: Use available limit when requesting zebra when ccl query is used
Comment 13 Fridolin Somers 2020-11-06 09:18:27 UTC
Created attachment 113220 [details] [review]
Bug 26860: (follow-up) case requesting zebra with ccl query

When calling a ccl syntax query, code must be added like for
availability facet.
See Bug 17278: Use available limit when requesting zebra when ccl query is used

This patch also changes "grep {!/^available$/} @limits" to use "grep { $_ ne 'available' } @limits".
Following the logic of :
Bug 23084: Replace grep {^$var$} with grep {$_ eq $var}

Test plan :
1) Use Zebra search engine
2) Perform a search on staff interface with explicit index, for example 'ti:history'
3) This search must return some records with and some without items
4) Click on 'Limit to records without items'
5) Check you see only records without items
6) Click on 'Show all records'
7) Check you see all records again
8) Check availability facet is also working
Comment 14 David Nind 2021-04-02 10:14:13 UTC
Created attachment 119112 [details] [review]
Bug 26860: facets.inc refactor availability facet

To prepare new facet, this patch refactors the availability facet,
without any change in restult.
Appart from an id 'facet-availability', like other facets.

Test plan:
1) Perform a search in staff interface
2) Check availability facet displays well
3) Click on it
4) Check availability facet displays well

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Comment 15 David Nind 2021-04-02 10:14:18 UTC
Created attachment 119113 [details] [review]
Bug 26860: Add without items facet

Many libraries ask for a way to search biblio records without items.
In order to clean the catalogue or acquire items.
I propose to add a search limit and facet.
Only in staff interface for start.

I choose to use homebranch index, should always be defined on items.
Looks like itemnumber index can not be used because of its configuration in ccl.properties.

Test plan :
1) Check with both Zebra and Elasticsearch
2) Perform a search on staff interface returning some records with and some without items
3) Click on 'Limit to records without items'
4) Check you see only records without items
5) Click on 'Show all records'
6) Check you see all records again

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>
Comment 16 David Nind 2021-04-02 10:14:23 UTC
Created attachment 119114 [details] [review]
Bug 26860: (follow-up) case requesting zebra with ccl query

When calling a ccl syntax query, code must be added like for
availability facet.
See Bug 17278: Use available limit when requesting zebra when ccl query is used

This patch also changes "grep {!/^available$/} @limits" to use "grep { $_ ne 'available' } @limits".
Following the logic of :
Bug 23084: Replace grep {^$var$} with grep {$_ eq $var}

Test plan :
1) Use Zebra search engine
2) Perform a search on staff interface with explicit index, for example 'ti:history'
3) This search must return some records with and some without items
4) Click on 'Limit to records without items'
5) Check you see only records without items
6) Click on 'Show all records'
7) Check you see all records again
8) Check availability facet is also working

Signed-off-by: David Nind <david@davidnind.com>
Comment 17 Kyle M Hall 2021-05-14 17:46:24 UTC
Created attachment 120994 [details] [review]
Bug 26860: facets.inc refactor availability facet

To prepare new facet, this patch refactors the availability facet,
without any change in restult.
Appart from an id 'facet-availability', like other facets.

Test plan:
1) Perform a search in staff interface
2) Check availability facet displays well
3) Click on it
4) Check availability facet displays well

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 18 Jonathan Druart 2021-06-21 12:03:41 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 19 Kyle M Hall 2021-07-02 13:39:35 UTC
Enhancment not backported to 21.05.x
Comment 20 Fridolin Somers 2021-08-13 18:54:14 UTC
(In reply to Kyle M Hall from comment #17)
> Created attachment 120994 [details] [review] [review]
> Bug 26860: facets.inc refactor availability facet
> 
Oh crap, only first patch has been QA and others set obsolete.

So only first patch is in master :
 > git log --online --grep=26860 origin/master 
63d6c1d8c5 Bug 26860: facets.inc refactor availability facet
Comment 21 Jonathan Druart 2021-08-16 10:26:58 UTC
The patch that has been pushed is now reverted. Please clarify the situation.

Tests are missing anyway and the patches are not ready for integration into master.
Comment 22 Fridolin Somers 2021-08-26 22:09:33 UTC
Created attachment 124125 [details] [review]
Bug 26860: facets.inc refactor availability facet

To prepare new facet, this patch refactors the availability facet,
without any change in restult.
Appart from an id 'facet-availability', like other facets.

Test plan:
1) Perform a search in staff interface
2) Check availability facet displays well
3) Click on it
4) Check availability facet displays well

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 23 Fridolin Somers 2021-08-26 22:09:53 UTC
Created attachment 124126 [details] [review]
Bug 26860: Add without items facet

Many libraries ask for a way to search biblio records without items.
In order to clean the catalogue or acquire items.
I propose to add a search limit and facet.
Only in staff interface for start.

I choose to use homebranch index, should always be defined on items.
Looks like itemnumber index can not be used because of its configuration in ccl.properties.

Test plan :
1) Check with both Zebra and Elasticsearch
2) Perform a search on staff interface returning some records with and some without items
3) Click on 'Limit to records without items'
4) Check you see only records without items
5) Click on 'Show all records'
6) Check you see all records again

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>
Comment 24 Fridolin Somers 2021-08-26 22:10:07 UTC
Created attachment 124127 [details] [review]
Bug 26860: (follow-up) case requesting zebra with ccl query

When calling a ccl syntax query, code must be added like for
availability facet.
See Bug 17278: Use available limit when requesting zebra when ccl query is used

This patch also changes "grep {!/^available$/} @limits" to use "grep { $_ ne 'available' } @limits".
Following the logic of :
Bug 23084: Replace grep {^$var$} with grep {$_ eq $var}

Test plan :
1) Use Zebra search engine
2) Perform a search on staff interface with explicit index, for example 'ti:history'
3) This search must return some records with and some without items
4) Click on 'Limit to records without items'
5) Check you see only records without items
6) Click on 'Show all records'
7) Check you see all records again
8) Check availability facet is also working

Signed-off-by: David Nind <david@davidnind.com>
Comment 25 Fridolin Somers 2022-11-28 08:32:07 UTC
Maybe can now be implemented with Bug 17170
Comment 26 Fridolin Somers 2022-12-12 19:58:05 UTC
(In reply to Fridolin Somers from comment #25)
> Maybe can now be implemented with Bug 17170

Yes it can :D