View | Details | Raw Unified | Return to bug 19893
Collapse All | Expand All

(-)a/Koha/SearchEngine/Elasticsearch.pm (-3 / +3 lines)
Lines 314-320 sub sort_fields { Link Here
314
314
315
    my @record_documents = $self->marc_records_to_documents($marc_records);
315
    my @record_documents = $self->marc_records_to_documents($marc_records);
316
316
317
Using mappings stored in databse convert C<$marc_records> to ElasticSearch documents.
317
Using mappings stored in database convert C<$marc_records> to ElasticSearch documents.
318
318
319
Returns array of hash references, representing ElasticSearch documents,
319
Returns array of hash references, representing ElasticSearch documents,
320
acceptable as body payload in C<Search::Elasticsearch> requests.
320
acceptable as body payload in C<Search::Elasticsearch> requests.
Lines 457-470 sub marc_records_to_documents { Link Here
457
457
458
    my $mapping_rules = $self->_get_marc_mapping_rules()
458
    my $mapping_rules = $self->_get_marc_mapping_rules()
459
459
460
Generates rules from mappings stored in databse for MARC records to Elasticsearch JSON document conversion.
460
Generates rules from mappings stored in database for MARC records to Elasticsearch JSON document conversion.
461
461
462
Since field retrieval is slow in C<MARC::Records> (all fields are itereted through for
462
Since field retrieval is slow in C<MARC::Records> (all fields are itereted through for
463
each call to C<MARC::Record>->field) we create an optimized structure of mapping
463
each call to C<MARC::Record>->field) we create an optimized structure of mapping
464
rules keyed by MARC field tags holding all the mapping rules for that particular tag.
464
rules keyed by MARC field tags holding all the mapping rules for that particular tag.
465
465
466
We can then iterate through all MARC fields for each record and apply all relevant
466
We can then iterate through all MARC fields for each record and apply all relevant
467
rules once per fields instead of retreiving field multiple times for each mapping rule
467
rules once per fields instead of retreiving fields multiple times for each mapping rule
468
wich is terribly slow.
468
wich is terribly slow.
469
469
470
=cut
470
=cut
(-)a/Koha/SearchEngine/Elasticsearch/Indexer.pm (-4 / +3 lines)
Lines 81-87 use constant { Link Here
81
        die("Something whent wrong trying to update index:" .  $_[0]);
81
        die("Something whent wrong trying to update index:" .  $_[0]);
82
    }
82
    }
83
83
84
Converts C<MARC::Records> C<$records> to Elasticsearch documents and perform
84
Converts C<MARC::Records> C<$records> to Elasticsearch documents and performs
85
an update request for these records on the Elasticsearch index.
85
an update request for these records on the Elasticsearch index.
86
86
87
The values in the arrays must match up, and the 999$c value in the MARC record
87
The values in the arrays must match up, and the 999$c value in the MARC record
Lines 96-103 If that's a problem, clone them first. Link Here
96
96
97
=item C<$biblionums>
97
=item C<$biblionums>
98
98
99
Arrayref of biblio numbers for the C<$records>, the order must be the same
99
Arrayref of biblio numbers for the C<$records>, the order must be the same as
100
as C<$records>.
100
and match up with C<$records>.
101
101
102
=item C<$records>
102
=item C<$records>
103
103
104
- 

Return to bug 19893