api-spec-testing/test_file.rb
def clear_indices_xpack(client)
          indices = client.indices.get(index: '_all', expand_wildcards: 'all').keys.reject do |i|
            i.start_with?('.security') || i.start_with?('.watches') || i.start_with?('.ds-')
          end
          indices.each do |index|
            client.indices.delete_alias(index: index, name: '*', ignore: 404)
            client.indices.delete(index: index, ignore: 404)
          end
        end
# Prepare Elasticsearch for a single test file.
# This method deletes indices, roles, datafeeds, etc.
#
# @since 6.2.0
Prepare Elasticsearch for a single test file.
This method deletes indices, roles, datafeeds, etc.
Prepare Elasticsearch for a single test file . This method deletes indices roles datafeeds etc .
def clear_indices_xpack(client)
          indices = client.indices.get(index: '_all', expand_wildcards: 'all').keys.reject do |i|
            i.start_with?('.security') || i.start_with?('.watches') || i.start_with?('.ds-')
          end
          indices.each do |index|
            client.indices.delete_alias(index: index, name: '*', ignore: 404)
            client.indices.delete(index: index, ignore: 404)
          end
        end
def clear_indices_xpack ( client ) indices = client . indices . get ( index : '_all' , expand_wildcards : 'all' ) . keys . reject do | i | i . start_with? ( '.security' ) || i . start_with? ( '.watches' ) || i . start_with? ( '.ds-' ) end indices . each do | index | client . indices . delete_alias ( index : index , name : '*' , ignore : 404 ) client . indices . delete ( index : index , ignore : 404 ) end end
Prepare Elasticsearch for a single test file.
Prepare Elasticsearch for a single test file .
client
since
None