Class: Eson::Search::TopChildren

Inherits:
Object
  • Object
show all
Includes:
Filter, Query, QueryGroup
Defined in:
lib/eson/search/top_children.rb

Instance Attribute Summary collapse

Attributes included from Parametrized

#args

Attributes included from Queries

#queries

Attributes included from Filters

#filters

Instance Method Summary collapse

Methods included from QueryGroup

#to_hash

Methods included from Parametrized

#param

Methods included from Queries

#queries?, register

Methods included from Filters

#filters?, register

Methods included from Filter

included, #method_missing

Methods included from Query

included, #method_missing

Constructor Details

#initialize(type, options = {}) ⇒ TopChildren

Returns a new instance of TopChildren.



14
15
16
# File 'lib/eson/search/top_children.rb', line 14

def initialize(type, options = {})
  self.options = options.merge(:type => type)
end

Dynamic Method Handling

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

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#to_query_hashObject



18
19
20
21
22
# File 'lib/eson/search/top_children.rb', line 18

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

#top_children { ... } ⇒ self #top_children { ... } ⇒ self

Overloads:

  • #top_children { ... } ⇒ self

    Generates a ‘top_children` filter in a filter context.

    Yields:

    • the block containing further options and subfilters

    Returns:

    • (self)

      the generated facet

  • #top_children { ... } ⇒ self

    Generates a ‘top_children` query in a query context.

    Yields:

    • the block containing further options and subqueries

    Returns:

    • (self)

      the generated facet



10
# File 'lib/eson/search/top_children.rb', line 10

short_name :top_children