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,
  :track_total_hits
]

Instance Method Summary collapse

Constructor Details

#initialize(*args, &block) ⇒ Options

Returns a new instance of Options.



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

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

Instance Method Details

#empty?Boolean

Returns true when there are no search options defined

Returns:

  • (Boolean)


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

def empty?
  @hash.empty?
end

#to_hash(options = {}) ⇒ Hash

Convert the definition to a Hash

Returns:

  • (Hash)


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

def to_hash(options={})
  @hash
end