<commit_before>#!perl

use Test::More;
use strict;
use warnings;
our ( $es, $es_version );
my $r;

### CREATE INDEX ###
ok $es->create_index( index => 'es_test_1' )->{ok}, 'Created index';
throws_ok { $es->create_index( index => 'es_test_1' ) } qr/Already exists/,
    ' - second create fails';

throws_ok { $es->create_index( index => [ 'es_test_1', 'es_test_2' ] ) }
qr/single value/,
    ' - multiple indices fails';

ok $r = $es->create_index(
    index => 'es_test_2',

    settings => {

        number_of_shards   => 3,
        number_of_replicas => 1,

        analysis => {
            filter => {
                my_filter => {
                    type      => 'stop',
                    stopwords => [ 'foo', 'bar' ]
                },
            },
            tokenizer => {
                my_tokenizer => {
                    type             => 'standard',
                    max_token_length => 900,
                }
            },<commit_msg>Fixed test when creating index on 0.90.7 - error msg changed<commit_after>#!perl

use Test::More;
use strict;
use warnings;
our ( $es, $es_version );
my $r;

### CREATE INDEX ###
ok $es->create_index( index => 'es_test_1' )->{ok}, 'Created index';
throws_ok { $es->create_index( index => 'es_test_1' ) } qr/[Aa]lready exists/,
    ' - second create fails';

throws_ok { $es->create_index( index => [ 'es_test_1', 'es_test_2' ] ) }
qr/single value/,
    ' - multiple indices fails';

ok $r = $es->create_index(
    index => 'es_test_2',

    settings => {

        number_of_shards   => 3,
        number_of_replicas => 1,

        analysis => {
            filter => {
                my_filter => {
                    type      => 'stop',
                    stopwords => [ 'foo', 'bar' ]
                },
            },
            tokenizer => {
                my_tokenizer => {
                    type             => 'standard',
                    max_token_length => 900,
                }
            },
{'fraction_non_alphanumeric': 0.15, 'fraction_numerical': 0.012121212121212121, 'mean_word_length': 1.5794270833333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7297393', 'n_tokens_mistral': 653, 'n_tokens_neox': 612, 'n_words': 137}