elasticsearch-dsl 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -24
  3. data/lib/elasticsearch/dsl.rb +1 -1
  4. data/lib/elasticsearch/dsl/search.rb +1 -1
  5. data/lib/elasticsearch/dsl/search/aggregation.rb +1 -1
  6. data/lib/elasticsearch/dsl/search/aggregations/composite.rb +60 -0
  7. data/lib/elasticsearch/dsl/search/aggregations/extended_stats.rb +1 -1
  8. data/lib/elasticsearch/dsl/search/aggregations/nested.rb +1 -1
  9. data/lib/elasticsearch/dsl/search/aggregations/range.rb +1 -1
  10. data/lib/elasticsearch/dsl/search/filter.rb +1 -1
  11. data/lib/elasticsearch/dsl/search/filters/bool.rb +4 -4
  12. data/lib/elasticsearch/dsl/search/filters/match_all.rb +1 -1
  13. data/lib/elasticsearch/dsl/search/filters/range.rb +1 -1
  14. data/lib/elasticsearch/dsl/search/filters/term.rb +1 -1
  15. data/lib/elasticsearch/dsl/search/highlight.rb +1 -1
  16. data/lib/elasticsearch/dsl/search/options.rb +1 -1
  17. data/lib/elasticsearch/dsl/search/queries/bool.rb +3 -3
  18. data/lib/elasticsearch/dsl/search/queries/geo_shape.rb +1 -1
  19. data/lib/elasticsearch/dsl/search/queries/match.rb +1 -1
  20. data/lib/elasticsearch/dsl/search/queries/match_all.rb +1 -1
  21. data/lib/elasticsearch/dsl/search/queries/query_string.rb +1 -1
  22. data/lib/elasticsearch/dsl/search/queries/range.rb +1 -1
  23. data/lib/elasticsearch/dsl/search/queries/term.rb +1 -1
  24. data/lib/elasticsearch/dsl/search/query.rb +1 -1
  25. data/lib/elasticsearch/dsl/search/sort.rb +1 -1
  26. data/lib/elasticsearch/dsl/search/suggest.rb +1 -1
  27. data/lib/elasticsearch/dsl/version.rb +1 -1
  28. data/spec/elasticsearch/dsl/search/aggregations/composite_spec.rb +99 -0
  29. data/spec/elasticsearch/dsl/search/filters/bool_spec.rb +50 -0
  30. data/spec/elasticsearch/dsl/search/queries/bool_spec.rb +58 -0
  31. data/test/integration/search_aggregation_children_test.rb +7 -9
  32. data/test/integration/search_aggregation_geo_test.rb +9 -11
  33. data/test/integration/search_aggregation_nested_test.rb +15 -16
  34. data/test/integration/search_aggregations_test.rb +7 -9
  35. data/test/integration/search_filters_test.rb +14 -16
  36. data/test/integration/search_options_test.rb +2 -2
  37. data/test/integration/search_query_test.rb +2 -2
  38. data/test/integration/search_size_from_test.rb +2 -2
  39. data/test/integration/search_sort_test.rb +3 -3
  40. data/test/integration/search_suggest_test.rb +13 -15
  41. data/test/integration/search_test.rb +3 -3
  42. metadata +6 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afb07ac938ef185bc8a443aa3342adb1728d4e3947be80591760cd38b1870a33
4
- data.tar.gz: eab97dbc6c770bb122be1c9adbb53871771cc6861a688aea3d2f41aafddaba6c
3
+ metadata.gz: 5f1f7538a8ba72fb494c08161eaeea00b841efb6053eb9b640916082380e44d1
4
+ data.tar.gz: 8952342319cc9f742c8ad7c2be57d1b78a9025535a590f1b4b464a4e77f4cc4b
5
5
  SHA512:
6
- metadata.gz: 745dbe52e814395095ba7473c80595ad73f69de5d1def5ee9e82dac93d5864f5fda5564462990fc747e6963b1f7f72b352302e3a0d047229347bfc8737ba638e
7
- data.tar.gz: 0c17e0f57cdf44e84f0247048e8e1ecbd76eac23642a38fd7a22f357c13840b9090da94163739dc48278b9c993db817d47d514498dac06d48fd18f51dead49f9
6
+ metadata.gz: e845c2c5a586e8de9d7ef256305b4a9635c8f5278fbac3f22b3b512560366a25edefac398f9fdc8eba7fda84e6c67e79ce337e46b22a7f0491c486b00e62dfc2
7
+ data.tar.gz: 89628d179337835661ce4d671b4e7fcd56ee8cf92af8155a3a18bdbf8c3901e1791c9cfc427a55a1814b0c656598aca873a122c32a0fa423ea595ea6c86e3acf
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Elasticsearch::DSL
2
2
 
3
3
  The `elasticsearch-dsl` library provides a Ruby API for
