Commit graph

9 commits

Author SHA1 Message Date
Jared Camins-Esakov
4feb6a4736 Bug 8211: Add exploded search options
When working with hierarchical subject headings, it is sometimes helpful
to do a search for all records with a specific subject, plus
broader/narrower/related subjects. This patch adds support for these
"exploded" subject searches to Koha.

To test:
1) Make sure you have a bunch of hierarchical subjects. I created
   geographical subjects for "Arizona," "United States," and "Phoenix,"
   and linked them together using 551s, and made sure I had a half
   dozen records linking to each (but not all to all three).
2) Do a search for su-br:Arizona (or choose "Subject and broader terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona" and the
   records with the subject "United States"
3) Do a search for su-na:Arizona (or choose "Subject and narrower terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona" and the
   records with the subject "Phoenix"
4) Do a search for su-rl:Arizona (or choose "Subject and related terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona," the
   records with the subject "United States," and the records with the
   subject "Phoenix"
5) Ensure that other searches still work (keyword, subject, ccl,
   whatever)
6) Sign off

Technical details:
This patch adds a shim in front of C4::Search::buildQuery in order to
preprocess the query and call the _handle_exploding_search callback.
This shim will allow us to gradually offload query parsing to a new
query parser module.

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 15:20:48 +02:00
Galen Charlton
2904fc0752 bug 8649: quiet a variable use warning
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-13 11:55:51 +02:00
Galen Charlton
574becb11a bug 8649: create a temp directory for Zebra for C4::Search tests
The Zebra test uses Unix-domain sockets, which won't work if
Koha is being installed or tested from an NFS- or SSHFS-mounted
clone.  Therefore, create (and clenaup) a temporary directory on
(hopefully) a normal filesytem to run the test.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-13 11:55:48 +02:00
Galen Charlton
6a82961a11 bug 8649: make sure we can exit if a test fails
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-13 11:55:47 +02:00
Galen Charlton
7e1fdcdf37 bug 8649: make sure C4::Context is fully mocked-up before tests
This fixes failures of the test cases to run for me
on Perl 5.10.1 using prove -v t/db_dependent/Search.t

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-13 11:55:45 +02:00
Jared Camins-Esakov
f9980f6b31 Bug 8649: Add unit test for C4::Search
This patch adds a unit test for C4::Search in t/db_dependent. In order
to test the functioning of the Zebra search, this patch actually includes
an entire Zebra sandbox, and pre-indexed files, which are stored in
t/db_dependent/data (the configuration files are generated on the fly).

This test depends on Test::Warn, Test::MockModule, and DBD::Mock.

To test:
1) Run the test. There should be no failures, and no warnings.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-13 11:55:39 +02:00
Liz Rea
3c12d5f2f6 Bug 7333 - Fixing up db_dependent/Search.t to use sample data Thanks to Chris N. for helping figure out that it was because there were no French stopwords in the DB that the test was failing.
Patch changes the French string (with French stopwords) to an English string with English stopwords, as only English stopwords are installed in the default data.

This patch will allow Search.t to run on the database attached to this bug.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-27 18:41:10 +01:00
58e2f6a991 fix test plan and false test errors in Search.t
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 09:51:55 -04:00
Henri-Damien LAURENT
e16a034e9c Remove Stopwords bug fixing
in french, les is a stopword

Modèles would match because of the combining and \P{IsAlnum} would not detect that.
2009-10-14 18:19:09 +02:00