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 'spec_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 'spec_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 'spec_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 'spec_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 'spec_helper'
|
19
6
|
|
@@ -0,0 +1,163 @@
|
|
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
|
4
|
+
|
5
|
+
require 'spec_helper'
|
6
|
+
|
7
|
+
describe Elasticsearch::DSL::Search::Aggregations::SignificantText do
|
8
|
+
|
9
|
+
let(:search) do
|
10
|
+
described_class.new
|
11
|
+
end
|
12
|
+
|
13
|
+
describe '#to_hash' do
|
14
|
+
|
15
|
+
it 'can be converted to a hash' do
|
16
|
+
expect(search.to_hash).to eq(significant_text: {})
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when options methods are called' do
|
21
|
+
|
22
|
+
let(:search) do
|
23
|
+
described_class.new(:foo)
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '#field' do
|
27
|
+
|
28
|
+
before do
|
29
|
+
search.field('bar')
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'applies the option' do
|
33
|
+
expect(search.to_hash[:significant_text][:foo][:field]).to eq('bar')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe '#size' do
|
38
|
+
|
39
|
+
before do
|
40
|
+
search.size('bar')
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'applies the option' do
|
44
|
+
expect(search.to_hash[:significant_text][:foo][:size]).to eq('bar')
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#shard_size' do
|
49
|
+
|
50
|
+
before do
|
51
|
+
search.shard_size('bar')
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'applies the option' do
|
55
|
+
expect(search.to_hash[:significant_text][:foo][:shard_size]).to eq('bar')
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe '#min_doc_count' do
|
60
|
+
|
61
|
+
before do
|
62
|
+
search.min_doc_count('bar')
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'applies the option' do
|
66
|
+
expect(search.to_hash[:significant_text][:foo][:min_doc_count]).to eq('bar')
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe '#shard_min_doc_count' do
|
71
|
+
|
72
|
+
before do
|
73
|
+
search.shard_min_doc_count('bar')
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'applies the option' do
|
77
|
+
expect(search.to_hash[:significant_text][:foo][:shard_min_doc_count]).to eq('bar')
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe '#include' do
|
82
|
+
|
83
|
+
before do
|
84
|
+
search.include('bar')
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'applies the option' do
|
88
|
+
expect(search.to_hash[:significant_text][:foo][:include]).to eq('bar')
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe '#exclude' do
|
93
|
+
|
94
|
+
before do
|
95
|
+
search.exclude('bar')
|
96
|
+
end
|
97
|
+
|
98
|
+
it 'applies the option' do
|
99
|
+
expect(search.to_hash[:significant_text][:foo][:exclude]).to eq('bar')
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe '#background_filter' do
|
104
|
+
|
105
|
+
before do
|
106
|
+
search.background_filter('bar')
|
107
|
+
end
|
108
|
+
|
109
|
+
it 'applies the option' do
|
110
|
+
expect(search.to_hash[:significant_text][:foo][:background_filter]).to eq('bar')
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
describe '#mutual_information' do
|
115
|
+
|
116
|
+
before do
|
117
|
+
search.mutual_information('bar')
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'applies the option' do
|
121
|
+
expect(search.to_hash[:significant_text][:foo][:mutual_information]).to eq('bar')
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
describe '#chi_square' do
|
126
|
+
|
127
|
+
before do
|
128
|
+
search.chi_square('bar')
|
129
|
+
end
|
130
|
+
|
131
|
+
it 'applies the option' do
|
132
|
+
expect(search.to_hash[:significant_text][:foo][:chi_square]).to eq('bar')
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
describe '#gnd' do
|
137
|
+
|
138
|
+
before do
|
139
|
+
search.gnd('bar')
|
140
|
+
end
|
141
|
+
|
142
|
+
it 'applies the option' do
|
143
|
+
expect(search.to_hash[:significant_text][:foo][:gnd]).to eq('bar')
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe '#initialize' do
|
149
|
+
|
150
|
+
context 'when a block is provided' do
|
151
|
+
|
152
|
+
let(:search) do
|
153
|
+
described_class.new do
|
154
|
+
field 'bar'
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
it 'executes the block' do
|
159
|
+
expect(search.to_hash).to eq(significant_text: { field: 'bar' })
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
@@ -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 'spec_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 'spec_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 'spec_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 'spec_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 'spec_helper'
|
19
6
|
|
@@ -0,0 +1,80 @@
|
|
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
|
4
|
+
|
5
|
+
require 'spec_helper'
|
6
|
+
|
7
|
+
describe Elasticsearch::DSL::Search::Collapse do
|
8
|
+
|
9
|
+
include Elasticsearch::DSL
|
10
|
+
|
11
|
+
describe '#initialize' do
|
12
|
+
|
13
|
+
let(:coll) do
|
14
|
+
Elasticsearch::DSL::Search::Collapse.new :user
|
15
|
+
end
|
16
|
+
|
17
|
+
let(:expected_hash) do
|
18
|
+
{ field: :user }
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'sets the field' do
|
22
|
+
expect(coll.to_hash).to eq(expected_hash)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '#max_concurrent_group_searches' do
|
27
|
+
|
28
|
+
let(:coll) do
|
29
|
+
Elasticsearch::DSL::Search::Collapse.new :user do
|
30
|
+
max_concurrent_group_searches 4
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'sets the field' do
|
35
|
+
expect(coll.to_hash[:field]).to eq(:user)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'sets the max_concurrent_group_searches option' do
|
39
|
+
expect(coll.to_hash[:max_concurrent_group_searches]).to eq(4)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe '#inner_hits' do
|
44
|
+
|
45
|
+
let(:coll) do
|
46
|
+
Elasticsearch::DSL::Search::Collapse.new :user do
|
47
|
+
max_concurrent_group_searches 4
|
48
|
+
inner_hits 'last_tweet' do
|
49
|
+
size 10
|
50
|
+
from 5
|
51
|
+
sort do
|
52
|
+
by :date, order: 'desc'
|
53
|
+
by :likes, order: 'asc'
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
let(:inner_hits_hash) do
|
60
|
+
{ name: 'last_tweet',
|
61
|
+
size: 10,
|
62
|
+
from: 5,
|
63
|
+
sort: [ { date: { order: 'desc' } },
|
64
|
+
{ likes: { order: 'asc' } } ]
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'sets the field' do
|
69
|
+
expect(coll.to_hash[:field]).to eq(:user)
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'sets the max_concurrent_group_searches option' do
|
73
|
+
expect(coll.to_hash[:max_concurrent_group_searches]).to eq(4)
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'sets the inner_hits' do
|
77
|
+
expect(coll.to_hash[:inner_hits]).to eq(inner_hits_hash)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|