|
Lines 1-4
Link Here
|
| 1 |
package Koha::ElasticSearch::Indexer; |
1 |
package Koha::SearchEngine::Elasticsearch::Indexer; |
| 2 |
|
2 |
|
| 3 |
# Copyright 2013 Catalyst IT |
3 |
# Copyright 2013 Catalyst IT |
| 4 |
# |
4 |
# |
|
Lines 19-40
package Koha::ElasticSearch::Indexer;
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Carp; |
20 |
use Carp; |
| 21 |
use Modern::Perl; |
21 |
use Modern::Perl; |
| 22 |
use base qw(Koha::ElasticSearch); |
22 |
use base qw(Koha::SearchEngine::Elasticsearch); |
| 23 |
use Data::Dumper; |
23 |
use Data::Dumper; |
| 24 |
|
24 |
|
| 25 |
# For now just marc, but we can do anything here really |
25 |
# For now just marc, but we can do anything here really |
| 26 |
use Catmandu::Importer::MARC; |
26 |
use Catmandu::Importer::MARC; |
| 27 |
use Catmandu::Store::ElasticSearch; |
27 |
use Catmandu::Store::ElasticSearch; |
| 28 |
|
28 |
|
| 29 |
Koha::ElasticSearch::Indexer->mk_accessors(qw( store )); |
29 |
Koha::SearchEngine::Elasticsearch::Indexer->mk_accessors(qw( store )); |
| 30 |
|
30 |
|
| 31 |
=head1 NAME |
31 |
=head1 NAME |
| 32 |
|
32 |
|
| 33 |
Koha::ElasticSearch::Indexer - handles adding new records to the index |
33 |
Koha::SearchEngine::Elasticsearch::Indexer - handles adding new records to the index |
| 34 |
|
34 |
|
| 35 |
=head1 SYNOPSIS |
35 |
=head1 SYNOPSIS |
| 36 |
|
36 |
|
| 37 |
my $indexer = Koha::ElasticSearch::Indexer->new( |
37 |
my $indexer = Koha::SearchEngine::Elasticsearch::Indexer->new( |
| 38 |
{ index => Koha::SearchEngine::BIBLIOS_INDEX } ); |
38 |
{ index => Koha::SearchEngine::BIBLIOS_INDEX } ); |
| 39 |
$indexer->drop_index(); |
39 |
$indexer->drop_index(); |
| 40 |
$indexer->update_index(\@biblionumbers, \@records); |
40 |
$indexer->update_index(\@biblionumbers, \@records); |