Class: Aggregations::Buckets::TermsAggregationBuilder
Overview
Elasticsearch Terms Aggregation
Constant Summary
collapse
- ATTRIBUTES =
[:size, :order, :include, :exclude, :min_doc_count]
Helpers::AggregationQueryBuilderHelper::OBJECT_ARRAY_QUERY_FIELDS, Helpers::AggregationQueryBuilderHelper::OBJECT_ARRAY_SETTINGS_FIELDS
Instance Method Summary
collapse
#attributes
#name_expr, #query, #type_expr
#abstract_agg_builder, #sub_aggregation, #sub_aggregation_expr
#field, #field_expr, #missing, #missing_expr, #script, #script_expr, #value_source_agg_builder
Constructor Details
Returns a new instance of TermsAggregationBuilder.
14
15
16
17
18
19
20
21
22
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 14
def initialize name:
@name = name.intern
@type = :terms
@query = {
@name => {
@type => {}
}
}
end
|
Instance Method Details
Returns , can be chained for ordering on multiple fields.
38
39
40
41
42
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 38
def add_order bucket_order
@order ||= []
@order << bucket_order
self
end
|
63
64
65
66
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 63
def exclude exclude_list
@exclude = exclude_list
self
end
|
#exclude_expr ⇒ Array
69
70
71
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 69
def exclude_expr
@exclude
end
|
51
52
53
54
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 51
def include include_list
@include = include_list
self
end
|
#include_expr ⇒ Array
57
58
59
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 57
def include_expr
@include
end
|
75
76
77
78
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 75
def min_doc_count doc_count
@min_doc_count = doc_count
self
end
|
#min_doc_count_expr ⇒ Integer
81
82
83
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 81
def min_doc_count_expr
@min_doc_count
end
|
#order_expr ⇒ Array
45
46
47
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 45
def order_expr
@order
end
|
26
27
28
29
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 26
def size size
@size = size
self
end
|
#size_expr ⇒ Integer
32
33
34
|
# File 'lib/aggregations/buckets/terms_aggregation_builder.rb', line 32
def size_expr
@size
end
|