Kernel::Test::Role::Environment::ProvideTestDocumentSearchIndices

NAME

Kernel::Test::Role::Environment::ProvideTestDocumentSearchIndices – role to provide separate, temporary document search indexes for tests.

DocumentSearchDriverList()

Provides a list of document search types to create test indices, by default is uses all registered types.

Unit tests can request only to crate certain indices to improve the performance, in such case unit test must redefine it as:

has '+DocumentSearchDriverList' => ( default => sub { return ['SomeDriver']; # Return an array ref of all needed drivers by the test }, );

ProvideTestDocumentSearchIndices()

Updates the configuration with a random prefix for all elastic search indexes and creates a new set of all of them.

    $Self->ProvideTestDocumentSearchIndices();

RemoveTestDocumentSearchIndices()

Removes custom created indices by gathering the prefix in the configuration.

    $Self->RemoveTestDocumentSearchIndices();

CleanupTestDocumentSearchPipelines()

Removes all Elasticsearch pipelines, that might be created during the test runs.

    $Helper->CleanupTestDocumentSearchPipelines();

DocumentAdd()

Add documents to their corresponding elastic search index and refresh index so the documents will be immediately available for search.

    $Self->DocumentAdd(
        Documents => {
            Ticket => [ 1, 2, 3, ],         # each document type needs its own key and the value is an
                                            #   array reference of the IDs of the documents to be indexed.
            ArticleMime => [ 4, 5, 6,],
        },
    );

DocumentDelete()

Removes documents from corresponding elastic search index.

    $Self->DocumentDelete(
        Documents => {
            Ticket => [ 1, 2, 3, ],         # each document type needs its own key and the value is an
                                            #   array reference of the IDs of the documents to be indexed.
            ArticleMime => [ 4, 5, 6,],
        },
    );
Scroll to Top