elasticsearch-dsl 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -16
- data/README.md +51 -18
- data/Rakefile +4 -17
- data/elasticsearch-dsl.gemspec +3 -16
- data/lib/elasticsearch-dsl.rb +3 -16
- data/lib/elasticsearch/dsl.rb +4 -16
- data/lib/elasticsearch/dsl/search.rb +27 -17
- data/lib/elasticsearch/dsl/search/aggregation.rb +6 -17
- data/lib/elasticsearch/dsl/search/aggregations/avg.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/cardinality.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/children.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/composite.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/date_histogram.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/date_range.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/extended_stats.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/filter.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/filters.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/geo_bounds.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/geo_distance.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/geohash_grid.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/global.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/histogram.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/ip_range.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/max.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/min.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/missing.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/nested.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/percentile_ranks.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/percentiles.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/avg_bucket.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/bucket_script.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/bucket_selector.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/bucket_sort.rb +93 -0
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/cumulative_sum.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/derivative.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/extended_stats_bucket.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/max_bucket.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/min_bucket.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/moving_avg.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/percentiles_bucket.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/serial_diff.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/stats_bucket.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/pipeline/sum_bucket.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/range.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/reverse_nested.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/scripted_metric.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/significant_terms.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/significant_text.rb +49 -0
- data/lib/elasticsearch/dsl/search/aggregations/stats.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/sum.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/terms.rb +3 -16
- data/lib/elasticsearch/dsl/search/aggregations/top_hits.rb +4 -17
- data/lib/elasticsearch/dsl/search/aggregations/value_count.rb +4 -17
- data/lib/elasticsearch/dsl/search/base_aggregation_component.rb +6 -17
- data/lib/elasticsearch/dsl/search/base_component.rb +16 -17
- data/lib/elasticsearch/dsl/search/base_compound_filter_component.rb +6 -17
- data/lib/elasticsearch/dsl/search/collapse.rb +82 -0
- data/lib/elasticsearch/dsl/search/filter.rb +6 -17
- data/lib/elasticsearch/dsl/search/filters/and.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/bool.rb +3 -16
- data/lib/elasticsearch/dsl/search/filters/exists.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/geo_bounding_box.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/geo_distance.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/geo_distance_range.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/geo_polygon.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/geo_shape.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/geohash_cell.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/has_child.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/has_parent.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/ids.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/indices.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/limit.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/match_all.rb +3 -16
- data/lib/elasticsearch/dsl/search/filters/missing.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/nested.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/not.rb +7 -18
- data/lib/elasticsearch/dsl/search/filters/or.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/prefix.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/query.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/range.rb +3 -16
- data/lib/elasticsearch/dsl/search/filters/regexp.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/script.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/term.rb +3 -16
- data/lib/elasticsearch/dsl/search/filters/terms.rb +4 -17
- data/lib/elasticsearch/dsl/search/filters/type.rb +4 -17
- data/lib/elasticsearch/dsl/search/highlight.rb +3 -16
- data/lib/elasticsearch/dsl/search/options.rb +5 -17
- data/lib/elasticsearch/dsl/search/queries/bool.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/boosting.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/common.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/constant_score.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/dis_max.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/exists.rb +3 -16
- data/lib/elasticsearch/dsl/search/queries/filtered.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/function_score.rb +5 -17
- data/lib/elasticsearch/dsl/search/queries/fuzzy.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/fuzzy_like_this.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/fuzzy_like_this_field.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/geo_shape.rb +3 -16
- data/lib/elasticsearch/dsl/search/queries/has_child.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/has_parent.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/ids.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/indices.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/inner_hits.rb +120 -0
- data/lib/elasticsearch/dsl/search/queries/match.rb +3 -16
- data/lib/elasticsearch/dsl/search/queries/match_all.rb +3 -16
- data/lib/elasticsearch/dsl/search/queries/match_phrase.rb +3 -16
- data/lib/elasticsearch/dsl/search/queries/match_phrase_prefix.rb +3 -16
- data/lib/elasticsearch/dsl/search/queries/more_like_this.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/multi_match.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/nested.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/prefix.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/query_string.rb +3 -16
- data/lib/elasticsearch/dsl/search/queries/range.rb +3 -16
- data/lib/elasticsearch/dsl/search/queries/regexp.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/simple_query_string.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/span_first.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/span_multi.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/span_near.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/span_not.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/span_or.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/span_term.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/template.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/term.rb +3 -16
- data/lib/elasticsearch/dsl/search/queries/terms.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/top_children.rb +4 -17
- data/lib/elasticsearch/dsl/search/queries/wildcard.rb +4 -17
- data/lib/elasticsearch/dsl/search/query.rb +6 -17
- data/lib/elasticsearch/dsl/search/sort.rb +3 -16
- data/lib/elasticsearch/dsl/search/suggest.rb +3 -16
- data/lib/elasticsearch/dsl/utils.rb +3 -16
- data/lib/elasticsearch/dsl/version.rb +4 -17
- data/spec/elasticsearch/dsl/search/aggregations/avg_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/cardinality_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/children_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/composite_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/date_histogram_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/date_range_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/extended_stats_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/filter_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/filters_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/geo_bounds_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/geo_distance_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/geo_grid_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/global_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/historgram_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/ip_range_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/max_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/min_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/missing_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/nested_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/percentile_ranks_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/percentiles_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/avg_bucket_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/bucket_script_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/bucket_selector_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/bucket_sort_spec.rb +91 -0
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/cumulative_sum_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/derivative_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/extended_stats_bucket_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/max_bucket_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/min_bucket_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/moving_avg_test_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/percentiles_bucket_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/serial_diff_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/stats_bucket_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/pipeline/sum_bucket_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/range_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/reverse_nested_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/scripted_metric_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/significant_terms_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/significant_text_spec.rb +163 -0
- data/spec/elasticsearch/dsl/search/aggregations/stats_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/sum_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/terms_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/top_hits_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/aggregations/value_count_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/collapse_spec.rb +80 -0
- data/spec/elasticsearch/dsl/search/filters/and_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/bool_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/exists_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/geo_bounding_box_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/geo_distance_range_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/geo_distance_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/geo_polygon_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/geo_shape_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/geohash_cell_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/has_child_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/has_parent_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/ids_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/indices_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/limit_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/match_all_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/missing_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/nested_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/not_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/or_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/prefix_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/query_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/range_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/regexp_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/script_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/term_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/terms_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/filters/type_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/bool_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/boosting_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/common_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/constant_score_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/dis_max_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/exists_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/filtered_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/function_score_spec.rb +14 -16
- data/spec/elasticsearch/dsl/search/queries/fuzzy_like_this_field_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/fuzzy_like_this_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/fuzzy_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/geo_shape_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/has_child_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/has_parent_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/ids_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/indices_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/inner_hits_spec.rb +131 -0
- data/spec/elasticsearch/dsl/search/queries/match_all_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/match_phrase_prefix_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/match_phrase_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/{mach_spec.rb → match_spec.rb} +3 -16
- data/spec/elasticsearch/dsl/search/queries/more_like_this_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/multi_match_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/nested_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/prefix_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/query_string_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/range_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/regexp_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/simple_query_string_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/span_first_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/span_multi_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/span_near_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/span_not_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/span_or_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/span_term_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/template_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/term_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/terms_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/top_children_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search/queries/wildcard_spec.rb +3 -16
- data/spec/elasticsearch/dsl/search_spec.rb +372 -0
- data/spec/spec_helper.rb +3 -16
- data/test/integration/search_aggregation_children_test.rb +3 -16
- data/test/integration/search_aggregation_geo_test.rb +3 -16
- data/test/integration/search_aggregation_nested_test.rb +3 -16
- data/test/integration/search_aggregations_test.rb +3 -16
- data/test/integration/search_filters_test.rb +3 -16
- data/test/integration/search_options_test.rb +3 -16
- data/test/integration/search_query_test.rb +3 -16
- data/test/integration/search_size_from_test.rb +3 -16
- data/test/integration/search_sort_test.rb +3 -16
- data/test/integration/search_suggest_test.rb +3 -16
- data/test/integration/search_test.rb +3 -16
- data/test/test_helper.rb +3 -16
- data/test/unit/dsl_test.rb +3 -16
- data/test/unit/search_aggregation_test.rb +3 -16
- data/test/unit/search_base_aggregation_component_test.rb +3 -16
- data/test/unit/search_base_component_test.rb +3 -16
- data/test/unit/search_filter_test.rb +3 -16
- data/test/unit/search_highlight_test.rb +3 -16
- data/test/unit/search_options_test.rb +11 -16
- data/test/unit/search_query_test.rb +3 -16
- data/test/unit/search_size_from_test.rb +3 -16
- data/test/unit/search_sort_test.rb +3 -16
- data/test/unit/search_suggest_test.rb +3 -16
- data/test/unit/search_test.rb +10 -16
- data/test/unit/utils_test.rb +3 -16
- metadata +19 -5
@@ -1,19 +1,6 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V
|
2
|
-
#
|
3
|
-
#
|
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.
|
1
|
+
# Licensed to Elasticsearch B.V under one or more agreements.
|
2
|
+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
3
|
+
# See the LICENSE file in the project root for more information
|
17
4
|
|
18
5
|
require 'test_helper'
|
19
6
|
|
@@ -77,6 +64,14 @@ module Elasticsearch
|
|
77
64
|
assert_equal( { version: true }, subject.to_hash )
|
78
65
|
end
|
79
66
|
|
67
|
+
should "encode track_total_hits" do
|
68
|
+
subject.track_total_hits 123
|
69
|
+
assert_equal( { track_total_hits: 123 }, subject.to_hash )
|
70
|
+
|
71
|
+
subject.track_total_hits true
|
72
|
+
assert_equal( { track_total_hits: true }, subject.to_hash )
|
73
|
+
end
|
74
|
+
|
80
75
|
should "encode indices_boost" do
|
81
76
|
subject.indices_boost foo: 'bar'
|
82
77
|
assert_equal( { indices_boost: { foo: 'bar' } }, subject.to_hash )
|
@@ -1,19 +1,6 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V
|
2
|
-
#
|
3
|
-
#
|
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.
|
1
|
+
# Licensed to Elasticsearch B.V under one or more agreements.
|
2
|
+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
3
|
+
# See the LICENSE file in the project root for more information
|
17
4
|
|
18
5
|
require 'test_helper'
|
19
6
|
|
@@ -1,19 +1,6 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V
|
2
|
-
#
|
3
|
-
#
|
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.
|
1
|
+
# Licensed to Elasticsearch B.V under one or more agreements.
|
2
|
+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
3
|
+
# See the LICENSE file in the project root for more information
|
17
4
|
|
18
5
|
require 'test_helper'
|
19
6
|
|
@@ -1,19 +1,6 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V
|
2
|
-
#
|
3
|
-
#
|
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.
|
1
|
+
# Licensed to Elasticsearch B.V under one or more agreements.
|
2
|
+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
3
|
+
# See the LICENSE file in the project root for more information
|
17
4
|
|
18
5
|
require 'test_helper'
|
19
6
|
|
@@ -1,19 +1,6 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V
|
2
|
-
#
|
3
|
-
#
|
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.
|
1
|
+
# Licensed to Elasticsearch B.V under one or more agreements.
|
2
|
+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
3
|
+
# See the LICENSE file in the project root for more information
|
17
4
|
|
18
5
|
require 'test_helper'
|
19
6
|
|
data/test/unit/search_test.rb
CHANGED
@@ -1,19 +1,6 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V
|
2
|
-
#
|
3
|
-
#
|
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.
|
1
|
+
# Licensed to Elasticsearch B.V under one or more agreements.
|
2
|
+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
3
|
+
# See the LICENSE file in the project root for more information
|
17
4
|
|
18
5
|
require 'test_helper'
|
19
6
|
|
@@ -213,6 +200,13 @@ module Elasticsearch
|
|
213
200
|
subject.sort :foo
|
214
201
|
assert_instance_of Elasticsearch::DSL::Search::Sort, subject.sort
|
215
202
|
end
|
203
|
+
|
204
|
+
should "have a setter method" do
|
205
|
+
sort_object = Elasticsearch::DSL::Search::Sort.new foo: { order: 'desc' }, bar: { order: 'asc' }
|
206
|
+
subject.sort = sort_object
|
207
|
+
assert_not_nil subject.sort
|
208
|
+
assert_equal( { sort: [ { foo: { order: "desc" }, bar: { order: "asc" } } ] }, subject.to_hash )
|
209
|
+
end
|
216
210
|
end
|
217
211
|
|
218
212
|
context "with suggest" do
|
data/test/unit/utils_test.rb
CHANGED
@@ -1,19 +1,6 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V
|
2
|
-
#
|
3
|
-
#
|
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.
|
1
|
+
# Licensed to Elasticsearch B.V under one or more agreements.
|
2
|
+
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
3
|
+
# See the LICENSE file in the project root for more information
|
17
4
|
|
18
5
|
require 'test_helper'
|
19
6
|
|
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.
|
4
|
+
version: 0.1.9
|
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-
|
11
|
+
date: 2019-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -235,6 +235,7 @@ files:
|
|
235
235
|
- lib/elasticsearch/dsl/search/aggregations/pipeline/avg_bucket.rb
|
236
236
|
- lib/elasticsearch/dsl/search/aggregations/pipeline/bucket_script.rb
|
237
237
|
- lib/elasticsearch/dsl/search/aggregations/pipeline/bucket_selector.rb
|
238
|
+
- lib/elasticsearch/dsl/search/aggregations/pipeline/bucket_sort.rb
|
238
239
|
- lib/elasticsearch/dsl/search/aggregations/pipeline/cumulative_sum.rb
|
239
240
|
- lib/elasticsearch/dsl/search/aggregations/pipeline/derivative.rb
|
240
241
|
- lib/elasticsearch/dsl/search/aggregations/pipeline/extended_stats_bucket.rb
|
@@ -249,6 +250,7 @@ files:
|
|
249
250
|
- lib/elasticsearch/dsl/search/aggregations/reverse_nested.rb
|
250
251
|
- lib/elasticsearch/dsl/search/aggregations/scripted_metric.rb
|
251
252
|
- lib/elasticsearch/dsl/search/aggregations/significant_terms.rb
|
253
|
+
- lib/elasticsearch/dsl/search/aggregations/significant_text.rb
|
252
254
|
- lib/elasticsearch/dsl/search/aggregations/stats.rb
|
253
255
|
- lib/elasticsearch/dsl/search/aggregations/sum.rb
|
254
256
|
- lib/elasticsearch/dsl/search/aggregations/terms.rb
|
@@ -257,6 +259,7 @@ files:
|
|
257
259
|
- lib/elasticsearch/dsl/search/base_aggregation_component.rb
|
258
260
|
- lib/elasticsearch/dsl/search/base_component.rb
|
259
261
|
- lib/elasticsearch/dsl/search/base_compound_filter_component.rb
|
262
|
+
- lib/elasticsearch/dsl/search/collapse.rb
|
260
263
|
- lib/elasticsearch/dsl/search/filter.rb
|
261
264
|
- lib/elasticsearch/dsl/search/filters/and.rb
|
262
265
|
- lib/elasticsearch/dsl/search/filters/bool.rb
|
@@ -303,6 +306,7 @@ files:
|
|
303
306
|
- lib/elasticsearch/dsl/search/queries/has_parent.rb
|
304
307
|
- lib/elasticsearch/dsl/search/queries/ids.rb
|
305
308
|
- lib/elasticsearch/dsl/search/queries/indices.rb
|
309
|
+
- lib/elasticsearch/dsl/search/queries/inner_hits.rb
|
306
310
|
- lib/elasticsearch/dsl/search/queries/match.rb
|
307
311
|
- lib/elasticsearch/dsl/search/queries/match_all.rb
|
308
312
|
- lib/elasticsearch/dsl/search/queries/match_phrase.rb
|
@@ -355,6 +359,7 @@ files:
|
|
355
359
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/avg_bucket_spec.rb
|
356
360
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/bucket_script_spec.rb
|
357
361
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/bucket_selector_spec.rb
|
362
|
+
- spec/elasticsearch/dsl/search/aggregations/pipeline/bucket_sort_spec.rb
|
358
363
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/cumulative_sum_spec.rb
|
359
364
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/derivative_spec.rb
|
360
365
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/extended_stats_bucket_spec.rb
|
@@ -369,11 +374,13 @@ files:
|
|
369
374
|
- spec/elasticsearch/dsl/search/aggregations/reverse_nested_spec.rb
|
370
375
|
- spec/elasticsearch/dsl/search/aggregations/scripted_metric_spec.rb
|
371
376
|
- spec/elasticsearch/dsl/search/aggregations/significant_terms_spec.rb
|
377
|
+
- spec/elasticsearch/dsl/search/aggregations/significant_text_spec.rb
|
372
378
|
- spec/elasticsearch/dsl/search/aggregations/stats_spec.rb
|
373
379
|
- spec/elasticsearch/dsl/search/aggregations/sum_spec.rb
|
374
380
|
- spec/elasticsearch/dsl/search/aggregations/terms_spec.rb
|
375
381
|
- spec/elasticsearch/dsl/search/aggregations/top_hits_spec.rb
|
376
382
|
- spec/elasticsearch/dsl/search/aggregations/value_count_spec.rb
|
383
|
+
- spec/elasticsearch/dsl/search/collapse_spec.rb
|
377
384
|
- spec/elasticsearch/dsl/search/filters/and_spec.rb
|
378
385
|
- spec/elasticsearch/dsl/search/filters/bool_spec.rb
|
379
386
|
- spec/elasticsearch/dsl/search/filters/exists_spec.rb
|
@@ -417,10 +424,11 @@ files:
|
|
417
424
|
- spec/elasticsearch/dsl/search/queries/has_parent_spec.rb
|
418
425
|
- spec/elasticsearch/dsl/search/queries/ids_spec.rb
|
419
426
|
- spec/elasticsearch/dsl/search/queries/indices_spec.rb
|
420
|
-
- spec/elasticsearch/dsl/search/queries/
|
427
|
+
- spec/elasticsearch/dsl/search/queries/inner_hits_spec.rb
|
421
428
|
- spec/elasticsearch/dsl/search/queries/match_all_spec.rb
|
422
429
|
- spec/elasticsearch/dsl/search/queries/match_phrase_prefix_spec.rb
|
423
430
|
- spec/elasticsearch/dsl/search/queries/match_phrase_spec.rb
|
431
|
+
- spec/elasticsearch/dsl/search/queries/match_spec.rb
|
424
432
|
- spec/elasticsearch/dsl/search/queries/more_like_this_spec.rb
|
425
433
|
- spec/elasticsearch/dsl/search/queries/multi_match_spec.rb
|
426
434
|
- spec/elasticsearch/dsl/search/queries/nested_spec.rb
|
@@ -440,6 +448,7 @@ files:
|
|
440
448
|
- spec/elasticsearch/dsl/search/queries/terms_spec.rb
|
441
449
|
- spec/elasticsearch/dsl/search/queries/top_children_spec.rb
|
442
450
|
- spec/elasticsearch/dsl/search/queries/wildcard_spec.rb
|
451
|
+
- spec/elasticsearch/dsl/search_spec.rb
|
443
452
|
- spec/spec_helper.rb
|
444
453
|
- test/integration/search_aggregation_children_test.rb
|
445
454
|
- test/integration/search_aggregation_geo_test.rb
|
@@ -486,7 +495,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
486
495
|
- !ruby/object:Gem::Version
|
487
496
|
version: '0'
|
488
497
|
requirements: []
|
489
|
-
rubygems_version: 3.0.
|
498
|
+
rubygems_version: 3.0.6
|
490
499
|
signing_key:
|
491
500
|
specification_version: 4
|
492
501
|
summary: A Ruby DSL builder for Elasticsearch
|
@@ -515,6 +524,7 @@ test_files:
|
|
515
524
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/avg_bucket_spec.rb
|
516
525
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/bucket_script_spec.rb
|
517
526
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/bucket_selector_spec.rb
|
527
|
+
- spec/elasticsearch/dsl/search/aggregations/pipeline/bucket_sort_spec.rb
|
518
528
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/cumulative_sum_spec.rb
|
519
529
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/derivative_spec.rb
|
520
530
|
- spec/elasticsearch/dsl/search/aggregations/pipeline/extended_stats_bucket_spec.rb
|
@@ -529,11 +539,13 @@ test_files:
|
|
529
539
|
- spec/elasticsearch/dsl/search/aggregations/reverse_nested_spec.rb
|
530
540
|
- spec/elasticsearch/dsl/search/aggregations/scripted_metric_spec.rb
|
531
541
|
- spec/elasticsearch/dsl/search/aggregations/significant_terms_spec.rb
|
542
|
+
- spec/elasticsearch/dsl/search/aggregations/significant_text_spec.rb
|
532
543
|
- spec/elasticsearch/dsl/search/aggregations/stats_spec.rb
|
533
544
|
- spec/elasticsearch/dsl/search/aggregations/sum_spec.rb
|
534
545
|
- spec/elasticsearch/dsl/search/aggregations/terms_spec.rb
|
535
546
|
- spec/elasticsearch/dsl/search/aggregations/top_hits_spec.rb
|
536
547
|
- spec/elasticsearch/dsl/search/aggregations/value_count_spec.rb
|
548
|
+
- spec/elasticsearch/dsl/search/collapse_spec.rb
|
537
549
|
- spec/elasticsearch/dsl/search/filters/and_spec.rb
|
538
550
|
- spec/elasticsearch/dsl/search/filters/bool_spec.rb
|
539
551
|
- spec/elasticsearch/dsl/search/filters/exists_spec.rb
|
@@ -577,10 +589,11 @@ test_files:
|
|
577
589
|
- spec/elasticsearch/dsl/search/queries/has_parent_spec.rb
|
578
590
|
- spec/elasticsearch/dsl/search/queries/ids_spec.rb
|
579
591
|
- spec/elasticsearch/dsl/search/queries/indices_spec.rb
|
580
|
-
- spec/elasticsearch/dsl/search/queries/
|
592
|
+
- spec/elasticsearch/dsl/search/queries/inner_hits_spec.rb
|
581
593
|
- spec/elasticsearch/dsl/search/queries/match_all_spec.rb
|
582
594
|
- spec/elasticsearch/dsl/search/queries/match_phrase_prefix_spec.rb
|
583
595
|
- spec/elasticsearch/dsl/search/queries/match_phrase_spec.rb
|
596
|
+
- spec/elasticsearch/dsl/search/queries/match_spec.rb
|
584
597
|
- spec/elasticsearch/dsl/search/queries/more_like_this_spec.rb
|
585
598
|
- spec/elasticsearch/dsl/search/queries/multi_match_spec.rb
|
586
599
|
- spec/elasticsearch/dsl/search/queries/nested_spec.rb
|
@@ -600,6 +613,7 @@ test_files:
|
|
600
613
|
- spec/elasticsearch/dsl/search/queries/terms_spec.rb
|
601
614
|
- spec/elasticsearch/dsl/search/queries/top_children_spec.rb
|
602
615
|
- spec/elasticsearch/dsl/search/queries/wildcard_spec.rb
|
616
|
+
- spec/elasticsearch/dsl/search_spec.rb
|
603
617
|
- spec/spec_helper.rb
|
604
618
|
- test/integration/search_aggregation_children_test.rb
|
605
619
|
- test/integration/search_aggregation_geo_test.rb
|