Class: Eson::Search::DisMax

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

Instance Attribute Summary collapse

Attributes included from Queries

#queries

Instance Method Summary collapse

Methods included from Queries

#queries?, register

Methods included from Query

included, #method_missing

Constructor Details

#initialize(options = {}) ⇒ DisMax

Returns a new instance of DisMax.



12
13
14
# File 'lib/eson/search/dis_max.rb', line 12

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.



10
11
12
# File 'lib/eson/search/dis_max.rb', line 10

def options
  @options
end

Instance Method Details

#dis_max { ... } ⇒ self

Generates a ‘dis_max` query in a query context.

Yields:

  • the block containing further options and subqueries

Returns:

  • (self)

    the generated facet



8
# File 'lib/eson/search/dis_max.rb', line 8

short_name :dis_max

#to_query_hashObject



16
17
18
# File 'lib/eson/search/dis_max.rb', line 16

def to_query_hash
  {name => {:queries => queries.to_query_hash}.merge(options) }
end