Bug 22605 - Adding the option to modify/edit searches on the staff client
Summary: Adding the option to modify/edit searches on the staff client
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 17170 27546
  Show dependency treegraph
 
Reported: 2019-03-28 21:05 UTC by Alexandre
Modified: 2021-02-22 19:53 UTC (History)
8 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 22605: Add ability to edit a search on staff interface (28.96 KB, patch)
2020-12-29 16:14 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (28.96 KB, patch)
2020-12-29 17:47 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (29.02 KB, patch)
2020-12-29 19:11 UTC, Kelly McElligott
Details | Diff | Splinter Review
Bug 22605: Add ability to edit a search on staff interface (29.04 KB, patch)
2021-02-22 19:53 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre 2019-03-28 21:05:27 UTC
Once we did an advanced search in the OPAC, we have have the option to modify the criterias of this last search ("Return to the last advanced search" just on top of the results list). 

But in the "on site" Koha we don't have this option. Wchich can save a lot of time when we have long and precise searches to do allowing to refine the criterias rather than enter all of them again.

Thanks,

Alexandre
Comment 1 Alexandre 2019-03-29 13:32:37 UTC
By "on site" I mean staff interface.

Thanks,

Alexandre
Comment 2 Nick Clemens 2020-12-29 16:14:01 UTC
Created attachment 114728 [details] [review]
Bug 22605: Add ability to edit a search on staff interface

This patch adds the ability to parse the current search and populate the advanced search page on the staff side accordingly.
When searching you will now have an 'Edit this search' link underneath your current search terms

A few notes:
1 - Library limits can be applied multiple times either as 'AND' option, or using groups for 'OR'
2 - Previous selected items appear with a checkbox, unchecking 'disables' them and removes from the search
3 - Facets and unrecognized limits will appear at the end of the form under 'Other limits' - there could be future enhancement to parse there better, but I believe this is sufficient for now

To test:
1 - Perform a variety of search on the staff interface
2 - Confirm the 'edit search' button appear below your search
3 - Confirm that options are retained and correctly parsed
4 - Test with library groups - you should be able to combine groups after initial search, or remove individual libraries when editing
5 - Test that selecting a goup disables the individual libraries options

QA note: Missing filters on deletion of keys form hash are false positives
Comment 3 Andrew Fuerste-Henry 2020-12-29 17:04:17 UTC
I'm running into problems:
- apply patch
- restart all
- go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl
- search title: Street, get results (http://localhost:8081/cgi-bin/koha/catalogue/search.pl?advsearch=1&idx=ti&q=street&idx=kw&q=&idx=kw&q=&sort_by=relevance)
- click Edit Search
- go to page where my title is not shown in the search form but does appear in the url? (http://localhost:8081/cgi-bin/koha/catalogue/search.pl?advsearch=1&idx=ti&q=street&idx=kw&q=&idx=kw&q=&sort_by=relevance)
Comment 4 Andrew Fuerste-Henry 2020-12-29 17:13:42 UTC
Additionally, the more I think about this the more I dislike adding this new wrinkle of and/or multi-branch searching as sort of an afterthought to this feature. I'd be happier to see that split into a separate bug, in hopes of it getting more eyes and feedback.
Comment 5 Nick Clemens 2020-12-29 17:47:13 UTC
Created attachment 114734 [details] [review]
Bug 22605: Add ability to edit a search on staff interface

This patch adds the ability to parse the current search and populate the advanced search page on the staff side accordingly.
When searching you will now have an 'Edit this search' link underneath your current search terms

A few notes:
1 - Library limits can be applied multiple times either as 'AND' option, or using groups for 'OR'
2 - Previous selected items appear with a checkbox, unchecking 'disables' them and removes from the search
3 - Facets and unrecognized limits will appear at the end of the form under 'Other limits' - there could be future enhancement to parse there better, but I believe this is sufficient for now

To test:
1 - Perform a variety of search on the staff interface
2 - Confirm the 'edit search' button appear below your search
3 - Confirm that options are retained and correctly parsed
4 - Test with library groups - you should be able to combine groups after initial search, or remove individual libraries when editing
5 - Test that selecting a goup disables the individual libraries options

QA note: Missing filters on deletion of keys form hash are false positives
Comment 6 Kelly McElligott 2020-12-29 19:11:36 UTC
Created attachment 114736 [details] [review]
Bug 22605: Add ability to edit a search on staff interface

This patch adds the ability to parse the current search and populate the advanced search page on the staff side accordingly.
When searching you will now have an 'Edit this search' link underneath your current search terms

A few notes:
1 - Library limits can be applied multiple times either as 'AND' option, or using groups for 'OR'
2 - Previous selected items appear with a checkbox, unchecking 'disables' them and removes from the search
3 - Facets and unrecognized limits will appear at the end of the form under 'Other limits' - there could be future enhancement to parse there better, but I believe this is sufficient for now

To test:
1 - Perform a variety of search on the staff interface
2 - Confirm the 'edit search' button appear below your search
3 - Confirm that options are retained and correctly parsed
4 - Test with library groups - you should be able to combine groups after initial search, or remove individual libraries when editing
5 - Test that selecting a goup disables the individual libraries options

QA note: Missing filters on deletion of keys form hash are false positives

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 7 David Cook 2021-01-04 01:30:29 UTC
We've implemented an "edit search" feature for years locally. It'll be interesting to see what this one is like...
Comment 8 Katrin Fischer 2021-02-17 20:29:36 UTC
Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 22605: Add ability to edit a search on staff interface
.git/rebase-apply/patch:441: trailing whitespace.
        
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	C4/Search.pm
M	Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
M	catalogue/search.pl
M	koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
.git/rebase-apply/patch:441: trailing whitespace.
        
warning: 1 line adds whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
Auto-merging catalogue/search.pl
Auto-merging Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
CONFLICT (content): Merge conflict in Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
Auto-merging C4/Search.pm
Comment 9 Nick Clemens 2021-02-22 19:53:12 UTC
Created attachment 117174 [details] [review]
Bug 22605: Add ability to edit a search on staff interface

This patch adds the ability to parse the current search and populate the advanced search page on the staff side accordingly.
When searching you will now have an 'Edit this search' link underneath your current search terms

A few notes:
1 - Library limits can be applied multiple times either as 'AND' option, or using groups for 'OR'
2 - Previous selected items appear with a checkbox, unchecking 'disables' them and removes from the search
3 - Facets and unrecognized limits will appear at the end of the form under 'Other limits' - there could be future enhancement to parse there better, but I believe this is sufficient for now

To test:
1 - Perform a variety of search on the staff interface
2 - Confirm the 'edit search' button appear below your search
3 - Confirm that options are retained and correctly parsed
4 - Test with library groups - you should be able to combine groups after initial search, or remove individual libraries when editing
5 - Test that selecting a goup disables the individual libraries options

QA note: Missing filters on deletion of keys form hash are false positives

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>