[Koha-bugs] [Bug 19893] Alternative optimized indexing for Elasticsearch

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Sep 14 23:50:24 CEST 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19893

--- Comment #144 from David Gustafsson <glasklas at gmail.com> ---
(In reply to Jonathan Druart from comment #138)
> Quick (naive?) questions:
> - Why do you loop on MARC fields instead of the mappings?
> - What are "joined fields", do we really to index everything?
> - Can you submit an example (record in input will output this document)?

About the first one. This is actually one of the tricks employed to make this
much faster than catmandu. If you look at the "field" subroutine, it loops
through all the fields on each call. So if we where to instead loop through the
fields in mapping.yaml, and call fields for each one (like catmandu does), this
is quite expensive to do. If we instead group all mappings by field stored in a
hash, and loop through fields just once (by calling "field" instead) we get a
huge performance gain since hash key lookup is constant time. If we add more
mappings, only the parsing of mappings and creation of the rules hash will take
longer, but that only has to be done once per batch so will have almost no
impact on performance.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list