Class: Eson::Search::SpanNot

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

Instance Method Summary collapse

Methods included from Query

included, #method_missing

Dynamic Method Handling

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

Instance Method Details

#exclude(&block) ⇒ Object



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

def exclude(&block)
  @exclude ||= SubQuery.new(args)
  @exclude.send(context, &block)
end

#include(&block) ⇒ Object



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

def include(&block)
  @include ||= SubQuery.new(args)
  @include.send(context, &block)
end

#span_not { ... } ⇒ self

Generates a ‘span_not` query in a query context.

Yields:

  • the block containing further options and subqueries

Returns:

  • (self)

    the generated facet



7
# File 'lib/eson/search/span_not.rb', line 7

short_name :span_not

#to_query_hashObject



19
20
21
22
23
24
25
26
# File 'lib/eson/search/span_not.rb', line 19

def to_query_hash
  result = {}

  result[:include] = @include.to_query_hash
  result[:exclude] = @exclude.to_query_hash

  {name => result}
end