Bug 2560

Summary: Advanced search on Language (from pulldown) does not work
Product: Koha Reporter: Chris Cormack <chris>
Component: SearchingAssignee: Galen Charlton <gmcharlt>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: cookie.wolfrom, jwagner, nengard
Version: 3.4   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Chris Cormack 2010-05-21 00:52:51 UTC


---- Reported by debra.denault@liblime.com 2008-08-26 14:02:08 ----

The advanced search on Language from the pulldown menu in either the staff client or OPAC in Koha does not work. 

Try to search "spa" at http://carthage-staff.kohalibrary.com/cgi-bin/koha/catalogue/search.pl

It returns no hits. If you do a regular keyword search on spanish and look at any of the records in the list, they all have 041$a and 008 pos 35-37 with spa in them. 

Other languages do not work as well. Ryan mentioned that the 008 35-37 search is defined as a numeric search. Might this be part of the problem?



---- Additional Comments From joe.atzberger@liblime.com 2009-03-18 12:30:31 ----

*** http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2566 has been marked as a duplicate of this bug. ***



---- Additional Comments From joe.atzberger@liblime.com 2009-03-18 12:31:43 ----

Similar "fr" vs. "fre" issue suggested in 2566.



---- Additional Comments From joe.atzberger@liblime.com 2009-03-18 12:32:45 ----

The current zebra index definitions appear to represent language accurately:

http://git.koha.org/cgi-bin/gitweb.cgi?p=Koha;a=blob;f=etc/zebradb/ccl.properties;h=cd03e2a5c0a98117a52d82c722b9e1c2d621aafe;hb=HEAD

That is, we use the attribute "language" alias "ln" for the 008/35-37, 041. 

So now I must investigate whether the Seach code targets that accurately.



---- Additional Comments From joe.atzberger@liblime.com 2009-03-18 13:10:05 ----

Manual search via yaz-client looks like:

Z> find @attr 1=54 spa
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 1186, setno 5
SearchResult-1: term=spa cnt=1186
records returned: 0
Elapsed: 0.018047
Z> show 1
Sent presentRequest (1+1).
Records: 1
[biblios]Record type: USmarc
01121pam a2200349 a 4500
001 10777933
008 840502s1984    nyu           000 0 eng  
010    $a 84009856
020    $a 0811209032
020    $a 0811208990 (pbk.)
040    $a DLC $c DLC $d GZC
041 1  $a eng $h spa
049    $a GZCC
050 0  $a PQ7297.P285 $b A29 1984
082 0  $a 861 $2 19
090    $a PQ 7297 P285 A29
100 1  $a Paz, Octavio, $d 1914-
240 10 $a Poems. $k Selections. $l English
245 10 $a Selected poems / $c Octavio Paz ; edited by Eliot Weinberger ; translations from the Spanish by G. Aroul ... [et al.].
260    $a New York : $b New Directions, $c 1984.
300    $a xii, 147 p. ; $c 21 cm.
600 10 $a Paz, Octavio, $d 1914- $x Translations, English.
700 10 $a Weinberger, Eliot. $9 55485
700 10 $a Aroul, G. $9 87475
907    $a .b10001165 $b circ  $c -
902    $a 051130
910    $a .b10001165
998    $b 1 $c 990820 $d m $e a $f - $g 0
935    $a AAA0119
945    $l circ 
952    $p 25053002806545 $4 0 $0 0 $6 PQ_07297_P285_A29 $9 114 $b HEDBERG $1 0 $o PQ 7297 P285 A29 $d 1999-09-03 $t 1 $7 0 $c CIRC $y 1 $a HEDBERG $l 3
999    $c 98 $d 98

nextResultSetPosition = 2
Elapsed: 0.076104
Z> show 2
Sent presentRequest (2+1).
Records: 1
[biblios]Record type: USmarc
01194pam a2200373 a 4500
001 10779203
008 840501s1985    txua     b    000 0 eng  
010    $a 84007585
020    $a 0292703716
040    $a DLC $c DLC $d GZC
041 1  $a eng $h spa
049    $a GZCC
050 0  $a PQ8097.N4 $b A8513 1985
082 0  $a 861 $2 19
090    $a PQ 8097 N4 A85.3
100 1  $a Neruda, Pablo, $d 1904-1973.
240 10 $a Arte de pajaros. $l English
245 10 $a Art of birds / $c Pablo Neruda ; translated by Jack Schmitt ; with illustrations by Jack Unruh.
250    $a 1st ed.
260    $a Austin : $b University of Texas Press, $c 1985.
300    $a 87 p. : $b ill. ; $c 26 cm.
490 0  $a The Texas Pan American series
500    $a Translation of: Arte de pájaros.
504    $a Includes bibliographical references.
650  0 $a Birds $x Poetry.
700 10 $a Schmitt, Jack, $d 1932- $9 88849
907    $a .b10001384 $b circ  $c -
902    $a 080415
910    $a .b10001384
998    $b 1 $c 990820 $d m $e a $f - $g 0
935    $a AAA0142
945    $l circ 
952    $p 25053002806776 $4 0 $0 0 $6 PQ_08097_N4_A85_3 $9 134 $b HEDBERG $1 0 $o PQ 8097 N4 A85.3 $d 1999-09-03 $t 1 $7 0 $c CIRC $y 1 $a HEDBERG $l 6
999    $c 118 $d 118



This shows that the field IS indexed, but not necessarily to the specificity desired.  Notice that both the records are actually for English translations of Spanish text.  So that hit is from the 041$h, not $a.  

For Koha, Search.pm must not be targeting the correct index at all.



---- Additional Comments From jwagner@ptfs.com 2009-07-08 13:41:47 ----

I think the problem isn’t that the language limit isn’t working, it’s that the search page isn’t constructing the query correctly.  The advanced search page is sending "ln,wrdl: kor" for a search done from the top pulldown list (staff and OPAC), which isn’t right.  A search of "ln: kor" in the regular (not advanced) search works fine and pulls up Korean language records, as does a search of "ln: spa" for Spanish records.  The staff advanced search separate Language box uses that structure and seems to work fine.  I've looked at the code, but so far I haven't been able to figure out how to make the pulldown search use the ln: structure instead of ln,wrdl.  Is that what you're investigating in Search.pm?

On our systems with recent Koha, the 041 is indexing the entire field, not just subfield a.




---- Additional Comments From jwagner@ptfs.com 2009-07-08 18:17:06 ----

I poked around in Search.pm and found a clue -- for my problem (searching ln,wrdl instead of ln) turning off the syspref QueryWeightFields solves the problem.  With that syspref off, "ln,wrdl: kor" and "ln: kor" (or other language variants) produce the same results.  I don't know the implications of turning that syspref off, though.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:52 UTC  ---

This bug was previously known as _bug_ 2560 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2560

Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was debra.denault@liblime.com.
CC member bchurch@ptfs.com does not have an account here
CC member jwagner@ptfs.com does not have an account here
CC member rch@liblime.com does not have an account here

Comment 1 Owen Leonard 2010-09-17 15:43:25 UTC
This appears to be working now. I was able to successfully search for Language: "spa" and get the same results as if I had chosen the language from the dedicated language-chooser which displays when you show "more options."