more info to come...
to test bug... 1/ define a 655$a value in a bib, save, reindex 2/ in opac-detail.pl click on its genre/form url, the search should successfully return a result (good!) 3/ next, define both a 655$a *and* 655$x value in a bib, save, reindex 4/ in opac-detail.pl click its genre/form url, the search should FAIL to return a result (BAD!) :/
Created attachment 43793 [details] successful search on 655$a - 'speedy reads'
Created attachment 43794 [details] successful search on 655$a - 'speedy reads'
Created attachment 43795 [details] FAILED search on 655$a and 655$x - 'Family -- Fiction'
my hunch is that the CCL syntax for the search query is incorrect my example returns no results.. (su,complete-subfield:"Family") AND (su,complete-subfield:"Fiction")
(In reply to Mason James from comment #5) > my hunch is that the CCL syntax for the search query is incorrect > > my example returns no results.. > (su,complete-subfield:"Family") AND (su,complete-subfield:"Fiction") the other issue is that the 650$x and/or 655$x subfields don't seem to be configured to be indexed by Zebra in.. /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml (and others) ..so a query for (su,complete-subfield:"Fiction") would be expected to fail, as that info is located in the unindexed 655$x subfield
(In reply to Mason James from comment #6) > (In reply to Mason James from comment #5) > > my hunch is that the CCL syntax for the search query is incorrect > > > > my example returns no results.. > > (su,complete-subfield:"Family") AND (su,complete-subfield:"Fiction") > > the other issue is that the 650$x and/or 655$x subfields don't seem to be > configured to be indexed by Zebra in.. > /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml (and > others) > > ..so a query for (su,complete-subfield:"Fiction") would be expected to fail, > as that info is located in the unindexed 655$x subfield good news, i have a fix for this... i'll attach a patch soon
Created attachment 44040 [details] [review] Bug 15048 - subject/genre (650/655) searches fail on searches with $x 'General subdivision' subfield values to test... 1/ define both a 655$a *and* 655$x value in a bib, save, reindex 2/ in opac-detail.pl click bib's genre/form url, the search should FAIL to return a result (BAD!) :/ 3/ apply patch 4/ copy updated files to your live zebradb dir (or build/install a debian package) $ sudo cp ./etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml \ /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml $ sudo cp etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \ /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl 5/ run a full zebra reindex 6/ in opac-detail.pl click bib's genre/form url, the search should return a result (GOOD!) :0)
Created attachment 44041 [details] SUCCESSFUL search on 655$a and 655$x - 'Family -- Fiction'
(In reply to Mason James from comment #9) > Created attachment 44041 [details] > SUCCESSFUL search on 655$a and 655$x - 'Family -- Fiction' pic of successful result attached ^
(In reply to Mason James from comment #6) > (In reply to Mason James from comment #5) > > my hunch is that the CCL syntax for the search query is incorrect > > > > my example returns no results.. > > (su,complete-subfield:"Family") AND (su,complete-subfield:"Fiction") > > the other issue is that the 650$x and/or 655$x subfields don't seem to be > configured to be indexed by Zebra NOTE: this patch only fixes Genre/Form (655) searches - not subject/650 searches The patch to fix the subject/650 equivalent of this issue will be moved to a separate bug
I can't trigger the error, though searches don't seem to include the $x either before or after the patch. Are there any sysprefs to check?
(In reply to Nick Clemens from comment #12) > I can't trigger the error, though searches don't seem to include the $x > either before or after the patch. Are there any sysprefs to check? Nope, no sysprefs to check. The 'error' is a failed search result. So, if you get a failed search result, then you have triggered the error You may/will need to manually add a 655$x value to your test bib. If you add one, and can't see it - you have an unrelated problem.
Created attachment 48887 [details] [review] Bug 15048 - subject/genre (650/655) searches fail on searches with $x 'General subdivision' subfield values to test... 1/ define both a 655$a *and* 655$x value in a bib, save, reindex 2/ in opac-detail.pl click bib's genre/form url, the search should FAIL to return a result (BAD!) :/ 3/ apply patch 4/ copy updated files to your live zebradb dir (or build/install a debian package) $ sudo cp ./etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml \ /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml $ sudo cp etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \ /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl 5/ run a full zebra reindex 6/ in opac-detail.pl click bib's genre/form url, the search should return a result (GOOD!) :0) Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
It was TraceCompleteSubfields I was missing :-)
QA Comment: Thanks for your patch, Mason. I think it still needs some attention: [1] You add $x when indexing 655. Please note that the whole field 655 is already indexed under term Subject. (So you would only add to Index-term-genre.) But the XSLT just looks at Subject (and only with some specific settings for UseAuthoritiesForTracings and TraceSubjectSubdivisions). Normally you would search for the authority number (an). So, it does not seem to be necessary to add it. Please explain why you need it. [2] If it should be necessary, what about $v $y and $z ?
Created attachment 136449 [details] [review] Bug 15048: Index all possible searched subfields for index-term-genre Currently we only index a - but we can setup the system such that avxyz are searched To test: 1 - define both a 655$a *and* 655$x value in a bib, save, reindex 2 - Set system preferences: TraceSubjectSubdivisions: Include TraceCompleteSubfields: Force 3 - View the record edited above in the opac 4 - Click on the subject heading 5 - No results found 6 - Copy zebra files: sudo cp ./etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml \ /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml sudo cp etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \ /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl 7 - restart all and reindex 8 - Click on the subject heading in OPAC 9 - Sucess! 10 - Repeat with other fields (vyz) 11 - Repeat under ES, reindexing and resetting mappings
(In reply to Marcel de Rooy from comment #16) > QA Comment: > Thanks for your patch, Mason. > I think it still needs some attention: > [1] You add $x when indexing 655. Please note that the whole field 655 is > already indexed under term Subject. (So you would only add to > Index-term-genre.) But the XSLT just looks at Subject (and only with some > specific settings for UseAuthoritiesForTracings and > TraceSubjectSubdivisions). Normally you would search for the authority > number (an). > So, it does not seem to be necessary to add it. > Please explain why you need it. See updated test plan - with those settings we are specifically searching genre index and fields are needed > [2] If it should be necessary, what about $v $y and $z ? Indeed - added
Can we please have a rebase? Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 15048 - subject/genre (650/655) searches fail on searches with $x 'General subdivision' subfield values Applying: Bug 15048: Index all possible searched subfields for index-term-genre Using index info to reconstruct a base tree... M etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml M etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl Falling back to patching base and 3-way merge... Auto-merging etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl CONFLICT (content): Merge conflict in etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl Auto-merging etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml CONFLICT (content): Merge conflict in etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml error: Failed to merge in the changes. Patch failed at 0001 Bug 15048: Index all possible searched subfields for index-term-genre hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-15048-Index-all-possible-searched-subfields-fo-UEZYrg.patch
(In reply to Katrin Fischer from comment #19) > Can we please have a rebase? > I just forgot to obsolete the older patch, should work now
Created attachment 137842 [details] [review] Bug 15048: Index all possible searched subfields for index-term-genre Currently we only index a - but we can setup the system such that avxyz are searched To test: 1 - define both a 655$a *and* 655$x value in a bib, save, reindex 2 - Set system preferences: TraceSubjectSubdivisions: Include TraceCompleteSubfields: Force 3 - View the record edited above in the opac 4 - Click on the subject heading 5 - No results found 6 - Copy zebra files: sudo cp ./etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml \ /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml sudo cp etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \ /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl 7 - restart all and reindex 8 - Click on the subject heading in OPAC 9 - Sucess! 10 - Repeat with other fields (vyz) 11 - Repeat under ES, reindexing and resetting mappings Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I feel like we can't expect people to constantly reset their Elasticsearch mappings and redo their own. As this fixed a bug, could we update mappings with a database update?
(In reply to Katrin Fischer from comment #22) > I feel like we can't expect people to constantly reset their Elasticsearch > mappings and redo their own. As this fixed a bug, could we update mappings > with a database update? I don't think it is that simple. We have created the ability for librarians to manage their own ES configuration - we cannot know what thy have done and whether our fixes are desired bug 30836 needs to address this as a larger issue, but I don't think this should be held up by that
> bug 30836 needs to address this as a larger issue, but I don't think this > should be held up by that Agreed. So looking for another set of QA eyes or another sign-off here!
(In reply to Marcel de Rooy from comment #16) > QA Comment: > Thanks for your patch, Mason. > I think it still needs some attention: > [1] You add $x when indexing 655. Please note that the whole field 655 is > already indexed under term Subject. (So you would only add to > Index-term-genre.) But the XSLT just looks at Subject (and only with some > specific settings for UseAuthoritiesForTracings and > TraceSubjectSubdivisions). Normally you would search for the authority > number (an). > So, it does not seem to be necessary to add it. > Please explain why you need it. > > [2] If it should be necessary, what about $v $y and $z ? I am revisiting this report now. And just notice my older comment. Mason did not answer it and Nick picked up this patch 6 years later..
Created attachment 142290 [details] [review] Bug 15048: Index all possible searched subfields for index-term-genre Currently we only index a - but we can setup the system such that avxyz are searched To test: 1 - define both a 655$a *and* 655$x value in a bib, save, reindex 2 - Set system preferences: TraceSubjectSubdivisions: Include TraceCompleteSubfields: Force 3 - View the record edited above in the opac 4 - Click on the subject heading 5 - No results found 6 - Copy zebra files: sudo cp ./etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml \ /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml sudo cp etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \ /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl 7 - restart all and reindex 8 - Click on the subject heading in OPAC 9 - Sucess! 10 - Repeat with other fields (vyz) 11 - Repeat under ES, reindexing and resetting mappings Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 22.11. Nice work everyone, thanks!
Backported to 22.05.x for upcoming 22.05.08
Not backported to 21.05.x