Summary: | search () give odd results with Zebra and ICU | ||
---|---|---|---|
Product: | Koha | Reporter: | Frédéric Demians <f.demians> |
Component: | Searching - Zebra | Assignee: | Galen Charlton <gmcharlt> |
Status: | CLOSED WORKSFORME | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | cbrannon, chris, cnighswonger, colin.campbell, dcook, dpavlin, f.demians, george, gmcharlt, jandrews, jdemuth, jesse, jonathan.druart, jwagner, kyle.m.hall, lculber, magnus, marjorie.barry-vila, martin.renvoize, mjr, patrick.robitaille |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8783 http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9212 http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13650 |
||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | |||
Bug Blocks: | 9234 | ||
Attachments: |
Patch to fix searching on ()
Patch to stop : blocking searches Bug 1807: Remove parens from links to fix searches [SIGNED OFF] Bug 1807: Remove parens from links to fix searches |
Description
Chris Cormack
2010-05-21 00:34:49 UTC
Question mark doesn't work either. Example, searching for the movie "Are we there yet?" retrieves no results, but the same search without the question mark "?" does. Needs to be fixed properly for 3.4 I'm getting no results if a subject heading has parens ( ) in it. /cgi-bin/koha/opac-search.pl?q=su:XHTML%20%28Document%20markup%20language%29 Tested with simple search in the OPAC, on current master. Looks like : has been fixed, but not (). I created a record with 245$a = Code 245$b = and other laws (of cyberspace) 100$a = Lessig, Lawrence * COLON These searches work: code : code : lessig code : and other code : and cyberspace while this does not work: code : and but that might be because "and" is seen as a boolean operator ans should have something after it? * PARENTHESIS This works: cyberspace (of cyberspace) Code and other laws Code : and other laws but, alas, not this: Code and other laws (of cyberspace) Code : and other laws (of cyberspace) Marking as "PATCH-Sent" and "Failed QA" to make sure it shows up in searches. Bumping this to master based on the last comment. () still not working in 3.6.0 release. the : behaviour is fixed, as well as the ? (comment 1) I have tested this on master with a search like Code and other laws (of cyberspace) and it does not work when it should. I have checked that the attached patches are in git, so I am marking them obsolete and putting this bug back to ASSIGNED which I think is more accurate and nearer the start of the lifecycle than Failed QA. //Fix subject search by striping parenthesis from url links $('#catalogue_detail_biblio a[href*="su:"]').attr('href', function(_,v){ return v.replace(/(\(|\))/g,'') }); This works for both the staff search and OPAC. (In reply to Jesse Maseto from comment #8) > > //Fix subject search by striping parenthesis from url links > $('#catalogue_detail_biblio a[href*="su:"]').attr('href', function(_,v){ > return v.replace(/(\(|\))/g,'') > }); > > This works for both the staff search and OPAC. Actually had to update this jquery to catch more. Simply striping the parenthesis isn't enough, because sometimes it will mash words together. And sometimes replacing it with a space throws off the search as well. This modification seems to work better at fixing the issue: //Fix subject search by striping parenthesis from url links $('#catalogue_detail_biblio a[href*="su:"]').attr('href', function(_,v){ return v.replace(/(\w)(\(|\))(\w)/g,'$1 $3') }).attr('href', function(_,v){ return v.replace(/(\(|\))/g,'') }); //End fix subject search I don't know if it addresses all situations, but I've been tweaking it as I come across new situations. Christopher The JS solution is working brilliantly in the OPAC, but there is no change on the staff side when I include this in intranetuserjs -- any suggestions on how to make it work there as well? (In reply to John Andrews from comment #10) > The JS solution is working brilliantly in the OPAC, but there is no change > on the staff side when I include this in intranetuserjs -- any suggestions > on how to make it work there as well? It's working on our end. Perhaps there is a conflicting jQuery? What version of Koha on you on? Christopher We're on 3.16.03.000. There are no other scripts in intranetuserjs that should affect details pages at all so I'm not sure where to even begin looking for a conflict. (In reply to John Andrews from comment #12) > We're on 3.16.03.000. > > There are no other scripts in intranetuserjs that should affect details > pages at all so I'm not sure where to even begin looking for a conflict. There may be conditions it is not able to catch. Have you tried other searches? Christopher Have tried various searches -- links with no parentheses work fine, all links I've found with parentheses return the broken search results. Cache cleared, and double-checked to make sure I copied the full script -- everything *looks* like it should be working correctly, but we still only get parentheses removed in the opac and not the staff client. John Sorry. I wish I could figure out what's stopping it from working. I guess someone will actually need to fix this. :/ Christopher Created attachment 35612 [details] [review] Bug 1807: Remove parens from links to fix searches This patch will resolve the issue of not being able to search with parens in a subject heading by editing the xslt To test: * Apply patch * Search Koha for a title with ( ) in the subject * Click the subject * Results should be returned * Repeat in OPAC and Staff client This patch was written by Winona Salesky - I'm hoping that came across in the patch. Nicole Created attachment 35646 [details] [review] [SIGNED OFF] Bug 1807: Remove parens from links to fix searches This patch will resolve the issue of not being able to search with parens in a subject heading by editing the xslt To test: * Apply patch * Search Koha for a title with ( ) in the subject * Click the subject * Results should be returned * Repeat in OPAC and Staff client Signed-off-by: Nick <Nick@quechelibrary.org> As far as I could see, this bug only manifested when using ICU Zebra indexing. This isn't default so wasn't on my VM and I lost facets when turning on so a second sign off wouldn't be out of line. Other than that the patch did correct the issue and worked fine in both staff and opac Comment on attachment 35646 [details] [review] [SIGNED OFF] Bug 1807: Remove parens from links to fix searches Hi Winona, don't worry, your patch hasn't gone missing! I moved it to bug 13650, as it deals with the subject links perfectly, but didn't fix the general problem that entering search terms with () is a problem. I'd like to keep this bug open in hope that gets fixed too at some point. Hi, This bug still persists in version 17.05 of Koha.Does anyone work on this problem? When you have a collection title with parenthesis, the search does not work. Thanks, Patrick. Seems to be working fine with elastic. I can't reproduce this problem in Zebra 2.0.59 when using ICU using the following queries: http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=cd http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=%28cd%29 If someone can provide me with the steps to reproduce the problem, I could look into this more. |