Bug 19376 - Add 655$a (Genre/Form) to zebra search facets
Summary: Add 655$a (Genre/Form) to zebra search facets
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Zebra (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: David Bourgault
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-27 18:24 UTC by David Bourgault
Modified: 2021-01-18 23:19 UTC (History)
9 users (show)

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


Attachments
Bug 19376 - Adds 655$a to Zebra facets (11.36 KB, patch)
2017-09-27 18:34 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 19376 - Follow-up on QA (4.11 KB, patch)
2017-10-17 18:48 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 19376 - Follow-up on QA (4.19 KB, patch)
2017-10-18 13:06 UTC, Hugo Agud
Details | Diff | Splinter Review
Bug 19376 - Adds 655$a to Zebra facets (11.41 KB, patch)
2017-10-23 12:01 UTC, Hugo Agud
Details | Diff | Splinter Review
Bug 19376 - Follow-up on QA (4.19 KB, patch)
2017-10-23 12:01 UTC, Hugo Agud
Details | Diff | Splinter Review
Bug 19376 - Keep 655 in the general Subject index (1023 bytes, patch)
2018-02-20 05:04 UTC, Charles Farmer
Details | Diff | Splinter Review
Rebased on current master. (10.74 KB, patch)
2019-01-24 18:05 UTC, Mikaël Olangcay Brisebois
Details | Diff | Splinter Review
Bug 19376 - Adds 655$a to Zebra facets (10.74 KB, patch)
2019-01-24 18:09 UTC, Mikaël Olangcay Brisebois
Details | Diff | Splinter Review
Bug 19376 - Follow-up on QA (3.60 KB, patch)
2019-01-24 18:10 UTC, Mikaël Olangcay Brisebois
Details | Diff | Splinter Review
Bug 19376 - Keep 655 in the general Subject index (1.01 KB, patch)
2019-01-24 18:10 UTC, Mikaël Olangcay Brisebois
Details | Diff | Splinter Review
Bug 19376 - Adds 655$a to Zebra facets (10.74 KB, patch)
2019-01-24 18:30 UTC, Mikaël Olangcay Brisebois
Details | Diff | Splinter Review
Bug 19376 - Follow-up on QA (3.60 KB, patch)
2019-01-24 18:31 UTC, Mikaël Olangcay Brisebois
Details | Diff | Splinter Review
Bug 19376 - Keep 655 in the general Subject index (1.01 KB, patch)
2019-01-24 18:31 UTC, Mikaël Olangcay Brisebois
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Bourgault 2017-09-27 18:24:21 UTC
This is a functionality we have with some clients, that we would like to push to the Koha community. It has no impact on libraries that ignore the 655$a tag, but enhances search filtering for those who do.
Comment 1 David Bourgault 2017-09-27 18:34:10 UTC
Created attachment 67412 [details] [review]
Bug 19376 - Adds 655$a to Zebra facets

Test plan:
0) Apply patch
1) Depending on your setup, copy the content of the following files to their counterparts in /etc/ (or where your Koha configuration files are) :
<git>/etc/zebradb/biblios/etc/bib1.att
<git>/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml
<git>/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xsl
<git>/etc/zebradb/marc_defs/marc21/biblios/record.abs
<git>/etc/zebradb/ccl.properties

2) Edit a record to use the 655$a MARC tag, if you don't already
3) In the OPAC or Intranet, execute a search that would get a hit on the record you edited.
> You should see the "Genre form" filter appear on the left
4) Click on the entry under "Genre form"
> You should now only see the records with the matching 655$a tag.
Comment 2 Katrin Fischer 2017-10-03 00:13:06 UTC
Comment on attachment 67412 [details] [review]
Bug 19376 - Adds 655$a to Zebra facets

Review of attachment 67412 [details] [review]:
-----------------------------------------------------------------

::: etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml
@@ -777,5 @@
> -    <target_index>Subject:p</target_index>
> -  </index_data_field>
> -  <!--record.abs line 189: melm 656$9      Koha-Auth-Number    -->
> -  <index_subfields tag="656" subfields="9">
> -    <target_index>Koha-Auth-Number:w</target_index>

Why are you removing these lines? It will break search when using authorities with 655 (link build using $9) and libraries using more than the $a subfield. (http://www.loc.gov/marc/bibliographic/bd655.html)

::: etc/zebradb/marc_defs/marc21/biblios/record.abs
@@ -198,2 @@
>  melm 655$9      Koha-Auth-Number
> -melm 655        Subject,Subject:p

These changes are not necessary as grs-1 is deprecated, but will also be a regression if you want to search for sufields other than $a:
http://www.loc.gov/marc/bibliographic/bd655.html

::: koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc
@@ +15,4 @@
>  [% IF facets_loo.type_label_Authors %]<span id="facet-authors">Authors</span>[% END %]
>  [% IF facets_loo.type_label_Titles %]<span id="facet-titles">Titles</span>[% END %]
>  [% IF facets_loo.type_label_Topics %]<span id="facet-topics">Topics</span>[% END %]
> +[% IF facets_loo.type_label_GenreForm %]<span id="facet-genreform">Genre form</span>[% END %]

I think it should probably be Genre/Form matching the detail page :)

::: koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc
@@ +21,4 @@
>                      <li id="[% facets_loo.type_id %]">
>                          [% IF facets_loo.type_label_Authors %]<h5 id="facet-authors">Authors</h5>[% END %]
>                          [% IF facets_loo.type_label_Titles %]<h5 id="facet-titles">Titles</h5>[% END %]
> +                        [% IF facets_loo.type_label_GenreForm %]<h5 id="facet-genreform">Genre form</h5>[% END %]

