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

(-)a/t/Koha_ElasticSearch_Search.t (-8 / +9 lines)
Lines 1-7 Link Here
1
#
1
#
2
#===============================================================================
2
#===============================================================================
3
#
3
#
4
#         FILE: Koha_ElasticSearch_Search.t
4
#         FILE: Koha_SearchEngine_Elasticsearch_Search.t
5
#
5
#
6
#  DESCRIPTION:
6
#  DESCRIPTION:
7
#
7
#
Lines 19-29 use strict; Link Here
19
use warnings;
19
use warnings;
20
20
21
use Test::More tests => 5;    # last test to print
21
use Test::More tests => 5;    # last test to print
22
use Koha::SearchEngine::Elasticsearch::QueryBuilder;
22
23
23
use_ok('Koha::ElasticSearch::Search');
24
my $builder = Koha::SearchEngine::Elasticsearch::QueryBuilder->new( { index => 'mydb' } );
25
26
use_ok('Koha::SearchEngine::Elasticsearch::Search');
24
27
25
ok(
28
ok(
26
    my $searcher = Koha::ElasticSearch::Search->new(
29
    my $searcher = Koha::SearchEngine::Elasticsearch::Search->new(
27
        { 'nodes' => ['localhost:9200'], 'index' => 'mydb' }
30
        { 'nodes' => ['localhost:9200'], 'index' => 'mydb' }
28
    ),
31
    ),
29
    'Creating a Koha::ElasticSearch::Search object'
32
    'Creating a Koha::ElasticSearch::Search object'
Lines 31-38 ok( Link Here
31
34
32
is( $searcher->index, 'mydb', 'Testing basic accessor' );
35
is( $searcher->index, 'mydb', 'Testing basic accessor' );
33
36
34
ok( $searcher->connect, 'Connect to ElasticSearch server' );
37
ok( my $query = $builder->build_query('easy'), 'Build a search query');
35
ok( my $results = $searcher->search( { record => 'easy' } ), 'Do a search ' );
38
39
ok( my $results = $searcher->search( $query) , 'Do a search ' );
36
40
37
ok( my $marcresults = $searcher->marc_search( { record => 'Fish' } ),
38
    'Do a marc search' );
39
- 

Return to bug 12478