Class: OpenSearch::DSL::Search::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/opensearch/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.



49
50
51
# File 'lib/opensearch/dsl/search/options.rb', line 49

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

Instance Method Details

#empty?Boolean

Returns true when there are no search options defined

Returns:

  • (Boolean)


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

def empty?
  @hash.empty?
end

#to_hash(options = {}) ⇒ Hash

Convert the definition to a Hash

Returns:

  • (Hash)


75
76
77
# File 'lib/opensearch/dsl/search/options.rb', line 75

def to_hash(options={})
  @hash
end