Same here as above: Genre/Form.
Comment 3 David Bourgault 2017-10-17 18:48:38 UTC
Created attachment 68221 [details] [review]
Bug 19376 - Follow-up on QA

Reverted useless/bad modifications.
Comment 4 David Bourgault 2017-10-17 18:50:44 UTC
I corrected configuration files and renamed 'Genre form' to 'Genre/Form' per Katrin's comment. The test plan is that same as before.
Comment 5 Hugo Agud 2017-10-18 13:06:37 UTC
Created attachment 68245 [details] [review]
Bug 19376 - Follow-up on QA

Reverted useless/bad modifications.

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Hugo Agud <hagud@orex.es>
Comment 6 Hugo Agud 2017-10-23 12:01:51 UTC
Created attachment 68388 [details] [review]
Bug 19376 - Adds 655$a to Zebra facets

Test plan:
0) Apply patch
1) Depending on your setup, copy the content of the following files to their counterparts in /etc/ (or where your Koha configuration files are) :
<git>/etc/zebradb/biblios/etc/bib1.att
<git>/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml
<git>/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xsl
<git>/etc/zebradb/marc_defs/marc21/biblios/record.abs
<git>/etc/zebradb/ccl.properties

2) Edit a record to use the 655$a MARC tag, if you don't already
3) In the OPAC or Intranet, execute a search that would get a hit on the record you edited.
> You should see the "Genre form" filter appear on the left
4) Click on the entry under "Genre form"
> You should now only see the records with the matching 655$a tag.

Signed-off-by: Hugo Agud <hagud@orex.es>
Comment 7 Hugo Agud 2017-10-23 12:01:54 UTC
Created attachment 68389 [details] [review]
Bug 19376 - Follow-up on QA

Reverted useless/bad modifications.

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Hugo Agud <hagud@orex.es>
Comment 8 Katrin Fischer 2018-02-09 07:29:08 UTC
Hi David,

this is almost there, sorry to bug you again:

   <index_subfields tag="655" subfields="a">
     <target_index>Index-term-genre:w</target_index>
     <target_index>Index-term-genre:p</target_index>
-    <target_index>Subject:w</target_index>
-    <target_index>Subject:p</target_index>
+    <target_index>gen-for:w</target_index>
+    <target_index>gen-for:p</target_index>
   </index_subfields>


These lines remove 655 from the general Subject index. Could you please keep it in the general index and only add your specific one?

Otherwise I think this looks good!
Comment 9 Charles Farmer 2018-02-20 05:04:55 UTC
Created attachment 71978 [details] [review]
Bug 19376 - Keep 655 in the general Subject index
Comment 10 Charles Farmer 2018-02-20 05:06:33 UTC
Added this bit back into /etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml:

> <target_index>Subject:w</target_index>
> <target_index>Subject:p</target_index>
Comment 11 Mikaël Olangcay Brisebois 2019-01-24 18:05:19 UTC Comment hidden (obsolete)
Comment 12 Mikaël Olangcay Brisebois 2019-01-24 18:09:50 UTC Comment hidden (obsolete)
Comment 13 Mikaël Olangcay Brisebois 2019-01-24 18:10:33 UTC Comment hidden (obsolete)
Comment 14 Mikaël Olangcay Brisebois 2019-01-24 18:10:50 UTC Comment hidden (obsolete)
Comment 15 Mikaël Olangcay Brisebois 2019-01-24 18:30:46 UTC
Created attachment 84383 [details] [review]
Bug 19376 - Adds 655$a to Zebra facets

Test plan:
0) Apply patch
1) Depending on your setup, copy the content of the following files to their counterparts in /etc/ (or where your Koha configuration files are) :
<git>/etc/zebradb/biblios/etc/bib1.att
<git>/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml
<git>/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xsl
<git>/etc/zebradb/marc_defs/marc21/biblios/record.abs
<git>/etc/zebradb/ccl.properties

2) Edit a record to use the 655$a MARC tag, if you don't already
3) In the OPAC or Intranet, execute a search that would get a hit on the record you edited.
> You should see the "Genre form" filter appear on the left
4) Click on the entry under "Genre form"
> You should now only see the records with the matching 655$a tag.

Signed-off-by: Hugo Agud <hagud@orex.es>
Comment 16 Mikaël Olangcay Brisebois 2019-01-24 18:31:05 UTC
Created attachment 84384 [details] [review]
Bug 19376 - Follow-up on QA

Reverted useless/bad modifications.

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Hugo Agud <hagud@orex.es>
Comment 17 Mikaël Olangcay Brisebois 2019-01-24 18:31:22 UTC
Created attachment 84385 [details] [review]
Bug 19376 - Keep 655 in the general Subject index
Comment 18 Mazen Khallaf 2021-01-18 23:19:21 UTC
Could not apply patch

git bz apply 19376
Bug 19376 - Add 655$a (Genre/Form) to zebra search facets

84383 - Bug 19376 - Adds 655$a to Zebra facets
84384 - Bug 19376 - Follow-up on QA
84385 - Bug 19376 - Keep 655 in the general Subject index

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 19376 - Adds 655$a to Zebra facets
Using index info to reconstruct a base tree...
M	C4/Koha.pm
M	C4/Search.pm
M	etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml
M	etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
M	koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc
M	koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc
CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc
Auto-merging etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
Auto-merging etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml
Auto-merging C4/Search.pm
Auto-merging C4/Koha.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 19376 - Adds 655$a to Zebra facets
The copy of the patch that failed is found in: .git/rebase-apply/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-19376---Adds-655a-to-Zebra-facets-gCwpao.patch