elasticsearch-dsl 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +16 -0
- data/LICENSE.txt +10 -19
- data/README.md +244 -15
- data/Rakefile +212 -0
- data/elasticsearch-dsl.gemspec +32 -15
- data/lib/elasticsearch-dsl.rb +1 -0
- data/lib/elasticsearch/dsl.rb +43 -3
- data/lib/elasticsearch/dsl/search.rb +241 -0
- data/lib/elasticsearch/dsl/search/aggregation.rb +79 -0
- data/lib/elasticsearch/dsl/search/aggregations/avg.rb +25 -0
- data/lib/elasticsearch/dsl/search/aggregations/cardinality.rb +32 -0
- data/lib/elasticsearch/dsl/search/aggregations/children.rb +39 -0
- data/lib/elasticsearch/dsl/search/aggregations/date_histogram.rb +40 -0
- data/lib/elasticsearch/dsl/search/aggregations/date_range.rb +34 -0
- data/lib/elasticsearch/dsl/search/aggregations/extended_stats.rb +25 -0
- data/lib/elasticsearch/dsl/search/aggregations/filter.rb +30 -0
- data/lib/elasticsearch/dsl/search/aggregations/filters.rb +35 -0
- data/lib/elasticsearch/dsl/search/aggregations/geo_bounds.rb +44 -0
- data/lib/elasticsearch/dsl/search/aggregations/geo_distance.rb +39 -0
- data/lib/elasticsearch/dsl/search/aggregations/geohash_grid.rb +35 -0
- data/lib/elasticsearch/dsl/search/aggregations/global.rb +25 -0
- data/lib/elasticsearch/dsl/search/aggregations/histogram.rb +35 -0
- data/lib/elasticsearch/dsl/search/aggregations/ip_range.rb +31 -0
- data/lib/elasticsearch/dsl/search/aggregations/max.rb +25 -0
- data/lib/elasticsearch/dsl/search/aggregations/min.rb +25 -0
- data/lib/elasticsearch/dsl/search/aggregations/nested.rb +34 -0
- data/lib/elasticsearch/dsl/search/aggregations/percentile_ranks.rb +34 -0
- data/lib/elasticsearch/dsl/search/aggregations/percentiles.rb +33 -0
- data/lib/elasticsearch/dsl/search/aggregations/range.rb +53 -0
- data/lib/elasticsearch/dsl/search/aggregations/reverse_nested.rb +37 -0
- data/lib/elasticsearch/dsl/search/aggregations/scripted_metric.rb +39 -0
- data/lib/elasticsearch/dsl/search/aggregations/significant_terms.rb +45 -0
- data/lib/elasticsearch/dsl/search/aggregations/stats.rb +25 -0
- data/lib/elasticsearch/dsl/search/aggregations/sum.rb +25 -0
- data/lib/elasticsearch/dsl/search/aggregations/terms.rb +33 -0
- data/lib/elasticsearch/dsl/search/aggregations/top_hits.rb +35 -0
- data/lib/elasticsearch/dsl/search/aggregations/value_count.rb +25 -0
- data/lib/elasticsearch/dsl/search/base_aggregation_component.rb +65 -0
- data/lib/elasticsearch/dsl/search/base_component.rb +162 -0
- data/lib/elasticsearch/dsl/search/base_compound_filter_component.rb +97 -0
- data/lib/elasticsearch/dsl/search/filter.rb +56 -0
- data/lib/elasticsearch/dsl/search/filters/and.rb +45 -0
- data/lib/elasticsearch/dsl/search/filters/bool.rb +80 -0
- data/lib/elasticsearch/dsl/search/filters/exists.rb +32 -0
- data/lib/elasticsearch/dsl/search/filters/geo_bounding_box.rb +45 -0
- data/lib/elasticsearch/dsl/search/filters/geo_distance.rb +57 -0
- data/lib/elasticsearch/dsl/search/filters/geo_distance_range.rb +32 -0
- data/lib/elasticsearch/dsl/search/filters/geo_polygon.rb +41 -0
- data/lib/elasticsearch/dsl/search/filters/geo_shape.rb +35 -0
- data/lib/elasticsearch/dsl/search/filters/geohash_cell.rb +46 -0
- data/lib/elasticsearch/dsl/search/filters/has_child.rb +73 -0
- data/lib/elasticsearch/dsl/search/filters/has_parent.rb +72 -0
- data/lib/elasticsearch/dsl/search/filters/ids.rb +32 -0
- data/lib/elasticsearch/dsl/search/filters/indices.rb +77 -0
- data/lib/elasticsearch/dsl/search/filters/limit.rb +31 -0
- data/lib/elasticsearch/dsl/search/filters/match_all.rb +29 -0
- data/lib/elasticsearch/dsl/search/filters/missing.rb +34 -0
- data/lib/elasticsearch/dsl/search/filters/nested.rb +58 -0
- data/lib/elasticsearch/dsl/search/filters/not.rb +73 -0
- data/lib/elasticsearch/dsl/search/filters/or.rb +45 -0
- data/lib/elasticsearch/dsl/search/filters/prefix.rb +29 -0
- data/lib/elasticsearch/dsl/search/filters/query.rb +54 -0
- data/lib/elasticsearch/dsl/search/filters/range.rb +39 -0
- data/lib/elasticsearch/dsl/search/filters/regexp.rb +34 -0
- data/lib/elasticsearch/dsl/search/filters/script.rb +32 -0
- data/lib/elasticsearch/dsl/search/filters/term.rb +32 -0
- data/lib/elasticsearch/dsl/search/filters/terms.rb +32 -0
- data/lib/elasticsearch/dsl/search/filters/type.rb +34 -0
- data/lib/elasticsearch/dsl/search/highlight.rb +92 -0
- data/lib/elasticsearch/dsl/search/options.rb +56 -0
- data/lib/elasticsearch/dsl/search/queries/bool.rb +75 -0
- data/lib/elasticsearch/dsl/search/queries/boosting.rb +33 -0
- data/lib/elasticsearch/dsl/search/queries/common.rb +38 -0
- data/lib/elasticsearch/dsl/search/queries/constant_score.rb +66 -0
- data/lib/elasticsearch/dsl/search/queries/dis_max.rb +35 -0
- data/lib/elasticsearch/dsl/search/queries/filtered.rb +77 -0
- data/lib/elasticsearch/dsl/search/queries/function_score.rb +102 -0
- data/lib/elasticsearch/dsl/search/queries/fuzzy.rb +45 -0
- data/lib/elasticsearch/dsl/search/queries/fuzzy_like_this.rb +37 -0
- data/lib/elasticsearch/dsl/search/queries/fuzzy_like_this_field.rb +36 -0
- data/lib/elasticsearch/dsl/search/queries/geo_shape.rb +31 -0
- data/lib/elasticsearch/dsl/search/queries/has_child.rb +57 -0
- data/lib/elasticsearch/dsl/search/queries/has_parent.rb +57 -0
- data/lib/elasticsearch/dsl/search/queries/ids.rb +28 -0
- data/lib/elasticsearch/dsl/search/queries/indices.rb +34 -0
- data/lib/elasticsearch/dsl/search/queries/match.rb +34 -0
- data/lib/elasticsearch/dsl/search/queries/match_all.rb +27 -0
- data/lib/elasticsearch/dsl/search/queries/more_like_this.rb +58 -0
- data/lib/elasticsearch/dsl/search/queries/multi_match.rb +35 -0
- data/lib/elasticsearch/dsl/search/queries/nested.rb +55 -0
- data/lib/elasticsearch/dsl/search/queries/prefix.rb +30 -0
- data/lib/elasticsearch/dsl/search/queries/query_string.rb +50 -0
- data/lib/elasticsearch/dsl/search/queries/range.rb +47 -0
- data/lib/elasticsearch/dsl/search/queries/regexp.rb +31 -0
- data/lib/elasticsearch/dsl/search/queries/simple_query_string.rb +38 -0
- data/lib/elasticsearch/dsl/search/queries/span_first.rb +28 -0
- data/lib/elasticsearch/dsl/search/queries/span_multi.rb +28 -0
- data/lib/elasticsearch/dsl/search/queries/span_near.rb +32 -0
- data/lib/elasticsearch/dsl/search/queries/span_not.rb +33 -0
- data/lib/elasticsearch/dsl/search/queries/span_or.rb +28 -0
- data/lib/elasticsearch/dsl/search/queries/span_term.rb +26 -0
- data/lib/elasticsearch/dsl/search/queries/template.rb +31 -0
- data/lib/elasticsearch/dsl/search/queries/term.rb +27 -0
- data/lib/elasticsearch/dsl/search/queries/terms.rb +27 -0
- data/lib/elasticsearch/dsl/search/queries/top_children.rb +58 -0
- data/lib/elasticsearch/dsl/search/queries/wildcard.rb +30 -0
- data/lib/elasticsearch/dsl/search/query.rb +55 -0
- data/lib/elasticsearch/dsl/search/sort.rb +50 -0
- data/lib/elasticsearch/dsl/search/suggest.rb +28 -0
- data/lib/elasticsearch/dsl/utils.rb +25 -0
- data/lib/elasticsearch/dsl/version.rb +2 -2
- data/test/integration/search_aggregation_children_test.rb +69 -0
- data/test/integration/search_aggregation_geo_test.rb +90 -0
- data/test/integration/search_aggregation_nested_test.rb +100 -0
- data/test/integration/search_aggregations_test.rb +232 -0
- data/test/integration/search_filters_test.rb +359 -0
- data/test/integration/search_options_test.rb +28 -0
- data/test/integration/search_query_test.rb +55 -0
- data/test/integration/search_size_from_test.rb +41 -0
- data/test/integration/search_sort_test.rb +36 -0
- data/test/integration/search_suggest_test.rb +62 -0
- data/test/test_helper.rb +62 -0
- data/test/unit/aggregations/avg_test.rb +24 -0
- data/test/unit/aggregations/cardinality_test.rb +40 -0
- data/test/unit/aggregations/children_test.rb +36 -0
- data/test/unit/aggregations/date_histogram_test.rb +49 -0
- data/test/unit/aggregations/date_range_test.rb +42 -0
- data/test/unit/aggregations/extended_stats_test.rb +24 -0
- data/test/unit/aggregations/filter_test.rb +31 -0
- data/test/unit/aggregations/filters_test.rb +52 -0
- data/test/unit/aggregations/geo_bounds_test.rb +37 -0
- data/test/unit/aggregations/geo_distance_test.rb +45 -0
- data/test/unit/aggregations/geohash_grid_test.rb +40 -0
- data/test/unit/aggregations/global_test.rb +20 -0
- data/test/unit/aggregations/histogram_test.rb +42 -0
- data/test/unit/aggregations/ip_range_test.rb +41 -0
- data/test/unit/aggregations/max_test.rb +24 -0
- data/test/unit/aggregations/min_test.rb +24 -0
- data/test/unit/aggregations/nested_test.rb +48 -0
- data/test/unit/aggregations/percentile_ranks_test.rb +41 -0
- data/test/unit/aggregations/percentiles_test.rb +40 -0
- data/test/unit/aggregations/range_test.rb +48 -0
- data/test/unit/aggregations/reverse_nested_test.rb +20 -0
- data/test/unit/aggregations/scripted_metric_test.rb +41 -0
- data/test/unit/aggregations/significant_terms_test.rb +46 -0
- data/test/unit/aggregations/stats_test.rb +24 -0
- data/test/unit/aggregations/sum_test.rb +24 -0
- data/test/unit/aggregations/terms_test.rb +51 -0
- data/test/unit/aggregations/top_hits_test.rb +38 -0
- data/test/unit/aggregations/value_count_test.rb +24 -0
- data/test/unit/dsl_test.rb +18 -0
- data/test/unit/filters/and_test.rb +69 -0
- data/test/unit/filters/bool_test.rb +98 -0
- data/test/unit/filters/exists_test.rb +36 -0
- data/test/unit/filters/geo_bounding_box_test.rb +45 -0
- data/test/unit/filters/geo_distance_range_test.rb +51 -0
- data/test/unit/filters/geo_distance_test.rb +58 -0
- data/test/unit/filters/geo_polygon_test.rb +36 -0
- data/test/unit/filters/geo_shape_test.rb +37 -0
- data/test/unit/filters/geohash_cell_test.rb +43 -0
- data/test/unit/filters/has_child_test.rb +52 -0
- data/test/unit/filters/has_parent_test.rb +52 -0
- data/test/unit/filters/ids_test.rb +38 -0
- data/test/unit/filters/indices_test.rb +52 -0
- data/test/unit/filters/limit_test.rb +36 -0
- data/test/unit/filters/match_all_test.rb +20 -0
- data/test/unit/filters/missing_test.rb +38 -0
- data/test/unit/filters/nested_test.rb +40 -0
- data/test/unit/filters/not_test.rb +35 -0
- data/test/unit/filters/or_test.rb +53 -0
- data/test/unit/filters/prefix_test.rb +25 -0
- data/test/unit/filters/query_test.rb +33 -0
- data/test/unit/filters/range_test.rb +47 -0
- data/test/unit/filters/regexp_test.rb +42 -0
- data/test/unit/filters/script_test.rb +38 -0
- data/test/unit/filters/term_test.rb +27 -0
- data/test/unit/filters/terms_test.rb +24 -0
- data/test/unit/filters/type_test.rb +36 -0
- data/test/unit/queries/bool_test.rb +107 -0
- data/test/unit/queries/boosting_test.rb +41 -0
- data/test/unit/queries/common_test.rb +42 -0
- data/test/unit/queries/constant_score_test.rb +47 -0
- data/test/unit/queries/dis_max_test.rb +38 -0
- data/test/unit/queries/filtered_test.rb +51 -0
- data/test/unit/queries/function_score_test.rb +70 -0
- data/test/unit/queries/fuzzy_like_this_field_test.rb +42 -0
- data/test/unit/queries/fuzzy_like_this_test.rb +44 -0
- data/test/unit/queries/fuzzy_test.rb +40 -0
- data/test/unit/queries/geo_shape_test.rb +37 -0
- data/test/unit/queries/has_child_test.rb +53 -0
- data/test/unit/queries/has_parent_test.rb +39 -0
- data/test/unit/queries/ids_test.rb +38 -0
- data/test/unit/queries/indices_test.rb +39 -0
- data/test/unit/queries/match_all_test.rb +36 -0
- data/test/unit/queries/match_test.rb +64 -0
- data/test/unit/queries/more_like_this_test.rb +53 -0
- data/test/unit/queries/multi_match_test.rb +42 -0
- data/test/unit/queries/nested_test.rb +50 -0
- data/test/unit/queries/prefix_test.rb +37 -0
- data/test/unit/queries/query_string_test.rb +55 -0
- data/test/unit/queries/range_test.rb +39 -0
- data/test/unit/queries/regexp_test.rb +43 -0
- data/test/unit/queries/simple_query_string_test.rb +43 -0
- data/test/unit/queries/span_first_test.rb +36 -0
- data/test/unit/queries/span_multi_test.rb +36 -0
- data/test/unit/queries/span_near_test.rb +39 -0
- data/test/unit/queries/span_not_test.rb +40 -0
- data/test/unit/queries/span_or_test.rb +36 -0
- data/test/unit/queries/span_term_test.rb +24 -0
- data/test/unit/queries/template_test.rb +43 -0
- data/test/unit/queries/term_test.rb +27 -0
- data/test/unit/queries/terms_test.rb +24 -0
- data/test/unit/queries/top_children_test.rb +53 -0
- data/test/unit/queries/wildcard_test.rb +43 -0
- data/test/unit/search_aggregation_test.rb +72 -0
- data/test/unit/search_base_aggregation_component_test.rb +41 -0
- data/test/unit/search_base_component_test.rb +176 -0
- data/test/unit/search_filter_test.rb +61 -0
- data/test/unit/search_highlight_test.rb +77 -0
- data/test/unit/search_options_test.rb +80 -0
- data/test/unit/search_query_test.rb +65 -0
- data/test/unit/search_size_from_test.rb +43 -0
- data/test/unit/search_sort_test.rb +40 -0
- data/test/unit/search_suggest_test.rb +20 -0
- data/test/unit/search_test.rb +201 -0
- data/test/unit/utils_test.rb +21 -0
- metadata +524 -25
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Elasticsearch
|
4
|
+
module Test
|
5
|
+
class SearchSizeTest < ::Test::Unit::TestCase
|
6
|
+
context "Search pagination" do
|
7
|
+
|
8
|
+
should "encode the size parameter" do
|
9
|
+
subject = Elasticsearch::DSL::Search::Search.new do
|
10
|
+
size 5
|
11
|
+
end
|
12
|
+
assert_equal( { size: 5 }, subject.to_hash )
|
13
|
+
end
|
14
|
+
|
15
|
+
should "encode the from parameter" do
|
16
|
+
subject = Elasticsearch::DSL::Search::Search.new do
|
17
|
+
from 5
|
18
|
+
end
|
19
|
+
assert_equal( { from: 5 }, subject.to_hash )
|
20
|
+
end
|
21
|
+
|
22
|
+
should "have getter methods" do
|
23
|
+
subject = Elasticsearch::DSL::Search::Search.new
|
24
|
+
assert_nil subject.size
|
25
|
+
assert_nil subject.from
|
26
|
+
subject.size = 5
|
27
|
+
subject.from = 5
|
28
|
+
assert_equal 5, subject.size
|
29
|
+
assert_equal 5, subject.from
|
30
|
+
end
|
31
|
+
|
32
|
+
should "have setter methods" do
|
33
|
+
subject = Elasticsearch::DSL::Search::Search.new
|
34
|
+
subject.size = 5
|
35
|
+
subject.from = 5
|
36
|
+
assert_equal 5, subject.size
|
37
|
+
assert_equal 5, subject.from
|
38
|
+
assert_equal( { size: 5, from: 5 }, subject.to_hash )
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Elasticsearch
|
4
|
+
module Test
|
5
|
+
class SearchSortTest < ::Test::Unit::TestCase
|
6
|
+
subject { Elasticsearch::DSL::Search::Sort.new }
|
7
|
+
|
8
|
+
context "Search sort" do
|
9
|
+
|
10
|
+
should "add a single field" do
|
11
|
+
subject = Elasticsearch::DSL::Search::Sort.new :foo
|
12
|
+
assert_equal( [:foo], subject.to_hash )
|
13
|
+
end
|
14
|
+
|
15
|
+
should "add multiple fields" do
|
16
|
+
subject = Elasticsearch::DSL::Search::Sort.new [:foo, :bar]
|
17
|
+
assert_equal( [:foo, :bar], subject.to_hash )
|
18
|
+
end
|
19
|
+
|
20
|
+
should "add a field with options" do
|
21
|
+
subject = Elasticsearch::DSL::Search::Sort.new foo: { order: 'desc', mode: 'avg' }
|
22
|
+
assert_equal( [ { foo: { order: 'desc', mode: 'avg' } } ], subject.to_hash )
|
23
|
+
end
|
24
|
+
|
25
|
+
should "add fields with the DSL method" do
|
26
|
+
subject = Elasticsearch::DSL::Search::Sort.new do
|
27
|
+
by :foo
|
28
|
+
by :bar, order: 'desc'
|
29
|
+
end
|
30
|
+
|
31
|
+
assert_equal(
|
32
|
+
[
|
33
|
+
:foo,
|
34
|
+
{ bar: { order: 'desc' } },
|
35
|
+
], subject.to_hash )
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Elasticsearch
|
4
|
+
module Test
|
5
|
+
class SearchSuggestTest < ::Test::Unit::TestCase
|
6
|
+
subject { Elasticsearch::DSL::Search::Suggest.new :foo }
|
7
|
+
|
8
|
+
context "Search suggest" do
|
9
|
+
should "be an empty hash by default" do
|
10
|
+
assert_equal({ foo: {} }, subject.to_hash)
|
11
|
+
end
|
12
|
+
|
13
|
+
should "contain options" do
|
14
|
+
subject = Elasticsearch::DSL::Search::Suggest.new :foo, boo: 'bam'
|
15
|
+
assert_equal({ foo: { boo: 'bam' } }, subject.to_hash)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,201 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Elasticsearch
|
4
|
+
module Test
|
5
|
+
class SearchTest < ::Test::Unit::TestCase
|
6
|
+
subject { Elasticsearch::DSL::Search::Search.new }
|
7
|
+
|
8
|
+
context "The Search module" do
|
9
|
+
should "have the search method on instance" do
|
10
|
+
class DummySearchReceiver
|
11
|
+
include Elasticsearch::DSL::Search
|
12
|
+
end
|
13
|
+
|
14
|
+
assert_instance_of Elasticsearch::DSL::Search::Search, DummySearchReceiver.new.search
|
15
|
+
end
|
16
|
+
|
17
|
+
should "have the search method on module" do
|
18
|
+
class DummySearchReceiver
|
19
|
+
include Elasticsearch::DSL::Search
|
20
|
+
end
|
21
|
+
|
22
|
+
assert_instance_of Elasticsearch::DSL::Search::Search, Elasticsearch::DSL::Search.search
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "The Search class" do
|
27
|
+
|
28
|
+
context "with query" do
|
29
|
+
should "take the query as a literal value" do
|
30
|
+
subject.query foo: 'bar'
|
31
|
+
assert_equal({query: { foo: 'bar' }}, subject.to_hash)
|
32
|
+
end
|
33
|
+
|
34
|
+
should "take the query as a block" do
|
35
|
+
Elasticsearch::DSL::Search::Query.expects(:new).returns({foo: 'bar'})
|
36
|
+
subject.query do; end
|
37
|
+
assert_equal({query: { foo: 'bar' }}, subject.to_hash)
|
38
|
+
end
|
39
|
+
|
40
|
+
should "allow chaining" do
|
41
|
+
assert_instance_of Elasticsearch::DSL::Search::Search, subject.query(:foo)
|
42
|
+
assert_instance_of Elasticsearch::DSL::Search::Search, subject.query(:foo).query(:bar)
|
43
|
+
end
|
44
|
+
|
45
|
+
should "be converted to hash" do
|
46
|
+
assert_equal({}, subject.to_hash)
|
47
|
+
|
48
|
+
subject.query foo: 'bar'
|
49
|
+
assert_equal({query: { foo: 'bar' }}, subject.to_hash)
|
50
|
+
end
|
51
|
+
|
52
|
+
should "have a getter/setter method" do
|
53
|
+
assert_nil subject.query
|
54
|
+
subject.query = Object.new
|
55
|
+
assert_not_nil subject.query
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "with filter" do
|
60
|
+
should "take the filter as a literal value" do
|
61
|
+
subject.filter foo: 'bar'
|
62
|
+
assert_equal({filter: { foo: 'bar' }}, subject.to_hash)
|
63
|
+
end
|
64
|
+
|
65
|
+
should "take the filter as a block" do
|
66
|
+
Elasticsearch::DSL::Search::Filter.expects(:new).returns({foo: 'bar'})
|
67
|
+
subject.filter do; end
|
68
|
+
assert_equal({filter: { foo: 'bar' }}, subject.to_hash)
|
69
|
+
end
|
70
|
+
|
71
|
+
should "allow chaining" do
|
72
|
+
assert_instance_of Elasticsearch::DSL::Search::Search, subject.filter(:foo)
|
73
|
+
assert_instance_of Elasticsearch::DSL::Search::Search, subject.filter(:foo).filter(:bar)
|
74
|
+
end
|
75
|
+
|
76
|
+
should "be converted to hash" do
|
77
|
+
assert_equal({}, subject.to_hash)
|
78
|
+
|
79
|
+
subject.filter foo: 'bar'
|
80
|
+
assert_equal({filter: { foo: 'bar' }}, subject.to_hash)
|
81
|
+
end
|
82
|
+
|
83
|
+
should "have a getter/setter method" do
|
84
|
+
assert_nil subject.filter
|
85
|
+
subject.filter = Object.new
|
86
|
+
assert_not_nil subject.filter
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
context "with post_filter" do
|
91
|
+
should "take the filter as a literal value" do
|
92
|
+
subject.post_filter foo: 'bar'
|
93
|
+
assert_equal({post_filter: { foo: 'bar' }}, subject.to_hash)
|
94
|
+
end
|
95
|
+
|
96
|
+
should "take the filter as a block" do
|
97
|
+
Elasticsearch::DSL::Search::Filter.expects(:new).returns({foo: 'bar'})
|
98
|
+
subject.post_filter do; end
|
99
|
+
assert_equal({post_filter: { foo: 'bar' }}, subject.to_hash)
|
100
|
+
end
|
101
|
+
|
102
|
+
should "allow chaining" do
|
103
|
+
assert_instance_of Elasticsearch::DSL::Search::Search, subject.post_filter(:foo)
|
104
|
+
assert_instance_of Elasticsearch::DSL::Search::Search, subject.post_filter(:foo).post_filter(:bar)
|
105
|
+
end
|
106
|
+
|
107
|
+
should "be converted to hash" do
|
108
|
+
assert_equal({}, subject.to_hash)
|
109
|
+
|
110
|
+
subject.post_filter foo: 'bar'
|
111
|
+
assert_equal({post_filter: { foo: 'bar' }}, subject.to_hash)
|
112
|
+
end
|
113
|
+
|
114
|
+
should "have a getter/setter method" do
|
115
|
+
assert_nil subject.post_filter
|
116
|
+
subject.post_filter = Object.new
|
117
|
+
assert_not_nil subject.post_filter
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
context "with aggregations" do
|
122
|
+
should "take the aggregation as a literal value" do
|
123
|
+
subject.aggregation :foo, terms: 'bar'
|
124
|
+
assert_equal({aggregations: { foo: { terms: "bar" } } }, subject.to_hash)
|
125
|
+
end
|
126
|
+
|
127
|
+
should "take the aggregation as a block" do
|
128
|
+
Elasticsearch::DSL::Search::Aggregation.expects(:new).returns({tam: 'tam'})
|
129
|
+
subject.aggregation :foo do; end
|
130
|
+
assert_equal({aggregations: { foo: { tam: 'tam' } } }, subject.to_hash)
|
131
|
+
end
|
132
|
+
|
133
|
+
should "allow chaining" do
|
134
|
+
assert_instance_of Elasticsearch::DSL::Search::Search, subject.aggregation(:foo)
|
135
|
+
assert_instance_of Elasticsearch::DSL::Search::Search, subject.aggregation(:foo).aggregation(:bar)
|
136
|
+
end
|
137
|
+
|
138
|
+
should "be converted to hash" do
|
139
|
+
assert_equal({}, subject.to_hash)
|
140
|
+
|
141
|
+
subject.post_filter foo: 'bar'
|
142
|
+
assert_equal({post_filter: { foo: 'bar' }}, subject.to_hash)
|
143
|
+
end
|
144
|
+
|
145
|
+
should "have a getter/setter method" do
|
146
|
+
assert_nil subject.aggregations
|
147
|
+
subject.aggregations = { foo: Object.new }
|
148
|
+
assert_not_nil subject.aggregations
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
context "with sorting" do
|
153
|
+
should "be converted to hash" do
|
154
|
+
subject.sort :foo
|
155
|
+
assert_equal( { sort: [ :foo ] }, subject.to_hash )
|
156
|
+
end
|
157
|
+
|
158
|
+
should "have a getter method" do
|
159
|
+
assert_nil subject.sort
|
160
|
+
subject.sort :foo
|
161
|
+
assert_instance_of Elasticsearch::DSL::Search::Sort, subject.sort
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
context "with suggest" do
|
166
|
+
should "be converted to hash" do
|
167
|
+
subject.suggest :foo, { bar: 'bam' }
|
168
|
+
assert_equal( { suggest: { foo: { bar: 'bam' } } }, subject.to_hash )
|
169
|
+
end
|
170
|
+
|
171
|
+
should "have a getter/setter method" do
|
172
|
+
assert_nil subject.suggest
|
173
|
+
subject.suggest = Object.new
|
174
|
+
assert_not_nil subject.suggest
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
context "with highlighting" do
|
179
|
+
should "be converted to a hash" do
|
180
|
+
subject.highlight foo: 'bar'
|
181
|
+
assert_not_nil subject.highlight
|
182
|
+
assert_equal( { highlight: { foo: 'bar' } }, subject.to_hash )
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
context "with options" do
|
187
|
+
should "encode options" do
|
188
|
+
subject.explain true
|
189
|
+
subject.fields [:foo, :bar]
|
190
|
+
assert_equal( { explain: true, fields: [:foo, :bar] }, subject.to_hash )
|
191
|
+
end
|
192
|
+
|
193
|
+
should "raise an exception for unknown method" do
|
194
|
+
assert_raise(NoMethodError) { subject.foobar true }
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Elasticsearch
|
4
|
+
module Test
|
5
|
+
class UtilsTest < ::Test::Unit::TestCase
|
6
|
+
context "Utils" do
|
7
|
+
should "convert a string to camelcase" do
|
8
|
+
assert_equal 'Foo', Elasticsearch::DSL::Utils.__camelize('foo')
|
9
|
+
end
|
10
|
+
|
11
|
+
should "convert an underscored string to camelcase" do
|
12
|
+
assert_equal 'FooBar', Elasticsearch::DSL::Utils.__camelize('foo_bar')
|
13
|
+
end
|
14
|
+
|
15
|
+
should "convert a symbol" do
|
16
|
+
assert_equal 'FooBar', Elasticsearch::DSL::Utils.__camelize(:foo_bar)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,87 +1,586 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Karel Minarik
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-03-17 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.3'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '1.3'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
|
-
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: elasticsearch
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: elasticsearch-extensions
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: shoulda-context
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: mocha
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '4.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '4.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: minitest-reporters
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: simplecov
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov-rcov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: ci_reporter
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '1.9'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '1.9'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: yard
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: cane
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: pry
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
description: A Ruby DSL builder for Elasticsearch
|
47
210
|
email:
|
48
|
-
- karel.minarik@elasticsearch.
|
211
|
+
- karel.minarik@elasticsearch.com
|
49
212
|
executables: []
|
50
213
|
extensions: []
|
51
|
-
extra_rdoc_files:
|
214
|
+
extra_rdoc_files:
|
215
|
+
- README.md
|
216
|
+
- LICENSE.txt
|
52
217
|
files:
|
53
|
-
- .gitignore
|
218
|
+
- ".gitignore"
|
54
219
|
- Gemfile
|
55
220
|
- LICENSE.txt
|
56
221
|
- README.md
|
57
222
|
- Rakefile
|
58
223
|
- elasticsearch-dsl.gemspec
|
224
|
+
- lib/elasticsearch-dsl.rb
|
59
225
|
- lib/elasticsearch/dsl.rb
|
226
|
+
- lib/elasticsearch/dsl/search.rb
|
227
|
+
- lib/elasticsearch/dsl/search/aggregation.rb
|
228
|
+
- lib/elasticsearch/dsl/search/aggregations/avg.rb
|
229
|
+
- lib/elasticsearch/dsl/search/aggregations/cardinality.rb
|
230
|
+
- lib/elasticsearch/dsl/search/aggregations/children.rb
|
231
|
+
- lib/elasticsearch/dsl/search/aggregations/date_histogram.rb
|
232
|
+
- lib/elasticsearch/dsl/search/aggregations/date_range.rb
|
233
|
+
- lib/elasticsearch/dsl/search/aggregations/extended_stats.rb
|
234
|
+
- lib/elasticsearch/dsl/search/aggregations/filter.rb
|
235
|
+
- lib/elasticsearch/dsl/search/aggregations/filters.rb
|
236
|
+
- lib/elasticsearch/dsl/search/aggregations/geo_bounds.rb
|
237
|
+
- lib/elasticsearch/dsl/search/aggregations/geo_distance.rb
|
238
|
+
- lib/elasticsearch/dsl/search/aggregations/geohash_grid.rb
|
239
|
+
- lib/elasticsearch/dsl/search/aggregations/global.rb
|
240
|
+
- lib/elasticsearch/dsl/search/aggregations/histogram.rb
|
241
|
+
- lib/elasticsearch/dsl/search/aggregations/ip_range.rb
|
242
|
+
- lib/elasticsearch/dsl/search/aggregations/max.rb
|
243
|
+
- lib/elasticsearch/dsl/search/aggregations/min.rb
|
244
|
+
- lib/elasticsearch/dsl/search/aggregations/nested.rb
|
245
|
+
- lib/elasticsearch/dsl/search/aggregations/percentile_ranks.rb
|
246
|
+
- lib/elasticsearch/dsl/search/aggregations/percentiles.rb
|
247
|
+
- lib/elasticsearch/dsl/search/aggregations/range.rb
|
248
|
+
- lib/elasticsearch/dsl/search/aggregations/reverse_nested.rb
|
249
|
+
- lib/elasticsearch/dsl/search/aggregations/scripted_metric.rb
|
250
|
+
- lib/elasticsearch/dsl/search/aggregations/significant_terms.rb
|
251
|
+
- lib/elasticsearch/dsl/search/aggregations/stats.rb
|
252
|
+
- lib/elasticsearch/dsl/search/aggregations/sum.rb
|
253
|
+
- lib/elasticsearch/dsl/search/aggregations/terms.rb
|
254
|
+
- lib/elasticsearch/dsl/search/aggregations/top_hits.rb
|
255
|
+
- lib/elasticsearch/dsl/search/aggregations/value_count.rb
|
256
|
+
- lib/elasticsearch/dsl/search/base_aggregation_component.rb
|
257
|
+
- lib/elasticsearch/dsl/search/base_component.rb
|
258
|
+
- lib/elasticsearch/dsl/search/base_compound_filter_component.rb
|
259
|
+
- lib/elasticsearch/dsl/search/filter.rb
|
260
|
+
- lib/elasticsearch/dsl/search/filters/and.rb
|
261
|
+
- lib/elasticsearch/dsl/search/filters/bool.rb
|
262
|
+
- lib/elasticsearch/dsl/search/filters/exists.rb
|
263
|
+
- lib/elasticsearch/dsl/search/filters/geo_bounding_box.rb
|
264
|
+
- lib/elasticsearch/dsl/search/filters/geo_distance.rb
|
265
|
+
- lib/elasticsearch/dsl/search/filters/geo_distance_range.rb
|
266
|
+
- lib/elasticsearch/dsl/search/filters/geo_polygon.rb
|
267
|
+
- lib/elasticsearch/dsl/search/filters/geo_shape.rb
|
268
|
+
- lib/elasticsearch/dsl/search/filters/geohash_cell.rb
|
269
|
+
- lib/elasticsearch/dsl/search/filters/has_child.rb
|
270
|
+
- lib/elasticsearch/dsl/search/filters/has_parent.rb
|
271
|
+
- lib/elasticsearch/dsl/search/filters/ids.rb
|
272
|
+
- lib/elasticsearch/dsl/search/filters/indices.rb
|
273
|
+
- lib/elasticsearch/dsl/search/filters/limit.rb
|
274
|
+
- lib/elasticsearch/dsl/search/filters/match_all.rb
|
275
|
+
- lib/elasticsearch/dsl/search/filters/missing.rb
|
276
|
+
- lib/elasticsearch/dsl/search/filters/nested.rb
|
277
|
+
- lib/elasticsearch/dsl/search/filters/not.rb
|
278
|
+
- lib/elasticsearch/dsl/search/filters/or.rb
|
279
|
+
- lib/elasticsearch/dsl/search/filters/prefix.rb
|
280
|
+
- lib/elasticsearch/dsl/search/filters/query.rb
|
281
|
+
- lib/elasticsearch/dsl/search/filters/range.rb
|
282
|
+
- lib/elasticsearch/dsl/search/filters/regexp.rb
|
283
|
+
- lib/elasticsearch/dsl/search/filters/script.rb
|
284
|
+
- lib/elasticsearch/dsl/search/filters/term.rb
|
285
|
+
- lib/elasticsearch/dsl/search/filters/terms.rb
|
286
|
+
- lib/elasticsearch/dsl/search/filters/type.rb
|
287
|
+
- lib/elasticsearch/dsl/search/highlight.rb
|
288
|
+
- lib/elasticsearch/dsl/search/options.rb
|
289
|
+
- lib/elasticsearch/dsl/search/queries/bool.rb
|
290
|
+
- lib/elasticsearch/dsl/search/queries/boosting.rb
|
291
|
+
- lib/elasticsearch/dsl/search/queries/common.rb
|
292
|
+
- lib/elasticsearch/dsl/search/queries/constant_score.rb
|
293
|
+
- lib/elasticsearch/dsl/search/queries/dis_max.rb
|
294
|
+
- lib/elasticsearch/dsl/search/queries/filtered.rb
|
295
|
+
- lib/elasticsearch/dsl/search/queries/function_score.rb
|
296
|
+
- lib/elasticsearch/dsl/search/queries/fuzzy.rb
|
297
|
+
- lib/elasticsearch/dsl/search/queries/fuzzy_like_this.rb
|
298
|
+
- lib/elasticsearch/dsl/search/queries/fuzzy_like_this_field.rb
|
299
|
+
- lib/elasticsearch/dsl/search/queries/geo_shape.rb
|
300
|
+
- lib/elasticsearch/dsl/search/queries/has_child.rb
|
301
|
+
- lib/elasticsearch/dsl/search/queries/has_parent.rb
|
302
|
+
- lib/elasticsearch/dsl/search/queries/ids.rb
|
303
|
+
- lib/elasticsearch/dsl/search/queries/indices.rb
|
304
|
+
- lib/elasticsearch/dsl/search/queries/match.rb
|
305
|
+
- lib/elasticsearch/dsl/search/queries/match_all.rb
|
306
|
+
- lib/elasticsearch/dsl/search/queries/more_like_this.rb
|
307
|
+
- lib/elasticsearch/dsl/search/queries/multi_match.rb
|
308
|
+
- lib/elasticsearch/dsl/search/queries/nested.rb
|
309
|
+
- lib/elasticsearch/dsl/search/queries/prefix.rb
|
310
|
+
- lib/elasticsearch/dsl/search/queries/query_string.rb
|
311
|
+
- lib/elasticsearch/dsl/search/queries/range.rb
|
312
|
+
- lib/elasticsearch/dsl/search/queries/regexp.rb
|
313
|
+
- lib/elasticsearch/dsl/search/queries/simple_query_string.rb
|
314
|
+
- lib/elasticsearch/dsl/search/queries/span_first.rb
|
315
|
+
- lib/elasticsearch/dsl/search/queries/span_multi.rb
|
316
|
+
- lib/elasticsearch/dsl/search/queries/span_near.rb
|
317
|
+
- lib/elasticsearch/dsl/search/queries/span_not.rb
|
318
|
+
- lib/elasticsearch/dsl/search/queries/span_or.rb
|
319
|
+
- lib/elasticsearch/dsl/search/queries/span_term.rb
|
320
|
+
- lib/elasticsearch/dsl/search/queries/template.rb
|
321
|
+
- lib/elasticsearch/dsl/search/queries/term.rb
|
322
|
+
- lib/elasticsearch/dsl/search/queries/terms.rb
|
323
|
+
- lib/elasticsearch/dsl/search/queries/top_children.rb
|
324
|
+
- lib/elasticsearch/dsl/search/queries/wildcard.rb
|
325
|
+
- lib/elasticsearch/dsl/search/query.rb
|
326
|
+
- lib/elasticsearch/dsl/search/sort.rb
|
327
|
+
- lib/elasticsearch/dsl/search/suggest.rb
|
328
|
+
- lib/elasticsearch/dsl/utils.rb
|
60
329
|
- lib/elasticsearch/dsl/version.rb
|
61
|
-
|
330
|
+
- test/integration/search_aggregation_children_test.rb
|
331
|
+
- test/integration/search_aggregation_geo_test.rb
|
332
|
+
- test/integration/search_aggregation_nested_test.rb
|
333
|
+
- test/integration/search_aggregations_test.rb
|
334
|
+
- test/integration/search_filters_test.rb
|
335
|
+
- test/integration/search_options_test.rb
|
336
|
+
- test/integration/search_query_test.rb
|
337
|
+
- test/integration/search_size_from_test.rb
|
338
|
+
- test/integration/search_sort_test.rb
|
339
|
+
- test/integration/search_suggest_test.rb
|
340
|
+
- test/test_helper.rb
|
341
|
+
- test/unit/aggregations/avg_test.rb
|
342
|
+
- test/unit/aggregations/cardinality_test.rb
|
343
|
+
- test/unit/aggregations/children_test.rb
|
344
|
+
- test/unit/aggregations/date_histogram_test.rb
|
345
|
+
- test/unit/aggregations/date_range_test.rb
|
346
|
+
- test/unit/aggregations/extended_stats_test.rb
|
347
|
+
- test/unit/aggregations/filter_test.rb
|
348
|
+
- test/unit/aggregations/filters_test.rb
|
349
|
+
- test/unit/aggregations/geo_bounds_test.rb
|
350
|
+
- test/unit/aggregations/geo_distance_test.rb
|
351
|
+
- test/unit/aggregations/geohash_grid_test.rb
|
352
|
+
- test/unit/aggregations/global_test.rb
|
353
|
+
- test/unit/aggregations/histogram_test.rb
|
354
|
+
- test/unit/aggregations/ip_range_test.rb
|
355
|
+
- test/unit/aggregations/max_test.rb
|
356
|
+
- test/unit/aggregations/min_test.rb
|
357
|
+
- test/unit/aggregations/nested_test.rb
|
358
|
+
- test/unit/aggregations/percentile_ranks_test.rb
|
359
|
+
- test/unit/aggregations/percentiles_test.rb
|
360
|
+
- test/unit/aggregations/range_test.rb
|
361
|
+
- test/unit/aggregations/reverse_nested_test.rb
|
362
|
+
- test/unit/aggregations/scripted_metric_test.rb
|
363
|
+
- test/unit/aggregations/significant_terms_test.rb
|
364
|
+
- test/unit/aggregations/stats_test.rb
|
365
|
+
- test/unit/aggregations/sum_test.rb
|
366
|
+
- test/unit/aggregations/terms_test.rb
|
367
|
+
- test/unit/aggregations/top_hits_test.rb
|
368
|
+
- test/unit/aggregations/value_count_test.rb
|
369
|
+
- test/unit/dsl_test.rb
|
370
|
+
- test/unit/filters/and_test.rb
|
371
|
+
- test/unit/filters/bool_test.rb
|
372
|
+
- test/unit/filters/exists_test.rb
|
373
|
+
- test/unit/filters/geo_bounding_box_test.rb
|
374
|
+
- test/unit/filters/geo_distance_range_test.rb
|
375
|
+
- test/unit/filters/geo_distance_test.rb
|
376
|
+
- test/unit/filters/geo_polygon_test.rb
|
377
|
+
- test/unit/filters/geo_shape_test.rb
|
378
|
+
- test/unit/filters/geohash_cell_test.rb
|
379
|
+
- test/unit/filters/has_child_test.rb
|
380
|
+
- test/unit/filters/has_parent_test.rb
|
381
|
+
- test/unit/filters/ids_test.rb
|
382
|
+
- test/unit/filters/indices_test.rb
|
383
|
+
- test/unit/filters/limit_test.rb
|
384
|
+
- test/unit/filters/match_all_test.rb
|
385
|
+
- test/unit/filters/missing_test.rb
|
386
|
+
- test/unit/filters/nested_test.rb
|
387
|
+
- test/unit/filters/not_test.rb
|
388
|
+
- test/unit/filters/or_test.rb
|
389
|
+
- test/unit/filters/prefix_test.rb
|
390
|
+
- test/unit/filters/query_test.rb
|
391
|
+
- test/unit/filters/range_test.rb
|
392
|
+
- test/unit/filters/regexp_test.rb
|
393
|
+
- test/unit/filters/script_test.rb
|
394
|
+
- test/unit/filters/term_test.rb
|
395
|
+
- test/unit/filters/terms_test.rb
|
396
|
+
- test/unit/filters/type_test.rb
|
397
|
+
- test/unit/queries/bool_test.rb
|
398
|
+
- test/unit/queries/boosting_test.rb
|
399
|
+
- test/unit/queries/common_test.rb
|
400
|
+
- test/unit/queries/constant_score_test.rb
|
401
|
+
- test/unit/queries/dis_max_test.rb
|
402
|
+
- test/unit/queries/filtered_test.rb
|
403
|
+
- test/unit/queries/function_score_test.rb
|
404
|
+
- test/unit/queries/fuzzy_like_this_field_test.rb
|
405
|
+
- test/unit/queries/fuzzy_like_this_test.rb
|
406
|
+
- test/unit/queries/fuzzy_test.rb
|
407
|
+
- test/unit/queries/geo_shape_test.rb
|
408
|
+
- test/unit/queries/has_child_test.rb
|
409
|
+
- test/unit/queries/has_parent_test.rb
|
410
|
+
- test/unit/queries/ids_test.rb
|
411
|
+
- test/unit/queries/indices_test.rb
|
412
|
+
- test/unit/queries/match_all_test.rb
|
413
|
+
- test/unit/queries/match_test.rb
|
414
|
+
- test/unit/queries/more_like_this_test.rb
|
415
|
+
- test/unit/queries/multi_match_test.rb
|
416
|
+
- test/unit/queries/nested_test.rb
|
417
|
+
- test/unit/queries/prefix_test.rb
|
418
|
+
- test/unit/queries/query_string_test.rb
|
419
|
+
- test/unit/queries/range_test.rb
|
420
|
+
- test/unit/queries/regexp_test.rb
|
421
|
+
- test/unit/queries/simple_query_string_test.rb
|
422
|
+
- test/unit/queries/span_first_test.rb
|
423
|
+
- test/unit/queries/span_multi_test.rb
|
424
|
+
- test/unit/queries/span_near_test.rb
|
425
|
+
- test/unit/queries/span_not_test.rb
|
426
|
+
- test/unit/queries/span_or_test.rb
|
427
|
+
- test/unit/queries/span_term_test.rb
|
428
|
+
- test/unit/queries/template_test.rb
|
429
|
+
- test/unit/queries/term_test.rb
|
430
|
+
- test/unit/queries/terms_test.rb
|
431
|
+
- test/unit/queries/top_children_test.rb
|
432
|
+
- test/unit/queries/wildcard_test.rb
|
433
|
+
- test/unit/search_aggregation_test.rb
|
434
|
+
- test/unit/search_base_aggregation_component_test.rb
|
435
|
+
- test/unit/search_base_component_test.rb
|
436
|
+
- test/unit/search_filter_test.rb
|
437
|
+
- test/unit/search_highlight_test.rb
|
438
|
+
- test/unit/search_options_test.rb
|
439
|
+
- test/unit/search_query_test.rb
|
440
|
+
- test/unit/search_size_from_test.rb
|
441
|
+
- test/unit/search_sort_test.rb
|
442
|
+
- test/unit/search_suggest_test.rb
|
443
|
+
- test/unit/search_test.rb
|
444
|
+
- test/unit/utils_test.rb
|
445
|
+
homepage: https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-dsl
|
62
446
|
licenses:
|
63
447
|
- Apache 2
|
448
|
+
metadata: {}
|
64
449
|
post_install_message:
|
65
|
-
rdoc_options:
|
450
|
+
rdoc_options:
|
451
|
+
- "--charset=UTF-8"
|
66
452
|
require_paths:
|
67
453
|
- lib
|
68
454
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
-
none: false
|
70
455
|
requirements:
|
71
|
-
- -
|
456
|
+
- - ">="
|
72
457
|
- !ruby/object:Gem::Version
|
73
458
|
version: '0'
|
74
459
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
-
none: false
|
76
460
|
requirements:
|
77
|
-
- -
|
461
|
+
- - ">="
|
78
462
|
- !ruby/object:Gem::Version
|
79
463
|
version: '0'
|
80
464
|
requirements: []
|
81
465
|
rubyforge_project:
|
82
|
-
rubygems_version:
|
466
|
+
rubygems_version: 2.2.2
|
83
467
|
signing_key:
|
84
|
-
specification_version:
|
85
|
-
summary:
|
86
|
-
test_files:
|
468
|
+
specification_version: 4
|
469
|
+
summary: A Ruby DSL builder for Elasticsearch
|
470
|
+
test_files:
|
471
|
+
- test/integration/search_aggregation_children_test.rb
|
472
|
+
- test/integration/search_aggregation_geo_test.rb
|
473
|
+
- test/integration/search_aggregation_nested_test.rb
|
474
|
+
- test/integration/search_aggregations_test.rb
|
475
|
+
- test/integration/search_filters_test.rb
|
476
|
+
- test/integration/search_options_test.rb
|
477
|
+
- test/integration/search_query_test.rb
|
478
|
+
- test/integration/search_size_from_test.rb
|
479
|
+
- test/integration/search_sort_test.rb
|
480
|
+
- test/integration/search_suggest_test.rb
|
481
|
+
- test/test_helper.rb
|
482
|
+
- test/unit/aggregations/avg_test.rb
|
483
|
+
- test/unit/aggregations/cardinality_test.rb
|
484
|
+
- test/unit/aggregations/children_test.rb
|
485
|
+
- test/unit/aggregations/date_histogram_test.rb
|
486
|
+
- test/unit/aggregations/date_range_test.rb
|
487
|
+
- test/unit/aggregations/extended_stats_test.rb
|
488
|
+
- test/unit/aggregations/filter_test.rb
|
489
|
+
- test/unit/aggregations/filters_test.rb
|
490
|
+
- test/unit/aggregations/geo_bounds_test.rb
|
491
|
+
- test/unit/aggregations/geo_distance_test.rb
|
492
|
+
- test/unit/aggregations/geohash_grid_test.rb
|
493
|
+
- test/unit/aggregations/global_test.rb
|
494
|
+
- test/unit/aggregations/histogram_test.rb
|
495
|
+
- test/unit/aggregations/ip_range_test.rb
|
496
|
+
- test/unit/aggregations/max_test.rb
|
497
|
+
- test/unit/aggregations/min_test.rb
|
498
|
+
- test/unit/aggregations/nested_test.rb
|
499
|
+
- test/unit/aggregations/percentile_ranks_test.rb
|
500
|
+
- test/unit/aggregations/percentiles_test.rb
|
501
|
+
- test/unit/aggregations/range_test.rb
|
502
|
+
- test/unit/aggregations/reverse_nested_test.rb
|
503
|
+
- test/unit/aggregations/scripted_metric_test.rb
|
504
|
+
- test/unit/aggregations/significant_terms_test.rb
|
505
|
+
- test/unit/aggregations/stats_test.rb
|
506
|
+
- test/unit/aggregations/sum_test.rb
|
507
|
+
- test/unit/aggregations/terms_test.rb
|
508
|
+
- test/unit/aggregations/top_hits_test.rb
|
509
|
+
- test/unit/aggregations/value_count_test.rb
|
510
|
+
- test/unit/dsl_test.rb
|
511
|
+
- test/unit/filters/and_test.rb
|
512
|
+
- test/unit/filters/bool_test.rb
|
513
|
+
- test/unit/filters/exists_test.rb
|
514
|
+
- test/unit/filters/geo_bounding_box_test.rb
|
515
|
+
- test/unit/filters/geo_distance_range_test.rb
|
516
|
+
- test/unit/filters/geo_distance_test.rb
|
517
|
+
- test/unit/filters/geo_polygon_test.rb
|
518
|
+
- test/unit/filters/geo_shape_test.rb
|
519
|
+
- test/unit/filters/geohash_cell_test.rb
|
520
|
+
- test/unit/filters/has_child_test.rb
|
521
|
+
- test/unit/filters/has_parent_test.rb
|
522
|
+
- test/unit/filters/ids_test.rb
|
523
|
+
- test/unit/filters/indices_test.rb
|
524
|
+
- test/unit/filters/limit_test.rb
|
525
|
+
- test/unit/filters/match_all_test.rb
|
526
|
+
- test/unit/filters/missing_test.rb
|
527
|
+
- test/unit/filters/nested_test.rb
|
528
|
+
- test/unit/filters/not_test.rb
|
529
|
+
- test/unit/filters/or_test.rb
|
530
|
+
- test/unit/filters/prefix_test.rb
|
531
|
+
- test/unit/filters/query_test.rb
|
532
|
+
- test/unit/filters/range_test.rb
|
533
|
+
- test/unit/filters/regexp_test.rb
|
534
|
+
- test/unit/filters/script_test.rb
|
535
|
+
- test/unit/filters/term_test.rb
|
536
|
+
- test/unit/filters/terms_test.rb
|
537
|
+
- test/unit/filters/type_test.rb
|
538
|
+
- test/unit/queries/bool_test.rb
|
539
|
+
- test/unit/queries/boosting_test.rb
|
540
|
+
- test/unit/queries/common_test.rb
|
541
|
+
- test/unit/queries/constant_score_test.rb
|
542
|
+
- test/unit/queries/dis_max_test.rb
|
543
|
+
- test/unit/queries/filtered_test.rb
|
544
|
+
- test/unit/queries/function_score_test.rb
|
545
|
+
- test/unit/queries/fuzzy_like_this_field_test.rb
|
546
|
+
- test/unit/queries/fuzzy_like_this_test.rb
|
547
|
+
- test/unit/queries/fuzzy_test.rb
|
548
|
+
- test/unit/queries/geo_shape_test.rb
|
549
|
+
- test/unit/queries/has_child_test.rb
|
550
|
+
- test/unit/queries/has_parent_test.rb
|
551
|
+
- test/unit/queries/ids_test.rb
|
552
|
+
- test/unit/queries/indices_test.rb
|
553
|
+
- test/unit/queries/match_all_test.rb
|
554
|
+
- test/unit/queries/match_test.rb
|
555
|
+
- test/unit/queries/more_like_this_test.rb
|
556
|
+
- test/unit/queries/multi_match_test.rb
|
557
|
+
- test/unit/queries/nested_test.rb
|
558
|
+
- test/unit/queries/prefix_test.rb
|
559
|
+
- test/unit/queries/query_string_test.rb
|
560
|
+
- test/unit/queries/range_test.rb
|
561
|
+
- test/unit/queries/regexp_test.rb
|
562
|
+
- test/unit/queries/simple_query_string_test.rb
|
563
|
+
- test/unit/queries/span_first_test.rb
|
564
|
+
- test/unit/queries/span_multi_test.rb
|
565
|
+
- test/unit/queries/span_near_test.rb
|
566
|
+
- test/unit/queries/span_not_test.rb
|
567
|
+
- test/unit/queries/span_or_test.rb
|
568
|
+
- test/unit/queries/span_term_test.rb
|
569
|
+
- test/unit/queries/template_test.rb
|
570
|
+
- test/unit/queries/term_test.rb
|
571
|
+
- test/unit/queries/terms_test.rb
|
572
|
+
- test/unit/queries/top_children_test.rb
|
573
|
+
- test/unit/queries/wildcard_test.rb
|
574
|
+
- test/unit/search_aggregation_test.rb
|
575
|
+
- test/unit/search_base_aggregation_component_test.rb
|
576
|
+
- test/unit/search_base_component_test.rb
|
577
|
+
- test/unit/search_filter_test.rb
|
578
|
+
- test/unit/search_highlight_test.rb
|
579
|
+
- test/unit/search_options_test.rb
|
580
|
+
- test/unit/search_query_test.rb
|
581
|
+
- test/unit/search_size_from_test.rb
|
582
|
+
- test/unit/search_sort_test.rb
|
583
|
+
- test/unit/search_suggest_test.rb
|
584
|
+
- test/unit/search_test.rb
|
585
|
+
- test/unit/utils_test.rb
|
87
586
|
has_rdoc:
|