Class: Elasticsearch::DSL::Search::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticsearch/dsl/search/options.rb

Overview

Wraps the “extra” options of a search definition

Constant Summary collapse

DSL_METHODS =
[
  :_source,
  :fields,
  :script_fields,
  :fielddata_fields,
  :rescore,
  :explain,
  :version,
  :indices_boost,
  :track_scores,
  :min_score
]

Instance Method Summary collapse

Constructor Details

#initialize(*args, &block) ⇒ Options

Returns a new instance of Options.



40
41
42
# File 'lib/elasticsearch/dsl/search/options.rb', line 40

def initialize(*args, &block)
  @hash = {}
end

Instance Method Details

#empty?Boolean

Returns true when there are no search options defined

Returns:

  • (Boolean)


58
59
60
# File 'lib/elasticsearch/dsl/search/options.rb', line 58

def empty?
  @hash.empty?
end

#to_hash(options = {}) ⇒ Hash

Convert the definition to a Hash

Returns:

  • (Hash)


66
67
68
# File 'lib/elasticsearch/dsl/search/options.rb', line 66

def to_hash(options={})
  @hash
end