[Bug 9368] New: specific behavior of yr and acqdate indexes
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Bug ID: 9368 Summary: specific behavior of yr and acqdate indexes Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Searching Assignee: gmcharlt@gmail.com Reporter: fridolyn.somers@biblibre.com When searching on date of publication or date of acquisition index from advanced search, there are several bugs : - The search is performed on no index, using only search therm. - The next or previous pages lead to an empty result page. This comes from specific behavior in C4/Search.pm. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|gmcharlt@gmail.com |fridolyn.somers@biblibre.co | |m --- Comment #1 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 14472 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14472&action=edit Proposed patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 --- Comment #2 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- See test plan in commit message -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14472|0 |1 is obsolete| | --- Comment #3 from Galen Charlton <gmcharlt@gmail.com> --- Created attachment 15114 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=15114&action=edit Bug 9368: specific behavior of yr and acqdate indexes When searching on the date of publication or date of acquisition indexes from advanced search, there are several bugs : - The search is performed on specific index, using only search term. - The next or previous pages lead to an empty result page. This comes from specific behavior in C4/Search.pm, $indexes_set flag is used but the index is not added to the operand. This patch corrects this. Test plan : - Go to advanced search in the staff interface - Select publication date or acquisition date - Enter a valid search term (you must have several pages of results) - Click on search => result page shows a correct result number - Click on page 2 => next results are shown Signed-off-by: Galen Charlton <gmc@esilibrary.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |jonathan.druart@biblibre.co | |m Patch complexity|Trivial patch |Small patch QA Contact| |jonathan.druart@biblibre.co | |m --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- QA comment: Before this patch, if the "publication date" index is selected on the adv search form, zebra requests on @attrset Bib-1 2000 The index is not defined! After applying it: @attrset Bib-1 @attr 1=pubdate @attr 4=109 @attr 2=3 2000 Which is what the user want. Marked as Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #15114|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 16268 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=16268&action=edit Bug 9368: specific behavior of yr and acqdate indexes When searching on the date of publication or date of acquisition indexes from advanced search, there are several bugs : - The search is performed on specific index, using only search term. - The next or previous pages lead to an empty result page. This comes from specific behavior in C4/Search.pm, $indexes_set flag is used but the index is not added to the operand. This patch corrects this. Test plan : - Go to advanced search in the staff interface - Select publication date or acquisition date - Enter a valid search term (you must have several pages of results) - Click on search => result page shows a correct result number - Click on page 2 => next results are shown Signed-off-by: Galen Charlton <gmc@esilibrary.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |ASSIGNED Assignee|fridolyn.somers@biblibre.co |jcamins@cpbibliography.com |m | --- Comment #6 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This breaks the yr and acqdate indexes when QP is enabled. I will provide a counter-patch or follow-up once we are in feature freeze (assigning to myself so that I don't forget). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 --- Comment #7 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- (In reply to Jared Camins-Esakov from comment #6)
This breaks the yr and acqdate indexes when QP is enabled. I will provide a counter-patch or follow-up once we are in feature freeze (assigning to myself so that I don't forget). If QP is enabled, those special behavior for yr and acqdate are usless non ? May we add a "unless useQueryParser" condition ?
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |In Discussion --- Comment #8 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- (In reply to Jared Camins-Esakov from comment #6)
This breaks the yr and acqdate indexes when QP is enabled. I will provide a counter-patch or follow-up once we are in feature freeze (assigning to myself so that I don't forget). If QP is enabled, those special behavior for yr and acqdate are usless non ? May we add a "unless useQueryParser" condition ?
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Jared, can you submit a follow-up for the QueryParser? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 mathieu saby <mathieu.saby@univ-rennes2.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mathieu.saby@univ-rennes2.f | |r --- Comment #10 from mathieu saby <mathieu.saby@univ-rennes2.fr> --- Hello I discovered the problem recently and signaled it to Biblibre, who pointed to this bug... Not a big issue, but it must be fixed, for QP and non-QP instances... Maybe an alternative could be to suppress the ability to select a date with the dropdown list (I'm not sure that's very intuitive), and just use the special input field made for filtering by dates. Mathieu -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 --- Comment #11 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- (In reply to mathieu saby from comment #10)
Maybe an alternative could be to suppress the ability to select a date with the dropdown list (I'm not sure that's very intuitive), and just use the special input field made for filtering by dates. +1
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 --- Comment #12 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 26652 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26652&action=edit Bug 9368 - do not change if QueryParser -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 --- Comment #13 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- @Jared Here is the follow-up to change code only if not QP on. "Bug 9368 - do not change if QueryParser" needs signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|minor |normal -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #14 from David Cook <dcook@prosentient.com.au> --- It looks to me that "Publication Date (yyyy)" searching is already broken in master (before applying these patches) when using QueryParser. I get a query like this: @attr 2=102 @or @or @attr 1=1016 @attr 5=1 @attr 4=6 "yr:2012" @attr 9=20 @attr 2=102 @attr 5=1 @attr 4=6 "yr:2012" @attr 9=34 @attr 2=102 @attr 5=1 @attr 4=6 "yr:2012" It's trying to do a keyword search with the keyword string as "yr:2012". It's worth noting that the "Bug 9368 - do not change if QueryParser" patch doesn't fix this. -- I have a counter-patch that I will be posting in a moment, which will fix the non-QueryParser search, and which will cause QueryParser to fallback to non-QueryParser mode instead of breaking. (It seems to me that QueryParser needs a lot more work before its able to replace the existing buildQuery, unfortunately.) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 --- Comment #15 from David Cook <dcook@prosentient.com.au> --- Created attachment 28916 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28916&action=edit Bug 9368 [ALTERNATE] - specific behavior of yr and acqdate indexes This patch fixes the "Publication date" and "Acquisition date" searches when using non-QueryParser and QueryParser searches. It adds structure attributes to the template, which is consistent with how phrase searching is currently handled. It removes unnecessary code from Search.pm, adds some necessary code which is consistent with existing code, and adds a lot of explanatory comments. _TEST PLAN_ Before applying: 0) Turn off QueryParser 1) Try a "Publication date" or "Acquisition date" search from the staff client advanced search. 2) Note that even though the description on the result page makes it seem like you're doing an index-specific search, you're actually doing a keyword search. You can verify this by checking the 008 from positions 7 to 10 for "Publication date" or "Date accessioned" on items for "Acquisition date". 3) Turn on QueryParser 4) Try doing the searches from Step 1. 5) A "Publication date" search should probably produce zero results After applying patch: 6) Keep QueryParser on 7) Try doing the searches from Step 1. 8) Notice that you're actually getting results consistent with your search (ie the 008/7-10 shows the date you searched for, and there is a "Date accessioned" in items which matches your search) 9) Turn off QueryParser 10) Note that your results are exactly the same as step 8 (N.B. this is because QueryParser is falling back to non-QP mode instead of producing a bad query.) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 --- Comment #16 from David Cook <dcook@prosentient.com.au> --- Btw, it also fixes the paging issue. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P3 Assignee|jcamins@cpbibliography.com |dcook@prosentient.com.au --- Comment #17 from David Cook <dcook@prosentient.com.au> --- I'm going to assign this to myself, since I think my alternate patch solves the key problems of this issue. I have a few other bugs out there which mention QueryParser problems, and I'm hoping to unite those some point down the road -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #16268|0 |1 is obsolete| | Attachment #26652|0 |1 is obsolete| | Attachment #28916|0 |1 is obsolete| | --- Comment #18 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 30318 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=30318&action=edit Bug 9368 [ALTERNATE] - specific behavior of yr and acqdate indexes This patch fixes the "Publication date" and "Acquisition date" searches when using non-QueryParser and QueryParser searches. It adds structure attributes to the template, which is consistent with how phrase searching is currently handled. It removes unnecessary code from Search.pm, adds some necessary code which is consistent with existing code, and adds a lot of explanatory comments. _TEST PLAN_ Before applying: 0) Turn off QueryParser 1) Try a "Publication date" or "Acquisition date" search from the staff client advanced search. 2) Note that even though the description on the result page makes it seem like you're doing an index-specific search, you're actually doing a keyword search. You can verify this by checking the 008 from positions 7 to 10 for "Publication date" or "Date accessioned" on items for "Acquisition date". 3) Turn on QueryParser 4) Try doing the searches from Step 1. 5) A "Publication date" search should probably produce zero results After applying patch: 6) Keep QueryParser on 7) Try doing the searches from Step 1. 8) Notice that you're actually getting results consistent with your search (ie the 008/7-10 shows the date you searched for, and there is a "Date accessioned" in items which matches your search) 9) Turn off QueryParser 10) Note that your results are exactly the same as step 8 (N.B. this is because QueryParser is falling back to non-QP mode instead of producing a bad query.) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 --- Comment #19 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Works great, thanks David. I've tested search on year range (yr:1999-2001) and using next/previous page in results. Everything is ok. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=12742 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|jonathan.druart@biblibre.co | |m | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #30318|0 |1 is obsolete| | --- Comment #20 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 31552 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31552&action=edit [PASSED QA] Bug 9368 [ALTERNATE] - specific behavior of yr and acqdate indexes This patch fixes the "Publication date" and "Acquisition date" searches when using non-QueryParser and QueryParser searches. It adds structure attributes to the template, which is consistent with how phrase searching is currently handled. It removes unnecessary code from Search.pm, adds some necessary code which is consistent with existing code, and adds a lot of explanatory comments. _TEST PLAN_ Before applying: 0) Turn off QueryParser 1) Try a "Publication date" or "Acquisition date" search from the staff client advanced search. 2) Note that even though the description on the result page makes it seem like you're doing an index-specific search, you're actually doing a keyword search. You can verify this by checking the 008 from positions 7 to 10 for "Publication date" or "Date accessioned" on items for "Acquisition date". 3) Turn on QueryParser 4) Try doing the searches from Step 1. 5) A "Publication date" search should probably produce zero results After applying patch: 6) Keep QueryParser on 7) Try doing the searches from Step 1. 8) Notice that you're actually getting results consistent with your search (ie the 008/7-10 shows the date you searched for, and there is a "Date accessioned" in items which matches your search) 9) Turn off QueryParser 10) Note that your results are exactly the same as step 8 (N.B. this is because QueryParser is falling back to non-QP mode instead of producing a bad query.) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9368 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks David! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org