@@ -, +, @@ --- Koha/SearchEngine/Elasticsearch.pm | 6 +++--- Koha/SearchEngine/Elasticsearch/Indexer.pm | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) --- a/Koha/SearchEngine/Elasticsearch.pm +++ a/Koha/SearchEngine/Elasticsearch.pm @@ -314,7 +314,7 @@ sub sort_fields { my @record_documents = $self->marc_records_to_documents($marc_records); -Using mappings stored in databse convert C<$marc_records> to ElasticSearch documents. +Using mappings stored in database convert C<$marc_records> to ElasticSearch documents. Returns array of hash references, representing ElasticSearch documents, acceptable as body payload in C requests. @@ -457,14 +457,14 @@ sub marc_records_to_documents { my $mapping_rules = $self->_get_marc_mapping_rules() -Generates rules from mappings stored in databse for MARC records to Elasticsearch JSON document conversion. +Generates rules from mappings stored in database for MARC records to Elasticsearch JSON document conversion. Since field retrieval is slow in C (all fields are itereted through for each call to C->field) we create an optimized structure of mapping rules keyed by MARC field tags holding all the mapping rules for that particular tag. We can then iterate through all MARC fields for each record and apply all relevant -rules once per fields instead of retreiving field multiple times for each mapping rule +rules once per fields instead of retreiving fields multiple times for each mapping rule wich is terribly slow. =cut --- a/Koha/SearchEngine/Elasticsearch/Indexer.pm +++ a/Koha/SearchEngine/Elasticsearch/Indexer.pm @@ -81,7 +81,7 @@ use constant { die("Something whent wrong trying to update index:" . $_[0]); } -Converts C C<$records> to Elasticsearch documents and perform +Converts C C<$records> to Elasticsearch documents and performs an update request for these records on the Elasticsearch index. The values in the arrays must match up, and the 999$c value in the MARC record @@ -96,8 +96,8 @@ If that's a problem, clone them first. =item C<$biblionums> -Arrayref of biblio numbers for the C<$records>, the order must be the same -as C<$records>. +Arrayref of biblio numbers for the C<$records>, the order must be the same as +and match up with C<$records>. =item C<$records> --