Bug 26679 - Genre tags linking to subject search, causing null results
Summary: Genre tags linking to subject search, causing null results
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low minor with 10 votes (vote)
Assignee: Andrew Fuerste-Henry
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-14 18:54 UTC by Craig
Modified: 2021-12-13 21:10 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.05,20.05.11


Attachments
Bug 26679: Use index-term-genre for 655 (5.04 KB, patch)
2020-11-23 16:00 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 26679: Use index-term-genre for 655 (5.09 KB, patch)
2021-04-14 18:39 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26679: Use index-term-genre for 655 (5.14 KB, patch)
2021-04-16 14:10 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Craig 2020-10-14 18:54:16 UTC
Koha 20.05.04.000 w/ ES 5.x.x.
Ubuntu 18.04
MariaDB

Problem:

After running a keyword search, clicking on a genre/form term URL from within opac-detail returns no results on that term, despite having records with the same gf term in the repository.

Example:

I have 4 bib records in my repository with a genre/form term "Star wars fiction":

1. Keyword search using "index-term-genre:Star wars fiction" returns 4 records.
2. keyword search using phrase "Star wars fiction" with quotes returns 4 records.
3. Subject search using "Star wars fiction" without quotes returns *no results*.
4. Clicking on genre term URL "Star wars fiction" within one of the 4 bib records on opac-detail screen returns *no results*.

I was expecting that nos. 3 and 4 above would return 4 records, but doesn't.

Is this an Elasticsearch problem, an ES configuration problem, an ES mapping problem, or XSLT problem?
Comment 1 Ron Houk 2020-11-22 16:20:00 UTC
I'm seeing this bug as well in Koha 19.11.08.000.  

It looks like the search url that is constructed searches the "su" index instead of the "index-term-genre" index.  This happens on both the staff-side and the OPAC.
Comment 2 Andrew Fuerste-Henry 2020-11-22 20:17:51 UTC
Looks like an XSLT issue:

  <xsl:when test="$TraceSubjectSubdivisions='1'">
    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelectSubject">
        <xsl:with-param name="codes">avxyz</xsl:with-param>
        <xsl:with-param name="delimeter"> AND </xsl:with-param>
        <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
        <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
        <xsl:with-param name="urlencode">1</xsl:with-param>
    </xsl:call-template>
    </xsl:attribute>
</xsl:when>
<xsl:otherwise>
    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
</xsl:otherwise>
Comment 3 Andrew Fuerste-Henry 2020-11-23 15:25:30 UTC
I should clarify, that bit is from MARC21slimOPACdetails for the 655.
Comment 4 Andrew Fuerste-Henry 2020-11-23 16:00:04 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2021-04-14 18:39:12 UTC
Created attachment 119599 [details] [review]
Bug 26679: Use index-term-genre for 655

To test:
1 - have a bib with a 655 that is not linked to an authority
2 - confirm link on OPAC and intranet details uses subject index
3 - apply patch, restart, reload pages
4 - confirm links now use index-term-genre and give correct results

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Martin Renvoize 2021-04-16 14:10:12 UTC
Created attachment 119749 [details] [review]
Bug 26679: Use index-term-genre for 655

To test:
1 - have a bib with a 655 that is not linked to an authority
2 - confirm link on OPAC and intranet details uses subject index
3 - apply patch, restart, reload pages
4 - confirm links now use index-term-genre and give correct results

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2021-04-16 14:10:44 UTC
Looking good, Passing QA
Comment 8 Jonathan Druart 2021-04-16 14:31:00 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 9 Fridolin Somers 2021-04-22 14:44:38 UTC
Pushed to 20.11.x for 20.11.05
Comment 10 Andrew Fuerste-Henry 2021-04-25 17:12:40 UTC
Pushed to 20.05.x for 20.05.11
Comment 11 Victor Grousset/tuxayo 2021-04-25 20:53:33 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.