Bug 4852

Summary: Facets doesn't work with direct CCL queries
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: SearchingAssignee: Robin Sheat <robin>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: minor    
Priority: PATCH-Sent (DO NOT USE) CC: chris, jcamins, julian.maurice, jwagner, robin
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: proposed patch
Signed-off patch

Description Fridolin Somers 2010-06-04 14:28:35 UTC
When using for search a direct CCL query (ie "q=su:action"), by editing URL or using some links (ie the link to subject in normal view of opac-details.pl).
In this case, facets links are like (ie for branches) : 
"opac-search.pl?q=ccl=su:action&limit=branch:BR".
This search doesn't limit the number of results : facet doesn't work.

I think it comes from lib/C4/Search.pm.

Version 3.2 alpha 2.
Comment 1 Robin Sheat 2010-08-12 00:17:13 UTC
Steps to reproduce in the OPAC:
1) Do a CCL query. This is searching on a particular field, e.g. subject, but not using the dropdown. Either have the search term be 'su:Subject' or click on a subject (or author, or...) in a record.
2) Click on a facet on the left in order to refine the search
3) Note that the search isn't refined.

The query in the URL that doesn't work ends with: 
?q=ccl=au:Michael Fullan&limit=au:Mascall, Blair.

A version of this that would work:
?q=ccl=au:Michael Fullan and au:Mascall, Blair.
Comment 2 Robin Sheat 2010-08-13 04:31:14 UTC
Created attachment 2519 [details] [review]
proposed patch

This patch is intended for anyone interested in testing it. Once it's gone through our QA, I'll submit it to the list and switch the status on this bug.
Comment 3 Chris Cormack 2010-12-14 07:59:04 UTC
Wheres this at now Robin?
Comment 4 Fridolin Somers 2010-12-14 10:31:32 UTC
Patch tested,
It works fine.

Workflow :
Click on a link in details view (ie "au:La Fontaine").
You will see that facets are a ccl search with limits.
Click on facets, it works.
Comment 5 Chris Cormack 2010-12-14 23:57:32 UTC
Fridolyn, excellent thanks for the test.

Are you up for trying to sign off the patch?

http://wiki.koha-community.org/wiki/Sign_off_on_patches
Comment 6 Fridolin Somers 2010-12-15 08:46:07 UTC
(In reply to comment #5)
> Fridolyn, excellent thanks for the test.
> 
> Are you up for trying to sign off the patch?
> 
> http://wiki.koha-community.org/wiki/Sign_off_on_patches

Sorry, I'm a beginner with git.
I've got to get familiar with it.
I think I'll try another time.

Regards,
Comment 7 Robin Sheat 2010-12-16 06:59:39 UTC
If you can apply the patch, you're 95% of the way to being able to sign off on it :)
Comment 8 Jared Camins-Esakov 2011-02-24 21:35:37 UTC
Created attachment 3217 [details] [review]
Signed-off patch

Applied and tested against current master.
Comment 9 Chris Cormack 2011-03-04 00:01:22 UTC
Pushed, please test and mark resolved
Comment 10 MJ Ray (software.coop) 2011-03-04 10:27:10 UTC
This bug is mentioned in:
Bug 4852 - rewrite the query to	include limits if using ccl= http://lists.koha-community.org/pipermail/koha-patches/2011-February/013930.html
Bug 4852 - rewrite the query to include	limits if using ccl= http://lists.koha-community.org/pipermail/koha-patches/2011-February/013931.html