Bug 10037

Summary: fix item index in UNIMARC DOM indexing
Product: Koha Reporter: Mathieu Saby <mathsabypro>
Component: SearchingAssignee: Mathieu Saby <mathsabypro>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: normal    
Priority: P5 - low CC: bgkriegel, gmcharlt, jonathan.druart, katrin.fischer
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: [PATCH] Bug 10037 : item index is broken in UNIMARC DOM indexing
[SIGNED-OF] Bug 10037 : item index is broken in UNIMARC DOM indexing
Bug 10037 : item index is broken in UNIMARC DOM indexing

Description Mathieu Saby 2013-04-13 14:40:42 UTC
In UNIMARC DOM config file (biblio-zebra-indexdefs.xsl), we have this line
    <z:index name="item # just to index every subfield:w">

I suppose it is not good...
We should remove the comments

M. Saby
Comment 1 Mathieu Saby 2013-04-17 09:49:53 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2013-09-12 22:57:58 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2013-10-06 22:38:47 UTC
Bit stuck on testing here as I have some errors on running a full reindex:
REINDEXING zebra
====================
00:34:32-07/10 zebraidx(27269) [warn] isamb: Inconsistent register (2)
zebraidx: isamb.c:1102: insert_leaf: Assertion `*lookahead_mode' failed.
00:34:33-07/10 zebraidx(27279) [warn] previous transaction didn't reach commit

I will have to investigate some more.
Comment 4 Mathieu Saby 2013-10-07 07:02:50 UTC
Hello
That's maybe related with other errors in the config file.

Mathieu
Comment 5 Mathieu Saby 2013-10-07 07:06:43 UTC
By the way it is probably not a good thing to index all subfields of 995 in the same item index, because some subfields contains data useless to index (as internal notes...).
But it could be the object of an other patch after this one is pushed.


Mathieu
Comment 6 Jonathan Druart 2013-10-10 10:24:28 UTC
QA comment:

The patch works as expected and the behavior is consistent to me.

Marked as Passed QA.
Comment 7 Jonathan Druart 2013-10-10 10:24:48 UTC
Created attachment 21940 [details] [review]
Bug 10037 : item index is broken in UNIMARC DOM indexing

In UNIMARC DOM indexing, "item" index is working only for subfields of 995 field mapped with specific indexes, and also in index (ex : $a, $b...)
It is not working for the other subfields (ex : $g), because a comment from record.abs was integrated in DOM config files.
This patch removes the comment.

To test, in a DOM UNIMARC environment :
1) in a item, write some value "Test10037" in 995$g
2) search for this value in simple search, this way : item=Test10037 => you should have no results
3) apply the patch. if necessary, copy the modified src/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml and  src/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl into the /etc/... directory in your main Koha directory
4) reindex zebra biblios
5) do the same search as 2) => you should have one result

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. No koha-qa errors.

Test

NOTE: default UNIMARC framework don't have 995g,
so I must add it first.

1) Added test string to 995b on some record
2) Reindex and search as indicated, no results
3) cp files to destination
4) reindex
5) search and result ok !

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 8 Jonathan Druart 2013-10-10 10:25:50 UTC
(In reply to Katrin Fischer from comment #3)
> Bit stuck on testing here as I have some errors on running a full reindex:
> REINDEXING zebra
> ====================
> 00:34:32-07/10 zebraidx(27269) [warn] isamb: Inconsistent register (2)
> zebraidx: isamb.c:1102: insert_leaf: Assertion `*lookahead_mode' failed.
> 00:34:33-07/10 zebraidx(27279) [warn] previous transaction didn't reach
> commit
> 
> I will have to investigate some more.

Note: I hadn't these errors on reindexing.
Comment 9 Katrin Fischer 2013-10-10 10:57:33 UTC
It's very likely my Zebra UNIMARC configuration was problematic, as I had tested other patches before. Thx Jonathan!
Comment 10 Mathieu Saby 2013-10-10 11:08:55 UTC
Anyway, the current code was obviously wrong ;-)
"<target_index>item   # just to index every subfield:w</target_index>"

Mathieu
Comment 11 Galen Charlton 2013-10-10 18:56:48 UTC
Pushed to master along with a regression test.  Thanks, Mathieu!