Bug 12478: Take the FacetMaxCount pref into account
[koha.git] / t / Koha_ElasticSearch_Search.t
1 #
2 #===============================================================================
3 #
4 #         FILE: Koha_ElasticSearch_Search.t
5 #
6 #  DESCRIPTION:
7 #
8 #        FILES: ---
9 #         BUGS: ---
10 #        NOTES: ---
11 #       AUTHOR: Chris Cormack (rangi), chrisc@catalyst.net.nz
12 # ORGANIZATION: Koha Development Team
13 #      VERSION: 1.0
14 #      CREATED: 09/12/13 09:43:29
15 #     REVISION: ---
16 #===============================================================================
17
18 use strict;
19 use warnings;
20
21 use Test::More tests => 5;    # last test to print
22
23 use_ok('Koha::ElasticSearch::Search');
24
25 ok(
26     my $searcher = Koha::ElasticSearch::Search->new(
27         { 'nodes' => ['localhost:9200'], 'index' => 'mydb' }
28     ),
29     'Creating a Koha::ElasticSearch::Search object'
30 );
31
32 is( $searcher->index, 'mydb', 'Testing basic accessor' );
33
34 ok( $searcher->connect, 'Connect to ElasticSearch server' );
35 ok( my $results = $searcher->search( { record => 'easy' } ), 'Do a search ' );
36
37 ok( my $marcresults = $searcher->marc_search( { record => 'Fish' } ),
38     'Do a marc search' );