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

(-)a/misc/maintenance/compare_es_to_db.pl (-4 / +3 lines)
Lines 46-59 foreach my $index ( ('biblios','authorities') ){ Link Here
46
46
47
    my $searcher = Koha::SearchEngine::Elasticsearch->new({ index => $index });
47
    my $searcher = Koha::SearchEngine::Elasticsearch->new({ index => $index });
48
    my $es = $searcher->get_elasticsearch();
48
    my $es = $searcher->get_elasticsearch();
49
    my $count = $es->indices->stats( index => $searcher->get_elasticsearch_params->{index_name} )
49
    my $count = $es->indices->stats( index => $searcher->index_name )
50
        ->{_all}{primaries}{docs}{count};
50
        ->{_all}{primaries}{docs}{count};
51
    print "Count in db for $index is " . scalar @db_records . ", count in Elasticsearch is $count\n";
51
    print "Count in db for $index is " . scalar @db_records . ", count in Elasticsearch is $count\n";
52
52
53
    # Now we get all the ids from Elasticsearch
53
    # Now we get all the ids from Elasticsearch
54
    # The scroll lets us iterate through, it fetches chunks of 'size' as we move through
54
    # The scroll lets us iterate through, it fetches chunks of 'size' as we move through
55
    my $scroll = $es->scroll_helper(
55
    my $scroll = $es->scroll_helper(
56
        index => $searcher->get_elasticsearch_params->{index_name},
56
        index => $searcher->index_name,
57
        size => 5000,
57
        size => 5000,
58
        body => {
58
        body => {
59
            query => {
59
            query => {
Lines 79-85 foreach my $index ( ('biblios','authorities') ){ Link Here
79
79
80
    # Fetch values for providing record links
80
    # Fetch values for providing record links
81
    my $es_params = $searcher->get_elasticsearch_params;
81
    my $es_params = $searcher->get_elasticsearch_params;
82
    my $es_base   = "$es_params->{nodes}[0]/$es_params->{index_name}";
82
    my $es_base   = "$es_params->{nodes}[0]/".$searcher->index_name;
83
    my $opac_base = C4::Context->preference('OPACBaseURL');
83
    my $opac_base = C4::Context->preference('OPACBaseURL');
84
84
85
    print "\nComparing arrays, this may take a while\n";
85
    print "\nComparing arrays, this may take a while\n";
86
- 

Return to bug 25955