Class: Dina::Search
- Inherits:
-
BaseSearch
- Object
- JsonApiClient::Resource
- BaseModel
- BaseSearch
- Dina::Search
- Defined in:
- lib/dina/search/search.rb
Class Method Summary collapse
- .endpoint_path ⇒ Object
-
.execute(index:, payload: { query: { match_all: {} } }) ⇒ Hash
Executes a search.
Methods inherited from BaseSearch
endpoint, index_name, verify_ssl
Methods inherited from BaseModel
custom_headers, find_by_group, #initialize, properties, site
Constructor Details
This class inherits a constructor from Dina::BaseModel
Class Method Details
.endpoint_path ⇒ Object
6 7 8 |
# File 'lib/dina/search/search.rb', line 6 def self.endpoint_path "search-api/search-ws/search" end |
.execute(index:, payload: { query: { match_all: {} } }) ⇒ Hash
Executes a search
> { query: { match_all: {} }
17 18 19 20 21 22 |
# File 'lib/dina/search/search.rb', line 17 def self.execute(index:, payload: { query: { match_all: {} } }) params = { indexName: index_name(index: index) } super(params.compact, method: :post, payload: payload)[:hits] end |