Bug 8211

Summary: Add "subject (broader)," "subject (narrower)," and "subject (related)" options for search
Product: Koha Reporter: Jared Camins-Esakov <jcamins>
Component: SearchingAssignee: Jared Camins-Esakov <jcamins>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, matted-34813, paul.poulain
Version: 3.10   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 7818, 8649, 8744    
Bug Blocks: 8212, 8726    
Attachments: Bug 8211: Add exploded search options
Bug 8211: Add exploded search options
Bug 8211: Add exploded search options
SIGNED-OFF-Bug-8211-Add-exploded-search-options.patch

Description Jared Camins-Esakov 2012-06-07 14:50:16 UTC
With the addition of DOM indexing, it is now possible to do "exploded" searches which search for records with broader, narrower, and other related headings by searching authorities for the specified term, then using authorities that match the specified criteria to do a more inclusive search for bib records.
Comment 1 Jared Camins-Esakov 2012-08-27 21:24:55 UTC Comment hidden (obsolete)
Comment 2 Jared Camins-Esakov 2012-09-09 00:52:28 UTC
Example authority records:

Record 1:
=001 1
=151 ##$aArizona.
=551 ##$aUnited States$wg$92
=551 ##$aPhoenix$wh$93

Record 2:
=001 2
=151 ##$aUnited States.
=551 ##$aArizona$wh$91

Record 3:
=001 3
=151 ##$aPhoenix.
=551 ##$aArizona$wg$91
Comment 3 Jared Camins-Esakov 2012-09-09 21:23:11 UTC Comment hidden (obsolete)
Comment 4 Jared Camins-Esakov 2012-09-09 22:19:15 UTC Comment hidden (obsolete)
Comment 5 wajasu 2012-09-10 00:20:34 UTC
Created attachment 12094 [details] [review]
SIGNED-OFF-Bug-8211-Add-exploded-search-options.patch

After pulling master i applied these:
0001-Bug-8744-Thesaurus-in-authorities-should-not-lock-fi.patch
0002-Bug-8649-Add-unit-test-for-C4-Search.patch
0003-bug-8649-make-sure-C4-Context-is-fully-mocked-up-bef.patch
0004-bug-8649-make-sure-we-can-exit-if-a-test-fails.patch
0005-bug-8649-create-a-temp-directory-for-Zebra-for-C4-Se.patch
0006-bug-8649-quiet-a-variable-use-warning.patch
0007-Bug-8211-Add-exploded-search-options.patch

You need 8744 to be able to edit Geographical names in 551 (unlock them)
8649 has Search.t tests

1) I had created the authority heirarchy as comment#2 described.
2) I used z3950 to search LOC specifiying "United States" in subject heading, and chose "1000 things to love about America" and added an item.  I navigated to its 651 Geographic name heading and clicked the editor icon for the 'a' subtag, and used the authority search plugin ( $a = United States ) and found the record that was created in step #1).  choose it.  I finished out the biblio and added an item.
3) I did the same thing as step 2) but for "Arizona" and "Phoenix" subject headingg, linking with the authority plugin as well.  Pick a book for Arizona accordingly.
4) I ran rebuild-zebra and did my searches as described in comment #3) in the OPAC search.   su-br:Arizona  su-na:Arizona  and su-rl:Arizona
Each returned results.
For me: I also had Phoenix in the su-br-Arizona search, and jcamins said there must be a subject heading in my chosen biblio for Phoenix.  There was, so I edited my biblio, to remove the Restaurant -- Arizona  TOPICAL TERM SUBJECT HEADING.  After that I requeried su-br: Arizona, and the Phoenix item did not show up as we wanted.  So there is an added restriction to be sure other subject heading don't interfere with results.

Cool beans!!!

wajasu
Comment 6 Jonathan Druart 2012-09-14 10:10:30 UTC
QA Comments:

Looks good to me.
Code clean, UT++

Just one thing: maybe it would be better to pass a hashref to parseQuery instead of 7 arguments. But it is possible to have some disagreements about that.

Marked as Passed QA.
Comment 7 Jared Camins-Esakov 2012-09-14 10:47:00 UTC
(In reply to comment #6)
> QA Comments:
> 
> Looks good to me.
> Code clean, UT++
> 
> Just one thing: maybe it would be better to pass a hashref to parseQuery
> instead of 7 arguments. But it is possible to have some disagreements about
> that.

The reasoning behind using the 7 arguments is that parseQuery is still just a shim, so we want it to look as much like buildQuery as possible. When parseQuery replaces buildQuery, the API will also be changed.
Comment 8 Paul Poulain 2012-09-18 15:34:21 UTC
Patch pushed to master

I had some trouble making this patch work, but, at the end, if your datas are OK and your zebra index uptodate, this patch works like a charm in UNIMARC.
Comment 9 Jared Camins-Esakov 2012-12-03 13:26:13 UTC
This feature is available in Master.