Bug 10482

Summary: add items limit and sort to rebuild zebra
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: SearchingAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED INVALID QA Contact:
Severity: enhancement    
Priority: P5 - low CC: dcook, gitbot, koha.aixmarseille
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6435
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11096
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 7986    
Bug Blocks:    
Attachments: Proposed patch

Description Fridolin Somers 2013-06-17 13:48:13 UTC
When indexing biblio records, the items are added into MARC format during database export (MARCXML or ISO2709).
For some records, there is a huge number of items, mainly serials creating an item for each issue.
There should be an option in rebuild_zebra.pl to limit the number of items added to record and an option to define a sort of those items.
This will speed-up some indexing and avoid a known bug : when Zebra has a record with size too big for ISO2709 format this record returned as search result is broken (some items fields contains odd characters).
Comment 1 Fridolin Somers 2013-06-17 14:18:33 UTC
Created attachment 19073 [details] [review]
Proposed patch

See commit message
Comment 2 I'm just a bot 2013-09-29 05:00:47 UTC
Patch applied cleanly, go forth and signoff
Comment 3 I'm just a bot 2013-10-30 07:16:58 UTC
Patch applied cleanly, go forth and signoff
Comment 4 David Cook 2014-03-26 07:47:08 UTC
Bug 11096 should take care of the record size problem. 

As for limiting the number of items...I'm not sure that an arbitrary cut off is the best idea, as it will lead to unexpected/unpredictable results.

Off the top of my head, it should also create problems with search. The barcode (i.e. "bc") and call number indexes being the ones that spring immediately to mind. 

I haven't put too much thought into it at this point, but...this patch seems like it would introduce a lot of (sometimes silent) problems.
Comment 5 Fridolin Somers 2014-03-26 10:04:25 UTC
(In reply to David Cook from comment #4)
> Bug 11096 should take care of the record size problem. 
Indeed.

But this is only an indexing option, not mandatory to use. It is made to cut off if there is a huge number of items, like more than 100.
It corrects a problem and makes indexing faster.
So why not adding it ?
Comment 6 Fridolin Somers 2014-09-18 15:42:59 UTC
In the end, I agree, no need to have more options and the risk off misunderstand is real.

Thanks for your help.