Class: Eson::Search::Prefix

Inherits:
FieldBased show all
Includes:
Filter, Query
Defined in:
lib/eson/search/prefix.rb

Instance Attribute Summary

Attributes inherited from FieldBased

#field, #options

Instance Method Summary collapse

Methods included from Filter

included, #method_missing

Methods included from Query

included, #method_missing

Methods inherited from FieldBased

#initialize

Constructor Details

This class inherits a constructor from Eson::Search::FieldBased

Dynamic Method Handling

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

Instance Method Details

#prefix { ... } ⇒ self #prefix { ... } ⇒ self

Overloads:

  • #prefix { ... } ⇒ self

    Generates a ‘prefix` filter in a filter context.

    Yields:

    • the block containing further options and subfilters

    Returns:

    • (self)

      the generated facet

  • #prefix { ... } ⇒ self

    Generates a ‘prefix` facet in a facets context.

    Yields:

    • the block describing further options

    Returns:

    • (self)

      the generated facet



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

short_name :prefix

#to_query_hashObject



11
12
13
14
15
16
17
# File 'lib/eson/search/prefix.rb', line 11

def to_query_hash
  if field
    {name => field.to_query_hash}
  else
    {name => options}
  end
end