Class: OpenSearch::DSL::Search::Suggest
- Inherits:
-
Object
- Object
- OpenSearch::DSL::Search::Suggest
- Includes:
- BaseComponent
- Defined in:
- lib/opensearch/dsl/search/suggest.rb
Overview
Wraps the ‘suggest` part of a search definition
Instance Method Summary collapse
-
#initialize(key, options = {}, &block) ⇒ Suggest
constructor
A new instance of Suggest.
-
#to_hash ⇒ Hash
Convert the definition to a Hash.
Methods included from BaseComponent
Constructor Details
#initialize(key, options = {}, &block) ⇒ Suggest
Returns a new instance of Suggest.
37 38 39 40 41 |
# File 'lib/opensearch/dsl/search/suggest.rb', line 37 def initialize(key, ={}, &block) @key = key @options = @block = block end |
Instance Method Details
#to_hash ⇒ Hash
Convert the definition to a Hash
47 48 49 |
# File 'lib/opensearch/dsl/search/suggest.rb', line 47 def to_hash { @key => @options } end |