Class: ElasticQuery::FunctionScore
- Defined in:
- lib/elastic_query/function_score.rb
Instance Attribute Summary collapse
-
#functions ⇒ Object
readonly
Returns the value of attribute functions.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Attributes inherited from Query
Instance Method Summary collapse
-
#initialize(query, functions, options = {}) ⇒ FunctionScore
constructor
A new instance of FunctionScore.
- #to_hash ⇒ Object
Constructor Details
#initialize(query, functions, options = {}) ⇒ FunctionScore
Returns a new instance of FunctionScore.
5 6 7 8 9 |
# File 'lib/elastic_query/function_score.rb', line 5 def initialize(query, functions, = {}) @functions = functions @options = super(query) end |
Instance Attribute Details
#functions ⇒ Object (readonly)
Returns the value of attribute functions.
3 4 5 |
# File 'lib/elastic_query/function_score.rb', line 3 def functions @functions end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/elastic_query/function_score.rb', line 3 def @options end |
Instance Method Details
#to_hash ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/elastic_query/function_score.rb', line 11 def to_hash { function_score: { query: query.to_hash, }.merge(functions.to_hash).merge() } end |