Skip to content

Commit 3271d03

Browse files
committed
[DSL] Fixed the documentation and naming for the missing aggregation in 821576d
Closes #286 Closes #287
1 parent 821576d commit 3271d03

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

elasticsearch-dsl/lib/elasticsearch/dsl/search/aggregations/missing.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@ module DSL
33
module Search
44
module Aggregations
55

6-
# A multi-bucket aggregation which returns the collection of terms and their document counts
6+
# A single bucket aggregation that creates a bucket of all documents
7+
# which are missing a value for the field
78
#
89
# @example Passing the options as a Hash
910
#
10-
# aggregation :tags do
11+
# aggregation :articles_without_tags do
1112
# missing field: 'tags'
1213
# end
1314
#
1415
# @example Passing the options as a block
1516
#
1617
# search do
17-
# aggregation :tags do
18+
# aggregation :articles_without_tags do
1819
# missing do
1920
# field 'tags'
2021
# end

elasticsearch-dsl/test/unit/aggregations/missing_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Elasticsearch
44
module Test
55
module Aggregations
6-
class RangeTest < ::Test::Unit::TestCase
6+
class MissingTest < ::Test::Unit::TestCase
77
include Elasticsearch::DSL::Search::Aggregations
88

99
context "Missing aggregation" do
@@ -14,8 +14,8 @@ class RangeTest < ::Test::Unit::TestCase
1414
end
1515

1616
should "take a Hash" do
17-
subject = Missing.new( { field: 'test' } )
18-
assert_equal({ missing: { field: "test" } }, subject.to_hash)
17+
subject = Missing.new( { field: 'foo' } )
18+
assert_equal({ missing: { field: "foo" } }, subject.to_hash)
1919
end
2020

2121
should "have option methods" do

0 commit comments

Comments
 (0)