related: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27546 In 22.11 has been added the option of searching within results of a search, it should be nice to add also to opac. Or even it could be improved with the chance of search within subcollections.. It should be great if a search could be filtered by default via itypetype, ccode or anyother value in item or perhaps and biblio and koha keeps the filter in all searches of a user does. For example: if a library have a special collection of old books, and a user starts a search limiting by collection, let the filter on and being able to search within results now a facet filter od ccode limitation is lost when launch a search BR
Created attachment 153693 [details] [review] Bug 34021: Add 'search within' to OPAC This change adds a "Search within results" box to the OPAC, which complements the feature already in the staff interface. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl 2. Type "e" in the search box and click the search button 3. Click the "Books" value for the "Item types" facet, and note there are fewer search results 4. Type "test" into the "Search within results" box and click the Search button next to the box 5. Note that now there are only 2 results. 6. Also note that the "Books" facet is still selected
Created attachment 153729 [details] [review] Bug 34021: Add 'search within' to OPAC This change adds a "Search within results" box to the OPAC, which complements the feature already in the staff interface. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl 2. Type "e" in the search box and click the search button 3. Click the "Books" value for the "Item types" facet, and note there are fewer search results 4. Type "test" into the "Search within results" box and click the Search button next to the box 5. Note that now there are only 2 results. 6. Also note that the "Books" facet is still selected Signed-off-by: Sam Lau <samalau@gmail.com>
Hey David, I imagine some libraries will want to hide this altogether. Could we possibily wrap it label/input in a HTML element w/ a class or ID? That would make it easy to do so.
Created attachment 155872 [details] [review] Bug 34021: wrap search within using block with an ID for styling
(In reply to Lucas Gass from comment #3) > Hey David, > > I imagine some libraries will want to hide this altogether. Could we > possibily wrap it label/input in a HTML element w/ a class or ID? That would > make it easy to do so. Sure thing. Popped this back to Signed Off as it was a simple change.
Created attachment 158137 [details] [review] Bug 34021: Add 'search within' to OPAC This change adds a "Search within results" box to the OPAC, which complements the feature already in the staff interface. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl 2. Type "e" in the search box and click the search button 3. Click the "Books" value for the "Item types" facet, and note there are fewer search results 4. Type "test" into the "Search within results" box and click the Search button next to the box 5. Note that now there are only 2 results. 6. Also note that the "Books" facet is still selected Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 158138 [details] [review] Bug 34021: wrap search within using block with an ID for styling Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I hate failing my own stuff, but I noticed a problem. If you do a search like this one: http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=an%3A104&weight_search=1 You can try to "Search within results" using "Alcestis" but it won't work. The reason is that this URL is the one that is constructed: http://localhost:8080/cgi-bin/koha/opac-search.pl?q=ccl%3Dan%3A104&idx=kw&q=Alcestis&sort_by=relevance&addto=Add+to... The an:104 has a ccl= prefix which causes the rest of the query string to be ignored. So either Search.pm needs a change or this change needs to be changed. -- It looks like a fix could be to follow the code from bug 27546 and instead of adding a "idx=kw and q=X" just add a "limit=X". At a glance, that looks like it would work.
(In reply to David Cook from comment #8) > It looks like a fix could be to follow the code from bug 27546 and instead > of adding a "idx=kw and q=X" just add a "limit=X". At a glance, that looks > like it would work. Technically, that will yield a worse version of "search within" than I had in some ways, but it would make it consistent with the staff interface version. In order to get limit to work like "idx=kw and q=X", we'd need to add "kw,wrdl,rtrn:" in front of "X" which would need some Javascript.
Created attachment 158166 [details] [review] Bug 34021: Make search within OPAC consistent with staff interface Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl 2. Type "an:104" in the search box and click the search button 3. Type "Alcestis" into the "Search within results" box and click the Search button next to the box 4. Note that now there are only 2 results 5. Type "Dale" into the "Search within results" box and click the Search button next to the box 6. Note that you're taken directly to the last result
Created attachment 158579 [details] [review] Bug 34021: Add 'search within' to OPAC This change adds a "Search within results" box to the OPAC, which complements the feature already in the staff interface. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl 2. Type "e" in the search box and click the search button 3. Click the "Books" value for the "Item types" facet, and note there are fewer search results 4. Type "test" into the "Search within results" box and click the Search button next to the box 5. Note that now there are only 2 results. 6. Also note that the "Books" facet is still selected Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 158580 [details] [review] Bug 34021: wrap search within using block with an ID for styling Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 158581 [details] [review] Bug 34021: Make search within OPAC consistent with staff interface Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-main.pl 2. Type "an:104" in the search box and click the search button 3. Type "Alcestis" into the "Search within results" box and click the Search button next to the box 4. Note that now there are only 2 results 5. Type "Dale" into the "Search within results" box and click the Search button next to the box 6. Note that you're taken directly to the last result Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
The new limit does not show up in the search results description. It does in the staff search.