Class: JayAPI::Elasticsearch::QueryBuilder::Aggregations::Sources::Terms
- Inherits:
-
Object
- Object
- JayAPI::Elasticsearch::QueryBuilder::Aggregations::Sources::Terms
- Defined in:
- lib/jay_api/elasticsearch/query_builder/aggregations/sources/terms.rb
Overview
Represents a “Terms” value source for a Composite aggregation. More information about this type of value source can be found here: www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-composite-aggregation#_terms
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#missing_bucket ⇒ Object
readonly
Returns the value of attribute missing_bucket.
-
#missing_order ⇒ Object
readonly
Returns the value of attribute missing_order.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Instance Method Summary collapse
-
#clone ⇒ self
A copy of the receiver.
-
#initialize(name, field:, order: nil, missing_bucket: nil, missing_order: nil) ⇒ Terms
constructor
A new instance of Terms.
-
#to_h ⇒ Hash
The hash representation for the value source.
Constructor Details
#initialize(name, field:, order: nil, missing_bucket: nil, missing_order: nil) ⇒ Terms
Returns a new instance of Terms.
23 24 25 26 27 28 29 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/sources/terms.rb', line 23 def initialize(name, field:, order: nil, missing_bucket: nil, missing_order: nil) @name = name @field = field @order = order @missing_bucket = missing_bucket @missing_order = missing_order end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
12 13 14 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/sources/terms.rb', line 12 def field @field end |
#missing_bucket ⇒ Object (readonly)
Returns the value of attribute missing_bucket.
12 13 14 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/sources/terms.rb', line 12 def missing_bucket @missing_bucket end |
#missing_order ⇒ Object (readonly)
Returns the value of attribute missing_order.
12 13 14 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/sources/terms.rb', line 12 def missing_order @missing_order end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/sources/terms.rb', line 12 def name @name end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
12 13 14 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/sources/terms.rb', line 12 def order @order end |
Instance Method Details
#clone ⇒ self
Returns A copy of the receiver.
32 33 34 35 36 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/sources/terms.rb', line 32 def clone self.class.new( name, field: field, order: order, missing_bucket: missing_bucket, missing_order: missing_order ) end |
#to_h ⇒ Hash
Returns The hash representation for the value source.
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/sources/terms.rb', line 39 def to_h { name => { terms: { field: field, order: order, missing_bucket: missing_bucket, missing_order: missing_order }.compact } } end |