Sha256: dc9391777eff19d37723d93ee9ad28d4439feff9f3c0ed9a21a7c7cce82ff682

Contents?: true

Size: 647 Bytes

Versions: 4

Compression:

Stored size: 647 Bytes

Contents

# frozen_string_literal: true

module Esse
  module Backend
    class Index
      module InstanceMethods
        # Checks the index existance. Returns true or false
        #
        #   UsersIndex.elasticsearch.exist? #=> true
        #
        # @param options [Hash] Options hash
        # @option options [String, nil] :suffix The index suffix. Defaults to the index_version.
        #   Use nil if you want to check existence of the `index_name` index or alias.
        def exist?(suffix: index_version)
          client.indices.exists(index: index_name(suffix: suffix))
        end
      end

      include InstanceMethods
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
esse-0.2.0 lib/esse/backend/index/existance.rb
esse-0.1.3 lib/esse/backend/index/existance.rb
esse-0.1.2 lib/esse/backend/index/existance.rb
esse-0.1.1 lib/esse/backend/index/existance.rb