Class: Noiseless::Adapters::Postgresql::IndicesAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/noiseless/adapters/postgresql.rb

Instance Method Summary collapse

Constructor Details

#initialize(adapter) ⇒ IndicesAPI

Returns a new instance of IndicesAPI.



102
103
104
# File 'lib/noiseless/adapters/postgresql.rb', line 102

def initialize(adapter)
  @adapter = adapter
end

Instance Method Details

#get(index:) ⇒ Object



106
107
108
109
# File 'lib/noiseless/adapters/postgresql.rb', line 106

def get(index:)
  # Return table info as index info
  { index => { "mappings" => {}, "settings" => {} } }
end

#refresh(index:) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



115
116
117
118
# File 'lib/noiseless/adapters/postgresql.rb', line 115

def refresh(index:) # rubocop:disable Lint/UnusedMethodArgument
  # No-op for PostgreSQL - queries always see latest data
  { "_shards" => { "total" => 1, "successful" => 1, "failed" => 0 } }
end

#stats(index:) ⇒ Object



111
112
113
# File 'lib/noiseless/adapters/postgresql.rb', line 111

def stats(index:)
  { "indices" => { index => {} } }
end