Bug 9961: Add truncation support to QP driver
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Thu, 2 May 2013 15:53:36 +0000 (11:53 -0400)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Wed, 8 May 2013 13:44:34 +0000 (09:44 -0400)
commit0742457840edf7784d5bccafaa6b6383125a53ed
tree28742762009d15722b12fdd06b805f06f3097196
parentcb9af9d0e667dcdebfdc89e77bdb8fdc2598493d
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!
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 8c6fe639b812665339a2cd84083f8c75d3957fdd)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Search.pm
Koha/QueryParser/Driver/PQF.pm
Koha/QueryParser/Driver/PQF/query_plan/node.pm