Bug 9961 - Truncation and QueryAutoTruncate not working properly with new QueryParser
Summary: Truncation and QueryAutoTruncate not working properly with new QueryParser
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Jared Camins-Esakov
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-31 20:24 UTC by Katrin Fischer
Modified: 2014-07-18 18:42 UTC (History)
5 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:


Attachments
Bug 9961: Add truncation support to QP driver (5.02 KB, patch)
2013-05-02 16:05 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 9961: Add truncation support to QP driver (4.94 KB, patch)
2013-05-03 15:39 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 9961: Add truncation support to QP driver (4.99 KB, patch)
2013-05-07 12:45 UTC, Mirko Tietgen
Details | Diff | Splinter Review
[PASSED QA] Bug 9961: Add truncation support to QP driver (5.12 KB, patch)
2013-05-08 06:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
Fix the ProhibitedSubroutinePrototypes QA critical error by removing the ($) from the GetMandatoryFieldZ3950 function (833 bytes, patch)
2014-07-18 18:40 UTC, Eric Bégin
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2013-03-31 20:24:50 UTC
I did some tests while working on bug 7518 and found that truncation seems not to work correctly when QueryParser is activated:

START CONFIGURATION:
Chr
UseQueryParser      Try
QueryAutoTruncate   only if * is added
QueryFuzzy          Try
QueryStemming       Try
QueryWeightFields   Enable

TESTS:
1) NOT OK
Keyword Geschichte  1236
Keyword Gesch*      No results found!
Keyword Gesch       No results found!

2) OK
UseQueryParser      Do not try
Keyword Geschichte  1236
Keyword Gesch*      1372
Keyword Gesch       1379

3) NOT OK
UseQueryParser      Try
QueryAutoTruncate   automatically
Keyword Geschichte  1236
Keyword Gesch*      No results found!
Keyword Gesch       No results found!
Comment 1 Jared Camins-Esakov 2013-05-02 16:05:00 UTC Comment hidden (obsolete)
Comment 2 Jared Camins-Esakov 2013-05-03 15:39:05 UTC Comment hidden (obsolete)
Comment 3 Mirko Tietgen 2013-05-07 12:45:04 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2013-05-08 06:25:27 UTC
Created attachment 18010 [details] [review]
[PASSED QA] Bug 9961: Add truncation support to QP driver

The original implementation of QueryParser did not handle truncation
based on the QueryAutoTruncate system preference. This patch adds support.

To test:
1) Apply patch.
2) Turn on UseQueryParser.
3) Set QueryAutoTruncate to "automatically."
4) Search for "har". Note that it returns results with words
   like "Harry" (i.e. with right truncation).
5) Search for "har*". Note that it still returns results with right
   truncation.
6) Set QueryAutoTruncate to "only when * is added."
7) Search for "har". Note that it returns only records that have the
   exact word "har" in them (most likely there will be none unless you
   have Hebrew items).
8) Search for "har*". Note that once again it returns results for "Harry"
   (i.e. right truncated results).
9) Sign off.

This patch also reindents a hash in Koha/QueryParser/Driver/PQF.pm
because it was hard to read before.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Thx for fixing this Jared!
Comment 5 Jared Camins-Esakov 2013-05-08 13:44:46 UTC
This patch has been pushed to master and 3.12.x.
Comment 6 Chris Cormack 2013-05-12 03:11:18 UTC
Not needed for 3.10.x bug fix for new feature on 3.12.x
Comment 7 Eric Bégin 2014-07-18 18:40:09 UTC Comment hidden (obsolete)
Comment 8 Eric Bégin 2014-07-18 18:42:29 UTC
Comment on attachment 29866 [details] [review]
Fix the ProhibitedSubroutinePrototypes QA critical error by removing the ($) from the GetMandatoryFieldZ3950 function

Wrong bug number with git bz :(