Class: Elasticsearch::DSL::Search::Suggest

Inherits:
Object
  • Object
show all
Includes:
BaseComponent
Defined in:
lib/elasticsearch/dsl/search/suggest.rb

Overview

Wraps the ‘suggest` part of a search definition

Instance Method Summary collapse

Methods included from BaseComponent

included

Constructor Details

#initialize(key, options = {}, &block) ⇒ Suggest

Returns a new instance of Suggest.



16
17
18
19
20
# File 'lib/elasticsearch/dsl/search/suggest.rb', line 16

def initialize(key, options={}, &block)
  @key     = key
  @options = options
  @block   = block
end

Instance Method Details

#to_hashHash

Convert the definition to a Hash

Returns:

  • (Hash)


26
27
28
# File 'lib/elasticsearch/dsl/search/suggest.rb', line 26

def to_hash
  { @key => @options }
end