Bug 5369: se queries with paranthesis fail

This patch does several things to make the search work better:

1) Adding "" around search terms for queries on index se.
2) Make links for 8xx obey the UseControlNumber system preference
3) Fix the indexing for 8xx fields, as they were not included in the se index before

Note: Make sure you copy the new record.abs into your koha-dev directory and reindex
before testing.

To test:
1) Add records using the following fields:
440$a
490$a ind. 1 = empty or 0
490$a ind. 1 = 1
800$a, 810$a, 811$a or 830$a

Example value taken form bug description, should only work after applying the patch:
DHEW publication no. (HSM) 73-1804

Please also test with other examples.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Katrin Fischer 2011-11-28 07:25:37 +01:00 committed by Paul Poulain
parent 37e1f05e8f
commit 4cd81a8d0f
3 changed files with 18 additions and 18 deletions

View File

@ -241,27 +241,27 @@ melm 785$w Record-control-number
melm 785 Title,Title:p,Title-later,Related-periodical
melm 787$w Record-control-number
melm 800$a Name-and-title
melm 800$a Name-and-title,Title-series:w,Title-series:p
#melm 800$t author,Author-title,Name-and-title,Title,Title-series
melm 800$t Author-title,Name-and-title,Title,Title-series
melm 800$t Author-title,Name-and-title,Title,Title-series:w,Title-series:p
melm 800$9 Koha-Auth-Number
melm 800$w Record-control-number
melm 800 Author,Author-name-personal,Name,Personal-name
melm 810$a Name-and-title
melm 810$t Author-title,Name-and-title,Title,Title-series
melm 810$a Name-and-title,Title-series:w,Title-series:p
melm 810$t Author-title,Name-and-title,Title,Title-series:w,Title-series:p
melm 810$w Record-control-number
melm 810$9 Koha-Auth-Number
melm 810 Author,Corporate-name,Author-name-corporate,Name
melm 811$a Name-and-title
melm 811$a Name-and-title,Title-series:w,Title-series:p
melm 811$9 Koha-Auth-Number
#melm 811$t author,Author-title,Name-and-title,Title,Title-series
melm 811$t Author-title,Name-and-title,Title,Title-series
melm 811$t Author-title,Name-and-title,Title,Title-series:w,Title-series:p
melm 811$w Record-control-number
melm 811 Author,Author-name-corporate,Name,Conference-name
melm 830$w Record-control-number
melm 830$9 Koha-Auth-Number
melm 830 Title,Title-series
melm 840 Title,Title-series
melm 830 Title,Title-series:w,Title-series:p
melm 840 Title,Title-series:w,Title-series:p
###############################
# Koha Local-Use Biblio Indexes

View File

@ -155,7 +155,7 @@
<span class="results_summary series"><span class="label">Series: </span>
<!-- 440 -->
<xsl:for-each select="marc:datafield[@tag=440]">
<a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
<a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se:"<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
@ -170,7 +170,7 @@
<!-- 490 Series not traced, Ind1 = 0 -->
<xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
<a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
<a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se:"<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
@ -186,23 +186,23 @@
<xsl:if test="marc:datafield[@tag=490][@ind1=1]">
<xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
<xsl:choose>
<xsl:when test="marc:subfield[@code='w']">
<xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
<a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">at</xsl:with-param>
<xsl:with-param name="codes">a_t</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</a>
</xsl:when>
<xsl:otherwise>
<a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
<a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">at</xsl:with-param>
<xsl:with-param name="codes">a_t</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>

View File

@ -210,7 +210,7 @@
<span class="results_summary series"><span class="label">Series: </span>
<!-- 440 -->
<xsl:for-each select="marc:datafield[@tag=440]">
<a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
<a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se:"<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
@ -225,7 +225,7 @@
<!-- 490 Series not traced, Ind1 = 0 -->
<xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
<a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
<a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se:"<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">
@ -241,7 +241,7 @@
<xsl:if test="marc:datafield[@tag=490][@ind1=1]">
<xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
<xsl:choose>
<xsl:when test="marc:subfield[@code='w']">
<xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
<a href="/cgi-bin/koha/opac-search.pl?q=rcn:{marc:subfield[@code='w']}">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
@ -253,7 +253,7 @@
</a>
</xsl:when>
<xsl:otherwise>
<a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
<a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:call-template name="subfieldSelect">