4
- the [Elasticsearch Query DSL](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html).
4
+ the [Elasticsearch Query DSL](http://www.elasticsearch.com/guide/en/elasticsearch/reference/current/query-dsl.html).
5
5
 
6
6
  The library is compatible with Ruby 1.9 or higher and Elasticsearch 1.0 and higher.
7
7
 
@@ -26,7 +26,7 @@ or install it from a source code checkout:
26
26
 
27
27
  The library is designed as a group of standalone Ruby modules, classes and DSL methods,
28
28
  which provide an idiomatic way to build complex
29
- [search definitions](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html).
29
+ [search definitions](http://www.elasticsearch.com/guide/en/elasticsearch/reference/current/search-request-body.html).
30
30
 
31
31
  Let's have a simple example using the declarative variant:
32
32
 
@@ -100,20 +100,20 @@ which are translated to Hashes, and ultimately, JSON, the language of Elasticsea
100
100
 
101
101
  All Elasticsearch DSL features are supported, namely:
102
102
 
103
- * [Queries](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-queries.html)
104
- * [Filters](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-filters.html)
105
- * [Aggregations](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations.html)
106
- * [Suggestions](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters.html)
107
- * [Sorting](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html)
108
- * [Pagination](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-from-size.html)
109
- * [Options](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html) (source filtering, highlighting, etc)
103
+ * [Queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-queries.html)
104
+ * [Filters](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-filters.html)
105
+ * [Aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html)
106
+ * [Suggestions](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html)
107
+ * [Sorting](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html)
108
+ * [Pagination](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html)
109
+ * [Options](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html) (source filtering, highlighting, etc)
110
110
 
111
111
  An example of a complex search definition is below.
112
112
 
113
113
  **NOTE:** In order to run the example, you have to allow restoring from the `data.elasticsearch.org` repository by adding the following configuration line to your `elasticsearch.yml`:
114
114
 
115
115
  ```yaml
116
- repositories.url.allowed_urls: ["https://s3.amazonaws.com/data.elasticsearch.org/*"]
116
+ repositories.url.allowed_urls: ["https://s3.amazonaws.com/data.elasticsearch.com/*"]
117
117
  ```
118
118
 
119
119
  ```ruby
@@ -130,8 +130,8 @@ puts "Recovering the 'bicycles.stackexchange.com' index...".yellow
130
130
 
131
131
  client.indices.delete index: 'bicycles.stackexchange.com', ignore: 404
132
132
 
133
- client.snapshot.create_repository repository: 'data.elasticsearch.org', body: { type: 'url', settings: { url: 'https://s3.amazonaws.com/data.elasticsearch.org/bicycles.stackexchange.com/' } }
134
- client.snapshot.restore repository: 'data.elasticsearch.org', snapshot: 'bicycles.stackexchange.com', body: { indices: 'bicycles.stackexchange.com' }
133
+ client.snapshot.create_repository repository: 'data.elasticsearch.com', body: { type: 'url', settings: { url: 'https://s3.amazonaws.com/data.elasticsearch.com/bicycles.stackexchange.com/' } }
134
+ client.snapshot.restore repository: 'data.elasticsearch.com', snapshot: 'bicycles.stackexchange.com', body: { indices: 'bicycles.stackexchange.com' }
135
135
  until client.cluster.health(level: 'indices')['indices']['bicycles.stackexchange.com']['status'] == 'green'
136
136
  r = client.indices.recovery(index: 'bicycles.stackexchange.com', human: true)['bicycles.stackexchange.com']['shards'][0] rescue nil
137
137
  print "\r#{r['index']['size']['recovered'] rescue '0b'} of #{r['index']['size']['total'] rescue 'N/A'}".ljust(52).gray
@@ -263,16 +263,19 @@ see instructions in the main [README](../README.md#development).
263
263
 
264
264
  This software is licensed under the Apache 2 license, quoted below.
265
265
 
266
- Copyright (c) 2015 Elasticsearch <http://www.elasticsearch.org>
267
-
268
- Licensed under the Apache License, Version 2.0 (the "License");
269
- you may not use this file except in compliance with the License.
266
+ Licensed to Elasticsearch B.V. under one or more contributor
267
+ license agreements. See the NOTICE file distributed with
268
+ this work for additional information regarding copyright
269
+ ownership. Elasticsearch B.V. licenses this file to you under
270
+ the Apache License, Version 2.0 (the "License"); you may
271
+ not use this file except in compliance with the License.
270
272
  You may obtain a copy of the License at
271
-
272
- http://www.apache.org/licenses/LICENSE-2.0
273
-
274
- Unless required by applicable law or agreed to in writing, software
275
- distributed under the License is distributed on an "AS IS" BASIS,
276
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
277
- See the License for the specific language governing permissions and
278
- limitations under the License.
273
+
274
+ http://www.apache.org/licenses/LICENSE-2.0
275
+
276
+ Unless required by applicable law or agreed to in writing,
277
+ software distributed under the License is distributed on an
278
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
279
+ KIND, either express or implied. See the License for the
280
+ specific language governing permissions and limitations
281
+ under the License.
@@ -54,7 +54,7 @@ module Elasticsearch
54
54
  # # => { query: { match: { title: "test"} } }
55
55
  #
56
56
  # @see Search
57
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/query-dsl-intro.html
57
+ # @see https://www.elastic.co/guide/en/elasticsearch/guide/current/query-dsl-intro.html
58
58
  #
59
59
  module DSL
60
60
  def self.included(base)
@@ -43,7 +43,7 @@ module Elasticsearch
43
43
  # definition.to_hash
44
44
  # # => {:query=>{:match=>{:title=>"test"}}}
45
45
  #
46
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search.html
46
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html
47
47
  #
48
48
  def search(*args, &block)
49
49
  Search.new(*args, &block)
@@ -31,7 +31,7 @@ module Elasticsearch
31
31
 
32
32
  # Wraps the `aggregations` part of a search definition
33
33
  #
34
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations.html
34
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
35
35
  #
36
36
  class Aggregation
37
37
  def initialize(*args, &block)
@@ -0,0 +1,60 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ module Elasticsearch
19
+ module DSL
20
+ module Search
21
+ module Aggregations
22
+ #
23
+ # A multi-bucket aggregation that creates composite buckets from different sources.
24
+ #
25
+ # @example
26
+ #
27
+ # search do
28
+ # aggregation :things do
29
+ # composite do
30
+ # size 2000
31
+ # sources [
32
+ # { thing1: { terms: { field: 'thing1.field1' } } },
33
+ # { thing2: { terms: { field: 'thing2.field2' } } }
34
+ # ]
35
+ # after after_key
36
+ # end
37
+ # end
38
+ # end
39
+ #
40
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-composite-aggregation.html
41
+ #
42
+ class Composite
43
+ include BaseAggregationComponent
44
+
45
+ option_method :size
46
+ option_method :sources
47
+ option_method :after
48
+
49
+ def to_hash(_options={})
50
+ super
51
+ # remove :after if no value is given
52
+ @hash[name.to_sym].delete(:after) if @hash[name.to_sym].is_a?(Hash) && @hash[name.to_sym][:after].nil?
53
+
54
+ @hash
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -30,7 +30,7 @@ module Elasticsearch
30
30
  # end
31
31
  # end
32
32
  #
33
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-extendedstats-aggregation.html
33
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-extendedstats-aggregation.html
34
34
  #
35
35
  class ExtendedStats
36
36
  include BaseComponent
@@ -37,7 +37,7 @@ module Elasticsearch
37
37
  #
38
38
  # See the integration test for a full example.
39
39
  #
40
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-nested-aggregation.html
40
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-nested-aggregation.html
41
41
  #
42
42
  class Nested
43
43
  include BaseAggregationComponent
@@ -47,7 +47,7 @@ module Elasticsearch
47
47
  # end
48
48
  # end
49
49
  #
50
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-aggregation.html
50
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-aggregation.html
51
51
  class Range
52
52
  include BaseAggregationComponent
53
53
 
@@ -25,7 +25,7 @@ module Elasticsearch
25
25
 
26
26
  # Wraps the `filter` part of a search definition, aggregation, etc
27
27
  #
28
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-filters.html
28
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-filters.html
29
29
  #
30
30
  class Filter
31
31
  def initialize(*args, &block)
@@ -52,28 +52,28 @@ module Elasticsearch
52
52
  #
53
53
  # See the integration test for a working example.
54
54
  #
55
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-bool-filter.html
55
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-filter.html
56
56
  #
57
57
  class Bool
58
58
  include BaseComponent
59
59
 
60
60
  def must(*args, &block)
61
61
  @hash[name][:must] ||= []
62
- value = Filter.new(*args, &block).to_hash
62
+ value = args.empty? ? Filter.new(*args, &block).to_hash : args.first.to_hash
63
63
  @hash[name][:must].push(value).flatten! unless @hash[name][:must].include?(value)
64
64
  self
65
65
  end
66
66
 
67
67
  def must_not(*args, &block)
68
68
  @hash[name][:must_not] ||= []
69
- value = Filter.new(*args, &block).to_hash
69
+ value = args.empty? ? Filter.new(*args, &block).to_hash : args.first.to_hash
70
70
  @hash[name][:must_not].push(value).flatten! unless @hash[name][:must_not].include?(value)
71
71
  self
72
72
  end
73
73
 
74
74
  def should(*args, &block)
75
75
  @hash[name][:should] ||= []
76
- value = Filter.new(*args, &block).to_hash
76
+ value = args.empty? ? Filter.new(*args, &block).to_hash : args.first.to_hash
77
77
  @hash[name][:should].push(value).flatten! unless @hash[name][:should].include?(value)
78
78
  self
79
79
  end
@@ -34,7 +34,7 @@ module Elasticsearch
34
34
  # end
35
35
  # end
36
36
  #
37
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-all-filter.html
37
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-all-filter.html
38
38
  #
39
39
  class MatchAll
40
40
  include BaseComponent
@@ -37,7 +37,7 @@ module Elasticsearch
37
37
  # end
38
38
  # end
39
39
  #
40
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html
40
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html
41
41
  #
42
42
  class Range
43
43
  include BaseComponent
@@ -37,7 +37,7 @@ module Elasticsearch
37
37
  # @note The specified terms are *not analyzed* (lowercased, stemmed, etc),
38
38
  # so they must match the indexed terms.
39
39
  #
40
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-filter.html
40
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-filter.html
41
41
  #
42
42
  class Term
43
43
  include BaseComponent
@@ -21,7 +21,7 @@ module Elasticsearch
21
21
 
22
22
  # Wraps the `highlight` part of a search definition
23
23
  #
24
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html
24
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html
25
25
  #
26
26
  class Highlight
27
27
  include BaseComponent
@@ -21,7 +21,7 @@ module Elasticsearch
21
21
 
22
22
  # Wraps the "extra" options of a search definition
23
23
  #
24
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-body.html
24
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html
25
25
  #
26
26
  class Options
27
27
  DSL_METHODS = [
@@ -58,21 +58,21 @@ module Elasticsearch
58
58
 
59
59
  def must(*args, &block)
60
60
  @hash[name][:must] ||= []
61
- value = Query.new(*args, &block).to_hash
61
+ value = args.empty? ? Query.new(*args, &block).to_hash : args.first.to_hash
62
62
  @hash[name][:must].push(value).flatten! unless @hash[name][:must].include?(value)
63
63
  self
64
64
  end
65
65
 
66
66
  def must_not(*args, &block)
67
67
  @hash[name][:must_not] ||= []
68
- value = Query.new(*args, &block).to_hash
68
+ value = args.empty? ? Query.new(*args, &block).to_hash : args.first.to_hash
69
69
  @hash[name][:must_not].push(value).flatten! unless @hash[name][:must_not].include?(value)
70
70
  self
71
71
  end
72
72
 
73
73
  def should(*args, &block)
74
74
  @hash[name][:should] ||= []
75
- value = Query.new(*args, &block).to_hash
75
+ value = args.empty? ? Query.new(*args, &block).to_hash : args.first.to_hash
76
76
  @hash[name][:should].push(value).flatten! unless @hash[name][:should].include?(value)
77
77
  self
78
78
  end
@@ -33,7 +33,7 @@ module Elasticsearch
33
33
  # end
34
34
  # end
35
35
  #
36
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-query.html
36
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-query.html
37
37
  #
38
38
  class GeoShape
39
39
  include BaseComponent
@@ -34,7 +34,7 @@ module Elasticsearch
34
34
  # end
35
35
  # end
36
36
  #
37
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html
37
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html
38
38
  #
39
39
  class Match
40
40
  include BaseComponent
@@ -30,7 +30,7 @@ module Elasticsearch
30
30
  # end
31
31
  # end
32
32
  #
33
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html
33
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html
34
34
  #
35
35
  class MatchAll
36
36
  include BaseComponent
@@ -33,7 +33,7 @@ module Elasticsearch
33
33
  # end
34
34
  # end
35
35
  #
36
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
36
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
37
37
  # @see http://lucene.apache.org/core/2_9_4/queryparsersyntax.html
38
38
  #
39
39
  class QueryString
@@ -45,7 +45,7 @@ module Elasticsearch
45
45
  # end
46
46
  # end
47
47
  #
48
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-query.html
48
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html
49
49
  #
50
50
  class Range
51
51
  include BaseComponent
@@ -32,7 +32,7 @@ module Elasticsearch
32
32
  # end
33
33
  # end
34
34
  #
35
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-query.html
35
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html
36
36
  #
37
37
  class Term
38
38
  include BaseComponent
@@ -25,7 +25,7 @@ module Elasticsearch
25
25
 
26
26
  # Wraps the `query` part of a search definition
27
27
  #
28
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html
28
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html
29
29
  #
30
30
  class Query
31
31
  def initialize(*args, &block)
@@ -21,7 +21,7 @@ module Elasticsearch
21
21
 
22
22
  # Wraps the `sort` part of a search definition
23
23
  #
24
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html
24
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html
25
25
  #
26
26
  class Sort
27
27
  include BaseComponent
@@ -21,7 +21,7 @@ module Elasticsearch
21
21
 
22
22
  # Wraps the `suggest` part of a search definition
23
23
  #
24
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters.html
24
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html
25
25
  #
26
26
  class Suggest
27
27
  include BaseComponent
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elasticsearch
19
19
  module DSL
20
- VERSION = "0.1.7"
20
+ VERSION = "0.1.8"
21
21
  end
22
22
  end
@@ -0,0 +1,99 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ require 'spec_helper'
19
+
20
+ describe Elasticsearch::DSL::Search::Aggregations::Composite do
21
+
22
+ let(:search) do
23
+ described_class.new
24
+ end
25
+
26
+ describe '#to_hash' do
27
+
28
+ it 'can be converted to a hash' do
29
+ expect(search.to_hash).to eq(composite: {})
30
+ end
31
+ end
32
+
33
+ context 'when options methods are called' do
34
+
35
+ let(:search) do
36
+ described_class.new(:foo)
37
+ end
38
+
39
+ describe '#size' do
40
+
41
+ before do
42
+ search.size(2_000)
43
+ end
44
+
45
+ it 'applies the option' do
46
+ expect(search.to_hash[:composite][:foo][:size]).to eq(2_000)
47
+ end
48
+ end
49
+
50
+ describe '#sources' do
51
+
52
+ before do
53
+ search.sources('bar')
54
+ end
55
+
56
+ it 'applies the option' do
57
+ expect(search.to_hash[:composite][:foo][:sources]).to eq('bar')
58
+ end
59
+ end
60
+
61
+ describe '#after' do
62
+ context 'when after is not given' do
63
+ before do
64
+ search.size(2_000)
65
+ end
66
+
67
+ it 'applies the option' do
68
+ expect(search.to_hash[:composite][:foo].keys).not_to include(:after)
69
+ end
70
+ end
71
+
72
+ context 'when after is given' do
73
+ before do
74
+ search.after('fake_after_key')
75
+ end
76
+
77
+ it 'applies the option' do
78
+ expect(search.to_hash[:composite][:foo][:after]).to eq('fake_after_key')
79
+ end
80
+ end
81
+ end
82
+ end
83
+
84
+ describe '#initialize' do
85
+
86
+ context 'when a block is provided' do
87
+
88
+ let(:search) do
89
+ described_class.new(:foo) do
90
+ size 2_000
91
+ end
92
+ end
93
+
94
+ it 'executes the block' do
95
+ expect(search.to_hash).to eq({ composite: { foo: { size: 2_000 } } })
96
+ end
97
+ end
98
+ end
99
+ end
@@ -32,6 +32,56 @@ describe Elasticsearch::DSL::Search::Filters::Bool do
32
32
 
33
33
  describe '#initialize' do
34
34
 
35
+ context 'when an object instance is provided' do
36
+
37
+ let(:search) do
38
+ described_class.new.must( Elasticsearch::DSL::Search::Filters::Term.new foo: 'bar')
39
+ end
40
+
41
+ it 'applies the condition' do
42
+ expect(search.to_hash).to eq(bool: { must: [ { term: { foo: 'bar' } } ] })
43
+ end
44
+
45
+ context 'when the block calls multiple methods' do
46
+
47
+ let(:search) do
48
+ described_class.new do
49
+ must(Elasticsearch::DSL::Search::Filters::Term.new foo: 'bar')
50
+ must_not(Elasticsearch::DSL::Search::Filters::Term.new moo: 'bam')
51
+ should(Elasticsearch::DSL::Search::Filters::Term.new xoo: 'bax')
52
+ end
53
+ end
54
+
55
+ it 'executes the block' do
56
+ expect(search.to_hash).to eq(bool:
57
+ { must: [ { term: { foo: 'bar' } } ],
58
+ must_not: [ { term: { moo: 'bam' } } ],
59
+ should: [ { term: { xoo: 'bax' } } ]
60
+ })
61
+ end
62
+ end
63
+
64
+ context 'when the block calls multiple conditions' do
65
+
66
+ let(:search) do
67
+ described_class.new do
68
+ must(Elasticsearch::DSL::Search::Filters::Term.new foo: 'bar')
69
+ must(Elasticsearch::DSL::Search::Filters::Term.new moo: 'bam')
70
+
71
+ should(Elasticsearch::DSL::Search::Filters::Term.new xoo: 'bax')
72
+ should(Elasticsearch::DSL::Search::Filters::Term.new zoo: 'baz')
73
+ end
74
+ end
75
+
76
+ it 'executes the block' do
77
+ expect(search.to_hash).to eq(bool:
78
+ { must: [ { term: { foo: 'bar' } }, { term: { moo: 'bam' } } ],
79
+ should: [ { term: { xoo: 'bax' } }, { term: { zoo: 'baz' } } ]
80
+ })
81
+ end
82
+ end
83
+ end
84
+
35
85
  context 'when a hash is provided' do
36
86
 
37
87
  let(:search) do
@@ -32,6 +32,64 @@ describe Elasticsearch::DSL::Search::Queries::Bool do
32
32
 
33
33
  describe '#initialize' do
34
34
 
35
+ context 'when an object instance is provided' do
36
+
37
+ let(:search) do
38
+ described_class.new.must(Elasticsearch::DSL::Search::Queries::Match.new foo: 'bar')
39
+ end
40
+
41
+ it 'applies the condition' do
42
+ expect(search.to_hash).to eq(bool: {must: [ {match: { foo: 'bar' }} ] })
43
+ end
44
+
45
+ context 'when multiple option methods are called' do
46
+
47
+ let(:search) do
48
+ described_class.new do
49
+ should(Elasticsearch::DSL::Search::Queries::Term.new(tag: 'wow'))
50
+ should(Elasticsearch::DSL::Search::Queries::Term.new(tag: 'elasticsearch'))
51
+
52
+ minimum_should_match 1
53
+ boost 1.0
54
+ end
55
+ end
56
+
57
+ it 'defines all the options' do
58
+ expect(search.to_hash).to eq(bool: {
59
+ minimum_should_match: 1,
60
+ boost: 1.0,
61
+ should: [ {term: { tag: 'wow' }}, {term: { tag: 'elasticsearch' }} ]})
62
+ end
63
+ end
64
+
65
+ context 'when multiple conditions are provided' do
66
+
67
+ let(:search) do
68
+ described_class.new do
69
+ must(Elasticsearch::DSL::Search::Queries::Match.new foo: 'bar')
70
+ must(Elasticsearch::DSL::Search::Queries::Match.new moo: 'bam')
71
+
72
+ should(Elasticsearch::DSL::Search::Queries::Match.new xoo: 'bax')
73
+ should(Elasticsearch::DSL::Search::Queries::Match.new zoo: 'baz')
74
+ end
75
+ end
76
+
77
+ it 'applies each condition' do
78
+ expect(search.to_hash).to eq(bool:
79
+ { must: [ {match: { foo: 'bar' }}, {match: { moo: 'bam' }} ],
80
+ should: [ {match: { xoo: 'bax' }}, {match: { zoo: 'baz' }} ]
81
+ })
82
+ end
83
+
84
+ context 'when #to_hash is called more than once' do
85
+
86
+ it 'does not alter the hash' do
87
+ expect(search.to_hash).to eq(search.to_hash)
88
+ end
89
+ end
90
+ end
91
+ end
92
+
35
93
  context 'when a block is provided' do
36
94
 
37
95
  let(:search) do
@@ -29,16 +29,14 @@ module Elasticsearch
29
29
 
30
30
  setup do
31
31
  @client.indices.create index: 'articles-and-comments', body: {
32
- mappings: {
33
- _doc: {
34
- properties: {
35
- title: { type: 'text' },
36
- category: { type: 'keyword' },
37
- join_field: { type: 'join', relations: { article: 'comment' } },
38
- author: { type: 'keyword'}
39
- }
32
+ mappings: {
33
+ properties: {
34
+ title: {type: 'text'},
35
+ category: {type: 'keyword'},
36
+ join_field: {type: 'join', relations: {article: 'comment'}},
37
+ author: {type: 'keyword'}
38
+ }
40
39
  }
41
- }
42
40
  }
43
41
 
44
42
  @client.index index: 'articles-and-comments', id: 1,
@@ -29,23 +29,21 @@ module Elasticsearch
29
29
 
30
30
  setup do
31
31
  @client.indices.create index: 'venues-test', body: {
32
- mappings: {
33
- venue: {
34
- properties: {
35
- location: { type: 'geo_point' }
36
- }
32
+ mappings: {
33
+ properties: {
34
+ location: {type: 'geo_point'}
35
+ }
37
36
  }
38
- }
39
37
  }
40
- @client.index index: 'venues-test', type: 'venue',
38
+ @client.index index: 'venues-test',
41
39
  body: { name: 'Space', location: "38.886214,1.403889" }
42
- @client.index index: 'venues-test', type: 'venue',
40
+ @client.index index: 'venues-test',
43
41
  body: { name: 'Pacha', location: "38.9184427,1.4433646" }
44
- @client.index index: 'venues-test', type: 'venue',
42
+ @client.index index: 'venues-test',
45
43
  body: { name: 'Amnesia', location: "38.948045,1.408341" }
46
- @client.index index: 'venues-test', type: 'venue',
44
+ @client.index index: 'venues-test',
47
45
  body: { name: 'Privilege', location: "38.958082,1.408288" }
48
- @client.index index: 'venues-test', type: 'venue',
46
+ @client.index index: 'venues-test',
49
47
  body: { name: 'Es Paradis', location: "38.979071,1.307394" }
50
48
  @client.indices.refresh index: 'venues-test'
51
49
  end
@@ -29,31 +29,30 @@ module Elasticsearch
29
29
 
30
30
  setup do
31
31
  @client.indices.create index: 'products-test', body: {
32
- mappings: {
33
- product: {
34
- properties: {
35
- title: { type: 'text' },
36
- category: { type: 'keyword' },
37
- offers: {
38
- type: 'nested',
39
- properties: {
40
- name: { type: 'text' },
41
- price: { type: 'double' }
42
- }
32
+ mappings: {
33
+ properties: {
34
+ title: {type: 'text'},
35
+ category: {type: 'keyword'},
36
+ offers: {
37
+ type: 'nested',
38
+ properties: {
39
+ name: {type: 'text'},
40
+ price: {type: 'double'}
41
+ }
42
+ }
43
43
  }
44
- }
45
44
  }
46
- }
47
45
  }
48
- @client.index index: 'products-test', type: 'product',
46
+
47
+ @client.index index: 'products-test',
49
48
  body: { title: 'A',
50
49
  category: 'audio',
51
50
  offers: [ { name: 'A1', price: 100 }, { name: 'A2', price: 120 } ] }
52
- @client.index index: 'products-test', type: 'product',
51
+ @client.index index: 'products-test',
53
52
  body: { title: 'B',
54
53
  category: 'audio',
55
54
  offers: [ { name: 'B1', price: 200 }, { name: 'B2', price: 180 } ] }
56
- @client.index index: 'products-test', type: 'product',
55
+ @client.index index: 'products-test',
57
56
  body: { title: 'C',
58
57
  category: 'video',
59
58
  offers: [ { name: 'C1', price: 300 }, { name: 'C2', price: 350 } ] }
@@ -25,17 +25,15 @@ module Elasticsearch
25
25
  context "Aggregations integration" do
26
26
  setup do
27
27
  @client.indices.create index: 'test', body: {
28
- mappings: {
29
- d: {
30
- properties: {
31
- tags: { type: 'keyword' }
32
- }
28
+ mappings: {
29
+ properties: {
30
+ tags: {type: 'keyword'}
31
+ }
33
32
  }
34
- }
35
33
  }
36
- @client.index index: 'test', type: 'd', id: '1', body: { title: 'A', tags: %w[one], clicks: 5 }
37
- @client.index index: 'test', type: 'd', id: '2', body: { title: 'B', tags: %w[one two], clicks: 15 }
38
- @client.index index: 'test', type: 'd', id: '3', body: { title: 'C', tags: %w[one three], clicks: 20 }
34
+ @client.index index: 'test', id: '1', body: { title: 'A', tags: %w[one], clicks: 5 }
35
+ @client.index index: 'test', id: '2', body: { title: 'B', tags: %w[one two], clicks: 15 }
36
+ @client.index index: 'test', id: '3', body: { title: 'C', tags: %w[one three], clicks: 20 }
39
37
  @client.indices.refresh index: 'test'
40
38
  end
41
39
 
@@ -31,49 +31,49 @@ module Elasticsearch
31
31
 
32
32
  setup do
33
33
  @client.indices.create index: 'test'
34
- @client.index index: 'test', type: 'd', id: 1,
34
+ @client.index index: 'test', id: 1,
35
35
  body: { name: 'Original',
36
36
  color: 'red',
37
37
  size: 'xxl',
38
38
  category: 'unisex',
39
39
  manufacturer: 'a' }
40
40
 
41
- @client.index index: 'test', type: 'd', id: 2,
41
+ @client.index index: 'test', id: 2,
42
42
  body: { name: 'Original',
43
43
  color: 'red',
44
44
  size: 'xl',
45
45
  category: 'unisex',
46
46
  manufacturer: 'a' }
47
47
 
48
- @client.index index: 'test', type: 'd', id: 3,
48
+ @client.index index: 'test', id: 3,
49
49
  body: { name: 'Original',
50
50
  color: 'red',
51
51
  size: 'l',
52
52
  category: 'unisex',
53
53
  manufacturer: 'a' }
54
54
 
55
- @client.index index: 'test', type: 'd', id: 4,
55
+ @client.index index: 'test', id: 4,
56
56
  body: { name: 'Western',
57
57
  color: 'red',
58
58
  size: 'm',
59
59
  category: 'men',
60
60
  manufacturer: 'c' }
61
61
 
62
- @client.index index: 'test', type: 'd', id: 5,
62
+ @client.index index: 'test', id: 5,
63
63
  body: { name: 'Modern',
64
64
  color: 'grey',
65
65
  size: 'l',
66
66
  category: 'men',
67
67
  manufacturer: 'b' }
68
68
 
69
- @client.index index: 'test', type: 'd', id: 6,
69
+ @client.index index: 'test', id: 6,
70
70
  body: { name: 'Modern',
71
71
  color: 'grey',
72
72
  size: 's',
73
73
  category: 'men',
74
74
  manufacturer: 'b' }
75
75
 
76
- @client.index index: 'test', type: 'd', id: 7,
76
+ @client.index index: 'test', id: 7,
77
77
  body: { name: 'Modern',
78
78
  color: 'grey',
79
79
  size: 's',
@@ -152,21 +152,19 @@ module Elasticsearch
152
152
  context "geographical filters" do
153
153
  setup do
154
154
  @client.indices.create index: 'places', body: {
155
- mappings: {
156
- d: {
157
- properties: {
158
- location: {
159
- type: 'geo_point'
155
+ mappings: {
156
+ properties: {
157
+ location: {
158
+ type: 'geo_point'
159
+ }
160
160
  }
161
- }
162
161
  }
163
- }
164
162
  }
165
- @client.index index: 'places', type: 'd', id: 1,
163
+ @client.index index: 'places', id: 1,
166
164
  body: { name: 'Vyšehrad',
167
165
  location: '50.064399, 14.420018'}
168
166
 
169
- @client.index index: 'places', type: 'd', id: 2,
167
+ @client.index index: 'places', id: 2,
170
168
  body: { name: 'Karlštejn',
171
169
  location: '49.939518, 14.188046'}
172
170
 
@@ -25,8 +25,8 @@ module Elasticsearch
25
25
  context "Search options" do
26
26
  setup do
27
27
  @client.indices.create index: 'test'
28
- @client.index index: 'test', type: 'd', id: '1', body: { title: 'Test' }
29
- @client.index index: 'test', type: 'd', id: '2', body: { title: 'Rest' }
28
+ @client.index index: 'test', id: '1', body: { title: 'Test' }
29
+ @client.index index: 'test', id: '2', body: { title: 'Rest' }
30
30
  @client.indices.refresh index: 'test'
31
31
  end
32
32
 
@@ -29,8 +29,8 @@ module Elasticsearch
29
29
 
30
30
  setup do
31
31
  @client.indices.create index: 'test'
32
- @client.index index: 'test', type: 'd', id: '1', body: { title: 'Test', tags: ['one'] }
33
- @client.index index: 'test', type: 'd', id: '2', body: { title: 'Rest', tags: ['one', 'two'] }
32
+ @client.index index: 'test', id: '1', body: { title: 'Test', tags: ['one'] }
33
+ @client.index index: 'test', id: '2', body: { title: 'Rest', tags: ['one', 'two'] }
34
34
  @client.indices.refresh index: 'test'
35
35
  end
36
36
 
@@ -25,9 +25,9 @@ module Elasticsearch
25
25
  context "Search results pagination" do
26
26
  setup do
27
27
  @client.indices.create index: 'test', body: {
28
- mappings: { d: { properties: { title: { type: 'text', fields: { keyword: { type: 'keyword' } } } } } } }
28
+ mappings: { properties: { title: { type: 'text', fields: { keyword: { type: 'keyword' } } } } } }
29
29
 
30
- 25.times { |i| @client.index index: 'test', type: 'd', id: i, body: { title: "Test #{sprintf('%03d', i)}" } }
30
+ 25.times { |i| @client.index index: 'test', id: i, body: { title: "Test #{sprintf('%03d', i)}" } }
31
31
 
32
32
  @client.indices.refresh index: 'test'
33
33
  end
@@ -29,9 +29,9 @@ module Elasticsearch
29
29
 
30
30
  setup do
31
31
  @client.indices.create index: 'test'
32
- @client.index index: 'test', type: 'd', id: '1', body: { tags: ['one'], clicks: 15 }
33
- @client.index index: 'test', type: 'd', id: '2', body: { tags: ['one', 'two'], clicks: 5 }
34
- @client.index index: 'test', type: 'd', id: '3', body: { tags: ['one', 'three'], clicks: 20 }
32
+ @client.index index: 'test', id: '1', body: { tags: ['one'], clicks: 15 }
33
+ @client.index index: 'test', id: '2', body: { tags: ['one', 'two'], clicks: 5 }
34
+ @client.index index: 'test', id: '3', body: { tags: ['one', 'three'], clicks: 20 }
35
35
  @client.indices.refresh index: 'test'
36
36
  end
37
37
 
@@ -31,37 +31,35 @@ module Elasticsearch
31
31
 
32
32
  setup do
33
33
  @client.indices.create index: 'test', body: {
34
- mappings: {
35
- d: {
36
- properties: {
37
- title: { type: 'text' },
38
- suggest: {
39
- type: 'object',
40
- properties: {
41
- title: { type: 'completion' },
42
- payload: { type: 'object', enabled: false }
43
- }
34
+ mappings: {
35
+ properties: {
36
+ title: {type: 'text'},
37
+ suggest: {
38
+ type: 'object',
39
+ properties: {
40
+ title: {type: 'completion'},
41
+ payload: {type: 'object', enabled: false}
42
+ }
43
+ }
44
44
  }
45
- }
46
45
  }
47
- }
48
46
  }
49
47
 
50
- @client.index index: 'test', type: 'd', id: '1', body: {
48
+ @client.index index: 'test', id: '1', body: {
51
49
  title: 'One',
52
50
  suggest: {
53
51
  title: { input: ['one', 'uno', 'jedna'] },
54
52
  payload: { id: '1' }
55
53
  }
56
54
  }
57
- @client.index index: 'test', type: 'd', id: '2', body: {
55
+ @client.index index: 'test', id: '2', body: {
58
56
  title: 'Two',
59
57
  suggest: {
60
58
  title: { input: ['two', 'due', 'dvě'] },
61
59
  payload: { id: '2' }
62
60
  }
63
61
  }
64
- @client.index index: 'test', type: 'd', id: '3', body: {
62
+ @client.index index: 'test', id: '3', body: {
65
63
  title: 'Three',
66
64
  suggest: {
67
65
  title: { input: ['three', 'tres', 'tři'] },
@@ -56,9 +56,9 @@ module Elasticsearch
56
56
 
57
57
  setup do
58
58
  @client.indices.create index: 'test'
59
- @client.index index: 'test', type: 'd', id: '1', body: { title: 'Test', tags: ['one'] }
60
- @client.index index: 'test', type: 'd', id: '2', body: { title: 'Test', tags: ['one', 'two'] }
61
- @client.index index: 'test', type: 'd', id: '3', body: { title: 'Test', tags: ['three'] }
59
+ @client.index index: 'test', id: '1', body: { title: 'Test', tags: ['one'] }
60
+ @client.index index: 'test', id: '2', body: { title: 'Test', tags: ['one', 'two'] }
61
+ @client.index index: 'test', id: '3', body: { title: 'Test', tags: ['three'] }
62
62
  @client.indices.refresh index: 'test'
63
63
  end
64
64
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-25 00:00:00.000000000 Z
11
+ date: 2019-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -214,6 +214,7 @@ files:
214
214
  - lib/elasticsearch/dsl/search/aggregations/avg.rb
215
215
  - lib/elasticsearch/dsl/search/aggregations/cardinality.rb
216
216
  - lib/elasticsearch/dsl/search/aggregations/children.rb
217
+ - lib/elasticsearch/dsl/search/aggregations/composite.rb
217
218
  - lib/elasticsearch/dsl/search/aggregations/date_histogram.rb
218
219
  - lib/elasticsearch/dsl/search/aggregations/date_range.rb
219
220
  - lib/elasticsearch/dsl/search/aggregations/extended_stats.rb
@@ -333,6 +334,7 @@ files:
333
334
  - spec/elasticsearch/dsl/search/aggregations/avg_spec.rb
334
335
  - spec/elasticsearch/dsl/search/aggregations/cardinality_spec.rb
335
336
  - spec/elasticsearch/dsl/search/aggregations/children_spec.rb
337
+ - spec/elasticsearch/dsl/search/aggregations/composite_spec.rb
336
338
  - spec/elasticsearch/dsl/search/aggregations/date_histogram_spec.rb
337
339
  - spec/elasticsearch/dsl/search/aggregations/date_range_spec.rb
338
340
  - spec/elasticsearch/dsl/search/aggregations/extended_stats_spec.rb
@@ -484,7 +486,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
484
486
  - !ruby/object:Gem::Version
485
487
  version: '0'
486
488
  requirements: []
487
- rubygems_version: 3.0.2
489
+ rubygems_version: 3.0.3
488
490
  signing_key:
489
491
  specification_version: 4
490
492
  summary: A Ruby DSL builder for Elasticsearch
@@ -492,6 +494,7 @@ test_files:
492
494
  - spec/elasticsearch/dsl/search/aggregations/avg_spec.rb
493
495
  - spec/elasticsearch/dsl/search/aggregations/cardinality_spec.rb
494
496
  - spec/elasticsearch/dsl/search/aggregations/children_spec.rb
497
+ - spec/elasticsearch/dsl/search/aggregations/composite_spec.rb
495
498
  - spec/elasticsearch/dsl/search/aggregations/date_histogram_spec.rb
496
499
  - spec/elasticsearch/dsl/search/aggregations/date_range_spec.rb
497
500
  - spec/elasticsearch/dsl/search/aggregations/extended_stats_spec.rb