Class: Dina::SearchCount

Inherits:
BaseSearch show all
Defined in:
lib/dina/search/search_count.rb

Class Method Summary collapse

Methods inherited from BaseSearch

endpoint, index_name

Class Method Details

.endpoint_pathObject



6
7
8
# File 'lib/dina/search/search_count.rb', line 6

def self.endpoint_path
  "search-api/search-ws/count"
end

.execute(index:, payload: {}) ⇒ Object

index values: “agent”, “material_sample”, “object_store” Payload is a has like: {bool: {filter: {term: {“data.attributes.group”: “dao”}}}}



12
13
14
15
16
17
# File 'lib/dina/search/search_count.rb', line 12

def self.execute(index:, payload: {})
  params = {
    indexName: index_name(index: index)
  }
  super(params.compact, method: :post, payload: payload)[:count]
end