Class: Eson::Search::ConstantScore

Inherits:
Object
  • Object
show all
Includes:
Filters, Queries, Query
Defined in:
lib/eson/search/constant_score.rb

Instance Attribute Summary collapse

Attributes included from Queries

#queries

Attributes included from Filters

#filters

Instance Method Summary collapse

Methods included from Query

included, #method_missing

Methods included from Queries

#queries?, register, #to_query_hash

Methods included from Filters

#filters?, register, #to_query_hash

Constructor Details

#initialize(options = {}) ⇒ ConstantScore

Returns a new instance of ConstantScore.



15
16
17
# File 'lib/eson/search/constant_score.rb', line 15

def initialize(options = {})
  self.options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Eson::Search::Query

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



13
14
15
# File 'lib/eson/search/constant_score.rb', line 13

def options
  @options
end

Instance Method Details

#constant_score { ... } ⇒ self

Generates a ‘constant_score` query in a query context.

Yields:

  • the block containing further options and subqueries

Returns:

  • (self)

    the generated facet



11
# File 'lib/eson/search/constant_score.rb', line 11

short_name :constant_score