Class: Eson::Search::CustomScore

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

Instance Attribute Summary collapse

Attributes included from Queries

#queries

Instance Method Summary collapse

Methods included from Query

included, #method_missing

Methods included from Queries

#queries?, register, #to_query_hash

Constructor Details

#initialize(options = {}) ⇒ CustomScore

Returns a new instance of CustomScore.



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

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.



11
12
13
# File 'lib/eson/search/custom_score.rb', line 11

def options
  @options
end

Instance Method Details

#custom_score { ... } ⇒ self

Generates a ‘custom_score` query in a query context.

Yields:

  • the block containing further options and subqueries

Returns:

  • (self)

    the generated facet



9
# File 'lib/eson/search/custom_score.rb', line 9

short_name :custom_score