Bug 10688 - QueryParser doesn't recognize QP queries when used in a fielded search box
Summary: QueryParser doesn't recognize QP queries when used in a fielded search box
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jared Camins-Esakov
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-06 04:43 UTC by Jared Camins-Esakov
Modified: 2015-06-04 23:23 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 10688: Don't prefix index inappropriately (1.79 KB, patch)
2013-08-06 04:50 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 10688: Don't prefix index inappropriately (1.84 KB, patch)
2013-08-08 22:42 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 10688: Don't prefix index inappropriately (1.91 KB, patch)
2013-08-16 15:27 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Camins-Esakov 2013-08-06 04:43:14 UTC
If you select an index in the search dropdown and then enter in a QP query starting with the field, Koha will prepend the index you do not want to use at the beginning of the search, resulting in a search that problem does not match what you were hoping for.
Comment 1 Jared Camins-Esakov 2013-08-06 04:50:50 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2013-08-08 22:42:46 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2013-08-16 14:34:38 UTC
I cannot reproduce the issue. I get the same results with and without the patch. Are there some prerequisites?
Comment 4 Jared Camins-Esakov 2013-08-16 15:13:52 UTC
You need to have QueryParser set up, which means you have to turn on UseQueryParser and have query_parser in your koha-conf.xml:
 <queryparser_config>/home/jcamins/kohaclone/etc/searchengine/queryparser.yaml</queryparser_config>
Comment 5 Jonathan Druart 2013-08-16 15:27:40 UTC
(In reply to Jared Camins-Esakov from comment #4)
> You need to have QueryParser set up, which means you have to turn on
> UseQueryParser and have query_parser in your koha-conf.xml:
>  <queryparser_config>/home/jcamins/kohaclone/etc/searchengine/queryparser.
> yaml</queryparser_config>

Thanks, my koha-conf.xml did not contain the right path!

Now I reproduce the issue and I confirm the patch fixes it.
Marked as Passed QA.
Comment 6 Jonathan Druart 2013-08-16 15:27:57 UTC
Created attachment 20423 [details] [review]
Bug 10688: Don't prefix index inappropriately

If you select an index in the search dropdown and then enter in a QP
query starting with the field, Koha will prepend the index you do not
want to use at the beginning of the search, resulting in a search that
problem does not match what you were hoping for.

To test:
1) Select an index in the search dropdown in the OPAC. Author is fine.
2) Enter a search term using manually entered indexes. For example:
    ti:cat in the hat
3) Note that the search fails.
4) Apply patch.
5) Repeat steps 1 and 2.
6) Note that the search succeeds.
7) Sign off.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Galen Charlton 2013-12-10 01:36:10 UTC
Pushed to master.  Thanks, Jared!
Comment 8 Fridolin Somers 2013-12-24 09:43:19 UTC
Patch pushed to 3.14.x, will be in 3.14.2.
Comment 9 Tomás Cohen Arazi (tcohen) 2014-01-13 14:26:04 UTC
This patch has been pushed to 3.12.x, will be in 3.12.9.

Thanks Jared!