Class: Arelastic::Queries::FunctionScore
- Inherits:
-
Query
- Object
- Nodes::Node
- Query
- Arelastic::Queries::FunctionScore
- Defined in:
- lib/arelastic/queries/function_score.rb
Instance Attribute Summary collapse
-
#functions ⇒ Object
Returns the value of attribute functions.
-
#options ⇒ Object
Returns the value of attribute options.
-
#query ⇒ Object
Returns the value of attribute query.
Instance Method Summary collapse
- #as_elastic ⇒ Object
-
#initialize(options) ⇒ FunctionScore
constructor
A new instance of FunctionScore.
Methods inherited from Query
Methods inherited from Nodes::Node
#==, #convert_to_elastic, #read_option!
Methods included from Arities::Binary
Methods included from Arities::Polyadic
Methods included from Arities::Unary
Constructor Details
#initialize(options) ⇒ FunctionScore
Returns a new instance of FunctionScore.
5 6 7 8 9 |
# File 'lib/arelastic/queries/function_score.rb', line 5 def initialize() @query = read_option! , 'query' @functions = read_option! , 'functions' @options = end |
Instance Attribute Details
#functions ⇒ Object
Returns the value of attribute functions.
4 5 6 |
# File 'lib/arelastic/queries/function_score.rb', line 4 def functions @functions end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/arelastic/queries/function_score.rb', line 4 def @options end |
#query ⇒ Object
Returns the value of attribute query.
4 5 6 |
# File 'lib/arelastic/queries/function_score.rb', line 4 def query @query end |
Instance Method Details
#as_elastic ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/arelastic/queries/function_score.rb', line 11 def as_elastic { 'function_score' => { 'query' => convert_to_elastic(query), 'functions' => convert_to_elastic(functions) }.update() } end |