opensearch-dsl 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/.gitignore +17 -0
- data/Gemfile +51 -0
- data/LICENSE +202 -0
- data/README.md +149 -0
- data/Rakefile +234 -0
- data/lib/opensearch/dsl/search/aggregation.rb +110 -0
- data/lib/opensearch/dsl/search/aggregations/avg.rb +51 -0
- data/lib/opensearch/dsl/search/aggregations/cardinality.rb +58 -0
- data/lib/opensearch/dsl/search/aggregations/children.rb +65 -0
- data/lib/opensearch/dsl/search/aggregations/composite.rb +68 -0
- data/lib/opensearch/dsl/search/aggregations/date_histogram.rb +66 -0
- data/lib/opensearch/dsl/search/aggregations/date_range.rb +60 -0
- data/lib/opensearch/dsl/search/aggregations/extended_stats.rb +50 -0
- data/lib/opensearch/dsl/search/aggregations/filter.rb +56 -0
- data/lib/opensearch/dsl/search/aggregations/filters.rb +61 -0
- data/lib/opensearch/dsl/search/aggregations/geo_bounds.rb +70 -0
- data/lib/opensearch/dsl/search/aggregations/geo_distance.rb +65 -0
- data/lib/opensearch/dsl/search/aggregations/geohash_grid.rb +61 -0
- data/lib/opensearch/dsl/search/aggregations/global.rb +54 -0
- data/lib/opensearch/dsl/search/aggregations/histogram.rb +61 -0
- data/lib/opensearch/dsl/search/aggregations/ip_range.rb +57 -0
- data/lib/opensearch/dsl/search/aggregations/max.rb +51 -0
- data/lib/opensearch/dsl/search/aggregations/min.rb +51 -0
- data/lib/opensearch/dsl/search/aggregations/missing.rb +61 -0
- data/lib/opensearch/dsl/search/aggregations/nested.rb +59 -0
- data/lib/opensearch/dsl/search/aggregations/percentile_ranks.rb +60 -0
- data/lib/opensearch/dsl/search/aggregations/percentiles.rb +59 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/avg_bucket.rb +59 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/bucket_script.rb +61 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/bucket_selector.rb +60 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/bucket_sort.rb +114 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/cumulative_sum.rb +58 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/derivative.rb +59 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/extended_stats_bucket.rb +59 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/max_bucket.rb +59 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/min_bucket.rb +59 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/moving_avg.rb +67 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/percentiles_bucket.rb +61 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/serial_diff.rb +61 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/stats_bucket.rb +59 -0
- data/lib/opensearch/dsl/search/aggregations/pipeline/sum_bucket.rb +59 -0
- data/lib/opensearch/dsl/search/aggregations/range.rb +79 -0
- data/lib/opensearch/dsl/search/aggregations/reverse_nested.rb +63 -0
- data/lib/opensearch/dsl/search/aggregations/scripted_metric.rb +65 -0
- data/lib/opensearch/dsl/search/aggregations/significant_terms.rb +71 -0
- data/lib/opensearch/dsl/search/aggregations/stats.rb +63 -0
- data/lib/opensearch/dsl/search/aggregations/sum.rb +51 -0
- data/lib/opensearch/dsl/search/aggregations/terms.rb +68 -0
- data/lib/opensearch/dsl/search/aggregations/top_hits.rb +61 -0
- data/lib/opensearch/dsl/search/aggregations/value_count.rb +51 -0
- data/lib/opensearch/dsl/search/base_aggregation_component.rb +90 -0
- data/lib/opensearch/dsl/search/base_component.rb +193 -0
- data/lib/opensearch/dsl/search/base_compound_filter_component.rb +123 -0
- data/lib/opensearch/dsl/search/filter.rb +81 -0
- data/lib/opensearch/dsl/search/filters/and.rb +71 -0
- data/lib/opensearch/dsl/search/filters/bool.rb +105 -0
- data/lib/opensearch/dsl/search/filters/exists.rb +58 -0
- data/lib/opensearch/dsl/search/filters/geo_bounding_box.rb +71 -0
- data/lib/opensearch/dsl/search/filters/geo_distance.rb +83 -0
- data/lib/opensearch/dsl/search/filters/geo_distance_range.rb +58 -0
- data/lib/opensearch/dsl/search/filters/geo_polygon.rb +67 -0
- data/lib/opensearch/dsl/search/filters/geo_shape.rb +61 -0
- data/lib/opensearch/dsl/search/filters/geohash_cell.rb +72 -0
- data/lib/opensearch/dsl/search/filters/has_child.rb +100 -0
- data/lib/opensearch/dsl/search/filters/has_parent.rb +99 -0
- data/lib/opensearch/dsl/search/filters/ids.rb +58 -0
- data/lib/opensearch/dsl/search/filters/indices.rb +103 -0
- data/lib/opensearch/dsl/search/filters/limit.rb +57 -0
- data/lib/opensearch/dsl/search/filters/match_all.rb +54 -0
- data/lib/opensearch/dsl/search/filters/missing.rb +60 -0
- data/lib/opensearch/dsl/search/filters/nested.rb +93 -0
- data/lib/opensearch/dsl/search/filters/not.rb +99 -0
- data/lib/opensearch/dsl/search/filters/or.rb +71 -0
- data/lib/opensearch/dsl/search/filters/prefix.rb +55 -0
- data/lib/opensearch/dsl/search/filters/query.rb +80 -0
- data/lib/opensearch/dsl/search/filters/range.rb +65 -0
- data/lib/opensearch/dsl/search/filters/regexp.rb +60 -0
- data/lib/opensearch/dsl/search/filters/script.rb +58 -0
- data/lib/opensearch/dsl/search/filters/term.rb +57 -0
- data/lib/opensearch/dsl/search/filters/terms.rb +58 -0
- data/lib/opensearch/dsl/search/filters/type.rb +60 -0
- data/lib/opensearch/dsl/search/highlight.rb +117 -0
- data/lib/opensearch/dsl/search/options.rb +81 -0
- data/lib/opensearch/dsl/search/queries/bool.rb +111 -0
- data/lib/opensearch/dsl/search/queries/boosting.rb +59 -0
- data/lib/opensearch/dsl/search/queries/common.rb +64 -0
- data/lib/opensearch/dsl/search/queries/constant_score.rb +92 -0
- data/lib/opensearch/dsl/search/queries/dis_max.rb +61 -0
- data/lib/opensearch/dsl/search/queries/exists.rb +69 -0
- data/lib/opensearch/dsl/search/queries/filtered.rb +103 -0
- data/lib/opensearch/dsl/search/queries/function_score.rb +128 -0
- data/lib/opensearch/dsl/search/queries/fuzzy.rb +71 -0
- data/lib/opensearch/dsl/search/queries/fuzzy_like_this.rb +63 -0
- data/lib/opensearch/dsl/search/queries/fuzzy_like_this_field.rb +62 -0
- data/lib/opensearch/dsl/search/queries/geo_shape.rb +56 -0
- data/lib/opensearch/dsl/search/queries/has_child.rb +84 -0
- data/lib/opensearch/dsl/search/queries/has_parent.rb +84 -0
- data/lib/opensearch/dsl/search/queries/ids.rb +54 -0
- data/lib/opensearch/dsl/search/queries/indices.rb +60 -0
- data/lib/opensearch/dsl/search/queries/match.rb +69 -0
- data/lib/opensearch/dsl/search/queries/match_all.rb +52 -0
- data/lib/opensearch/dsl/search/queries/match_phrase.rb +58 -0
- data/lib/opensearch/dsl/search/queries/match_phrase_prefix.rb +57 -0
- data/lib/opensearch/dsl/search/queries/more_like_this.rb +90 -0
- data/lib/opensearch/dsl/search/queries/multi_match.rb +71 -0
- data/lib/opensearch/dsl/search/queries/nested.rb +82 -0
- data/lib/opensearch/dsl/search/queries/prefix.rb +56 -0
- data/lib/opensearch/dsl/search/queries/query_string.rb +77 -0
- data/lib/opensearch/dsl/search/queries/range.rb +73 -0
- data/lib/opensearch/dsl/search/queries/regexp.rb +57 -0
- data/lib/opensearch/dsl/search/queries/simple_query_string.rb +66 -0
- data/lib/opensearch/dsl/search/queries/span_first.rb +54 -0
- data/lib/opensearch/dsl/search/queries/span_multi.rb +54 -0
- data/lib/opensearch/dsl/search/queries/span_near.rb +58 -0
- data/lib/opensearch/dsl/search/queries/span_not.rb +59 -0
- data/lib/opensearch/dsl/search/queries/span_or.rb +54 -0
- data/lib/opensearch/dsl/search/queries/span_term.rb +52 -0
- data/lib/opensearch/dsl/search/queries/template.rb +57 -0
- data/lib/opensearch/dsl/search/queries/term.rb +52 -0
- data/lib/opensearch/dsl/search/queries/terms.rb +53 -0
- data/lib/opensearch/dsl/search/queries/top_children.rb +84 -0
- data/lib/opensearch/dsl/search/queries/wildcard.rb +56 -0
- data/lib/opensearch/dsl/search/query.rb +80 -0
- data/lib/opensearch/dsl/search/sort.rb +84 -0
- data/lib/opensearch/dsl/search/suggest.rb +53 -0
- data/lib/opensearch/dsl/search.rb +288 -0
- data/lib/opensearch/dsl/utils.rb +51 -0
- data/lib/opensearch/dsl/version.rb +31 -0
- data/lib/opensearch/dsl.rb +72 -0
- data/lib/opensearch-dsl.rb +27 -0
- data/opensearch-dsl.gemspec +81 -0
- data/spec/opensearch/dsl/search/aggregations/avg_spec.rb +52 -0
- data/spec/opensearch/dsl/search/aggregations/cardinality_spec.rb +119 -0
- data/spec/opensearch/dsl/search/aggregations/children_spec.rb +75 -0
- data/spec/opensearch/dsl/search/aggregations/composite_spec.rb +108 -0
- data/spec/opensearch/dsl/search/aggregations/date_histogram_spec.rb +198 -0
- data/spec/opensearch/dsl/search/aggregations/date_range_spec.rb +98 -0
- data/spec/opensearch/dsl/search/aggregations/extended_stats_spec.rb +52 -0
- data/spec/opensearch/dsl/search/aggregations/filter_spec.rb +57 -0
- data/spec/opensearch/dsl/search/aggregations/filters_spec.rb +98 -0
- data/spec/opensearch/dsl/search/aggregations/geo_bounds_spec.rb +86 -0
- data/spec/opensearch/dsl/search/aggregations/geo_distance_spec.rb +122 -0
- data/spec/opensearch/dsl/search/aggregations/geo_grid_spec.rb +109 -0
- data/spec/opensearch/dsl/search/aggregations/global_spec.rb +71 -0
- data/spec/opensearch/dsl/search/aggregations/historgram_spec.rb +131 -0
- data/spec/opensearch/dsl/search/aggregations/ip_range_spec.rb +102 -0
- data/spec/opensearch/dsl/search/aggregations/max_spec.rb +52 -0
- data/spec/opensearch/dsl/search/aggregations/min_spec.rb +52 -0
- data/spec/opensearch/dsl/search/aggregations/missing_spec.rb +90 -0
- data/spec/opensearch/dsl/search/aggregations/nested_spec.rb +95 -0
- data/spec/opensearch/dsl/search/aggregations/percentile_ranks_spec.rb +135 -0
- data/spec/opensearch/dsl/search/aggregations/percentiles_spec.rb +134 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/avg_bucket_spec.rb +97 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/bucket_script_spec.rb +108 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/bucket_selector_spec.rb +97 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/bucket_sort_spec.rb +113 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/cumulative_sum_spec.rb +86 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/derivative_spec.rb +97 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/extended_stats_bucket_spec.rb +97 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/max_bucket_spec.rb +97 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/min_bucket_spec.rb +97 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/moving_avg_test_spec.rb +141 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/percentiles_bucket_spec.rb +108 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/serial_diff_spec.rb +108 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/stats_bucket_spec.rb +97 -0
- data/spec/opensearch/dsl/search/aggregations/pipeline/sum_bucket_spec.rb +97 -0
- data/spec/opensearch/dsl/search/aggregations/range_spec.rb +128 -0
- data/spec/opensearch/dsl/search/aggregations/reverse_nested_spec.rb +41 -0
- data/spec/opensearch/dsl/search/aggregations/scripted_metric_spec.rb +130 -0
- data/spec/opensearch/dsl/search/aggregations/significant_terms_spec.rb +185 -0
- data/spec/opensearch/dsl/search/aggregations/stats_spec.rb +65 -0
- data/spec/opensearch/dsl/search/aggregations/sum_spec.rb +52 -0
- data/spec/opensearch/dsl/search/aggregations/terms_spec.rb +174 -0
- data/spec/opensearch/dsl/search/aggregations/top_hits_spec.rb +97 -0
- data/spec/opensearch/dsl/search/aggregations/value_count_spec.rb +52 -0
- data/spec/opensearch/dsl/search/filters/and_spec.rb +83 -0
- data/spec/opensearch/dsl/search/filters/bool_spec.rb +208 -0
- data/spec/opensearch/dsl/search/filters/exists_spec.rb +75 -0
- data/spec/opensearch/dsl/search/filters/geo_bounding_box_spec.rb +153 -0
- data/spec/opensearch/dsl/search/filters/geo_distance_range_spec.rb +112 -0
- data/spec/opensearch/dsl/search/filters/geo_distance_spec.rb +135 -0
- data/spec/opensearch/dsl/search/filters/geo_polygon_spec.rb +75 -0
- data/spec/opensearch/dsl/search/filters/geo_shape_spec.rb +86 -0
- data/spec/opensearch/dsl/search/filters/geohash_cell_spec.rb +108 -0
- data/spec/opensearch/dsl/search/filters/has_child_spec.rb +148 -0
- data/spec/opensearch/dsl/search/filters/has_parent_spec.rb +137 -0
- data/spec/opensearch/dsl/search/filters/ids_spec.rb +87 -0
- data/spec/opensearch/dsl/search/filters/indices_spec.rb +118 -0
- data/spec/opensearch/dsl/search/filters/limit_spec.rb +75 -0
- data/spec/opensearch/dsl/search/filters/match_all_spec.rb +41 -0
- data/spec/opensearch/dsl/search/filters/missing_spec.rb +75 -0
- data/spec/opensearch/dsl/search/filters/nested_spec.rb +100 -0
- data/spec/opensearch/dsl/search/filters/not_spec.rb +68 -0
- data/spec/opensearch/dsl/search/filters/or_spec.rb +84 -0
- data/spec/opensearch/dsl/search/filters/prefix_spec.rb +55 -0
- data/spec/opensearch/dsl/search/filters/query_spec.rb +68 -0
- data/spec/opensearch/dsl/search/filters/range_spec.rb +120 -0
- data/spec/opensearch/dsl/search/filters/regexp_spec.rb +97 -0
- data/spec/opensearch/dsl/search/filters/script_spec.rb +86 -0
- data/spec/opensearch/dsl/search/filters/term_spec.rb +66 -0
- data/spec/opensearch/dsl/search/filters/terms_spec.rb +55 -0
- data/spec/opensearch/dsl/search/filters/type_spec.rb +75 -0
- data/spec/opensearch/dsl/search/queries/bool_spec.rb +276 -0
- data/spec/opensearch/dsl/search/queries/boosting_spec.rb +99 -0
- data/spec/opensearch/dsl/search/queries/common_spec.rb +141 -0
- data/spec/opensearch/dsl/search/queries/constant_score_spec.rb +99 -0
- data/spec/opensearch/dsl/search/queries/dis_max_spec.rb +97 -0
- data/spec/opensearch/dsl/search/queries/exists_spec.rb +75 -0
- data/spec/opensearch/dsl/search/queries/filtered_spec.rb +102 -0
- data/spec/opensearch/dsl/search/queries/function_score_spec.rb +173 -0
- data/spec/opensearch/dsl/search/queries/fuzzy_like_this_field_spec.rb +141 -0
- data/spec/opensearch/dsl/search/queries/fuzzy_like_this_spec.rb +143 -0
- data/spec/opensearch/dsl/search/queries/fuzzy_spec.rb +119 -0
- data/spec/opensearch/dsl/search/queries/geo_shape_spec.rb +86 -0
- data/spec/opensearch/dsl/search/queries/has_child_spec.rb +135 -0
- data/spec/opensearch/dsl/search/queries/has_parent_spec.rb +109 -0
- data/spec/opensearch/dsl/search/queries/ids_spec.rb +87 -0
- data/spec/opensearch/dsl/search/queries/indices_spec.rb +98 -0
- data/spec/opensearch/dsl/search/queries/match_all_spec.rb +75 -0
- data/spec/opensearch/dsl/search/queries/match_phrase_prefix_spec.rb +112 -0
- data/spec/opensearch/dsl/search/queries/match_phrase_spec.rb +123 -0
- data/spec/opensearch/dsl/search/queries/match_spec.rb +116 -0
- data/spec/opensearch/dsl/search/queries/more_like_this_spec.rb +96 -0
- data/spec/opensearch/dsl/search/queries/multi_match_spec.rb +83 -0
- data/spec/opensearch/dsl/search/queries/nested_spec.rb +107 -0
- data/spec/opensearch/dsl/search/queries/prefix_spec.rb +79 -0
- data/spec/opensearch/dsl/search/queries/query_string_spec.rb +98 -0
- data/spec/opensearch/dsl/search/queries/range_spec.rb +87 -0
- data/spec/opensearch/dsl/search/queries/regexp_spec.rb +91 -0
- data/spec/opensearch/dsl/search/queries/simple_query_string_spec.rb +83 -0
- data/spec/opensearch/dsl/search/queries/span_first_spec.rb +78 -0
- data/spec/opensearch/dsl/search/queries/span_multi_spec.rb +78 -0
- data/spec/opensearch/dsl/search/queries/span_near_spec.rb +81 -0
- data/spec/opensearch/dsl/search/queries/span_not_spec.rb +82 -0
- data/spec/opensearch/dsl/search/queries/span_or_spec.rb +78 -0
- data/spec/opensearch/dsl/search/queries/span_term_spec.rb +55 -0
- data/spec/opensearch/dsl/search/queries/template_spec.rb +93 -0
- data/spec/opensearch/dsl/search/queries/term_spec.rb +66 -0
- data/spec/opensearch/dsl/search/queries/terms_spec.rb +55 -0
- data/spec/opensearch/dsl/search/queries/top_children_spec.rb +102 -0
- data/spec/opensearch/dsl/search/queries/wildcard_spec.rb +90 -0
- data/spec/spec_helper.rb +33 -0
- data/test/integration/search_aggregation_children_test.rb +91 -0
- data/test/integration/search_aggregation_geo_test.rb +111 -0
- data/test/integration/search_aggregation_nested_test.rb +128 -0
- data/test/integration/search_aggregations_test.rb +287 -0
- data/test/integration/search_filters_test.rb +290 -0
- data/test/integration/search_options_test.rb +54 -0
- data/test/integration/search_query_test.rb +99 -0
- data/test/integration/search_size_from_test.rb +71 -0
- data/test/integration/search_sort_test.rb +58 -0
- data/test/integration/search_suggest_test.rb +103 -0
- data/test/integration/search_test.rb +82 -0
- data/test/test_helper.rb +95 -0
- data/test/unit/dsl_test.rb +44 -0
- data/test/unit/search_aggregation_test.rb +98 -0
- data/test/unit/search_base_aggregation_component_test.rb +67 -0
- data/test/unit/search_base_component_test.rb +212 -0
- data/test/unit/search_filter_test.rb +87 -0
- data/test/unit/search_highlight_test.rb +103 -0
- data/test/unit/search_options_test.rb +114 -0
- data/test/unit/search_query_test.rb +91 -0
- data/test/unit/search_size_from_test.rb +69 -0
- data/test/unit/search_sort_test.rb +91 -0
- data/test/unit/search_suggest_test.rb +46 -0
- data/test/unit/search_test.rb +270 -0
- data/test/unit/utils_test.rb +47 -0
- data.tar.gz.sig +3 -0
- metadata +654 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
#
|
3
|
+
# The OpenSearch Contributors require contributions made to
|
4
|
+
# this file be licensed under the Apache-2.0 license or a
|
5
|
+
# compatible open source license.
|
6
|
+
#
|
7
|
+
# Modifications Copyright OpenSearch Contributors. See
|
8
|
+
# GitHub history for details.
|
9
|
+
#
|
10
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
11
|
+
# license agreements. See the NOTICE file distributed with
|
12
|
+
# this work for additional information regarding copyright
|
13
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
14
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
15
|
+
# not use this file except in compliance with the License.
|
16
|
+
# You may obtain a copy of the License at
|
17
|
+
#
|
18
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
19
|
+
#
|
20
|
+
# Unless required by applicable law or agreed to in writing,
|
21
|
+
# software distributed under the License is distributed on an
|
22
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
23
|
+
# KIND, either express or implied. See the License for the
|
24
|
+
# specific language governing permissions and limitations
|
25
|
+
# under the License.
|
26
|
+
|
27
|
+
module OpenSearch
|
28
|
+
module DSL
|
29
|
+
module Search
|
30
|
+
module Aggregations
|
31
|
+
|
32
|
+
# A single-value metric aggregation which returns the sum of numeric values
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
#
|
36
|
+
# search do
|
37
|
+
# aggregation :sum_clicks do
|
38
|
+
# sum field: 'clicks'
|
39
|
+
# end
|
40
|
+
# end
|
41
|
+
#
|
42
|
+
# @see http://opensearch.org/guide/en/opensearch/reference/current/search-aggregations-metrics-sum-aggregation.html
|
43
|
+
#
|
44
|
+
class Sum
|
45
|
+
include BaseComponent
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
#
|
3
|
+
# The OpenSearch Contributors require contributions made to
|
4
|
+
# this file be licensed under the Apache-2.0 license or a
|
5
|
+
# compatible open source license.
|
6
|
+
#
|
7
|
+
# Modifications Copyright OpenSearch Contributors. See
|
8
|
+
# GitHub history for details.
|
9
|
+
#
|
10
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
11
|
+
# license agreements. See the NOTICE file distributed with
|
12
|
+
# this work for additional information regarding copyright
|
13
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
14
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
15
|
+
# not use this file except in compliance with the License.
|
16
|
+
# You may obtain a copy of the License at
|
17
|
+
#
|
18
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
19
|
+
#
|
20
|
+
# Unless required by applicable law or agreed to in writing,
|
21
|
+
# software distributed under the License is distributed on an
|
22
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
23
|
+
# KIND, either express or implied. See the License for the
|
24
|
+
# specific language governing permissions and limitations
|
25
|
+
# under the License.
|
26
|
+
|
27
|
+
module OpenSearch
|
28
|
+
module DSL
|
29
|
+
module Search
|
30
|
+
module Aggregations
|
31
|
+
|
32
|
+
# A multi-bucket aggregation which returns the collection of terms and their document counts
|
33
|
+
#
|
34
|
+
# @example Passing the options as a Hash
|
35
|
+
#
|
36
|
+
# aggregation :tags do
|
37
|
+
# terms field: 'tags'
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
# @example Passing the options as a block
|
41
|
+
#
|
42
|
+
# search do
|
43
|
+
# aggregation :tags do
|
44
|
+
# terms do
|
45
|
+
# field 'tags'
|
46
|
+
# end
|
47
|
+
# end
|
48
|
+
# end
|
49
|
+
#
|
50
|
+
#
|
51
|
+
class Terms
|
52
|
+
include BaseAggregationComponent
|
53
|
+
|
54
|
+
option_method :field
|
55
|
+
option_method :size
|
56
|
+
option_method :shard_size
|
57
|
+
option_method :order
|
58
|
+
option_method :min_doc_count
|
59
|
+
option_method :shard_min_doc_count
|
60
|
+
option_method :script
|
61
|
+
option_method :include
|
62
|
+
option_method :exclude
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
#
|
3
|
+
# The OpenSearch Contributors require contributions made to
|
4
|
+
# this file be licensed under the Apache-2.0 license or a
|
5
|
+
# compatible open source license.
|
6
|
+
#
|
7
|
+
# Modifications Copyright OpenSearch Contributors. See
|
8
|
+
# GitHub history for details.
|
9
|
+
#
|
10
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
11
|
+
# license agreements. See the NOTICE file distributed with
|
12
|
+
# this work for additional information regarding copyright
|
13
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
14
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
15
|
+
# not use this file except in compliance with the License.
|
16
|
+
# You may obtain a copy of the License at
|
17
|
+
#
|
18
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
19
|
+
#
|
20
|
+
# Unless required by applicable law or agreed to in writing,
|
21
|
+
# software distributed under the License is distributed on an
|
22
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
23
|
+
# KIND, either express or implied. See the License for the
|
24
|
+
# specific language governing permissions and limitations
|
25
|
+
# under the License.
|
26
|
+
|
27
|
+
module OpenSearch
|
28
|
+
module DSL
|
29
|
+
module Search
|
30
|
+
module Aggregations
|
31
|
+
|
32
|
+
# A metric aggregator which returns the most relevant documents per bucket
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
#
|
36
|
+
# search do
|
37
|
+
# aggregation :tags do
|
38
|
+
# terms do
|
39
|
+
# field 'tags'
|
40
|
+
#
|
41
|
+
# aggregation :top_hits do
|
42
|
+
# top_hits sort: [ clicks: { order: 'desc' } ], _source: { include: 'title' }
|
43
|
+
# end
|
44
|
+
# end
|
45
|
+
# end
|
46
|
+
# end
|
47
|
+
#
|
48
|
+
# @see http://opensearch.org/guide/en/opensearch/reference/current/search-aggregations-metrics-top-hits-aggregation.html
|
49
|
+
#
|
50
|
+
class TopHits
|
51
|
+
include BaseComponent
|
52
|
+
|
53
|
+
option_method :from
|
54
|
+
option_method :size
|
55
|
+
option_method :sort
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
#
|
3
|
+
# The OpenSearch Contributors require contributions made to
|
4
|
+
# this file be licensed under the Apache-2.0 license or a
|
5
|
+
# compatible open source license.
|
6
|
+
#
|
7
|
+
# Modifications Copyright OpenSearch Contributors. See
|
8
|
+
# GitHub history for details.
|
9
|
+
#
|
10
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
11
|
+
# license agreements. See the NOTICE file distributed with
|
12
|
+
# this work for additional information regarding copyright
|
13
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
14
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
15
|
+
# not use this file except in compliance with the License.
|
16
|
+
# You may obtain a copy of the License at
|
17
|
+
#
|
18
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
19
|
+
#
|
20
|
+
# Unless required by applicable law or agreed to in writing,
|
21
|
+
# software distributed under the License is distributed on an
|
22
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
23
|
+
# KIND, either express or implied. See the License for the
|
24
|
+
# specific language governing permissions and limitations
|
25
|
+
# under the License.
|
26
|
+
|
27
|
+
module OpenSearch
|
28
|
+
module DSL
|
29
|
+
module Search
|
30
|
+
module Aggregations
|
31
|
+
|
32
|
+
# A single-value metric aggregation which returns the number of values for the aggregation scope
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
#
|
36
|
+
# search do
|
37
|
+
# aggregation :value_count do
|
38
|
+
# value_count field: 'clicks'
|
39
|
+
# end
|
40
|
+
# end
|
41
|
+
#
|
42
|
+
# @see http://opensearch.org/guide/en/opensearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html
|
43
|
+
#
|
44
|
+
class ValueCount
|
45
|
+
include BaseComponent
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
#
|
3
|
+
# The OpenSearch Contributors require contributions made to
|
4
|
+
# this file be licensed under the Apache-2.0 license or a
|
5
|
+
# compatible open source license.
|
6
|
+
#
|
7
|
+
# Modifications Copyright OpenSearch Contributors. See
|
8
|
+
# GitHub history for details.
|
9
|
+
#
|
10
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
11
|
+
# license agreements. See the NOTICE file distributed with
|
12
|
+
# this work for additional information regarding copyright
|
13
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
14
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
15
|
+
# not use this file except in compliance with the License.
|
16
|
+
# You may obtain a copy of the License at
|
17
|
+
#
|
18
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
19
|
+
#
|
20
|
+
# Unless required by applicable law or agreed to in writing,
|
21
|
+
# software distributed under the License is distributed on an
|
22
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
23
|
+
# KIND, either express or implied. See the License for the
|
24
|
+
# specific language governing permissions and limitations
|
25
|
+
# under the License.
|
26
|
+
|
27
|
+
module OpenSearch
|
28
|
+
module DSL
|
29
|
+
module Search
|
30
|
+
|
31
|
+
# Module containing common functionality for aggregation DSL classes
|
32
|
+
#
|
33
|
+
module BaseAggregationComponent
|
34
|
+
|
35
|
+
def self.included(base)
|
36
|
+
base.__send__ :include, BaseComponent
|
37
|
+
base.__send__ :include, InstanceMethods
|
38
|
+
end
|
39
|
+
|
40
|
+
module InstanceMethods
|
41
|
+
|
42
|
+
attr_reader :aggregations
|
43
|
+
|
44
|
+
# Looks up the corresponding class for a method being invoked, and initializes it
|
45
|
+
#
|
46
|
+
# @raise [NoMethodError] When the corresponding class cannot be found
|
47
|
+
#
|
48
|
+
def method_missing(name, *args, &block)
|
49
|
+
klass = Utils.__camelize(name)
|
50
|
+
if Aggregations.const_defined? klass
|
51
|
+
@value = Aggregations.const_get(klass).new *args, &block
|
52
|
+
else
|
53
|
+
raise NoMethodError, "undefined method '#{name}' for #{self}"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Adds a nested aggregation into the aggregation definition
|
58
|
+
#
|
59
|
+
# @return [self]
|
60
|
+
#
|
61
|
+
def aggregation(*args, &block)
|
62
|
+
@aggregations ||= AggregationsCollection.new
|
63
|
+
@aggregations.update args.first => Aggregation.new(*args, &block)
|
64
|
+
self
|
65
|
+
end
|
66
|
+
|
67
|
+
# Convert the aggregations to a Hash
|
68
|
+
#
|
69
|
+
# A default implementation, DSL classes can overload it.
|
70
|
+
#
|
71
|
+
# @return [Hash]
|
72
|
+
#
|
73
|
+
def to_hash(options={})
|
74
|
+
call
|
75
|
+
|
76
|
+
@hash = { name => @args } unless @hash && @hash[name] && ! @hash[name].empty?
|
77
|
+
|
78
|
+
if @aggregations
|
79
|
+
@hash[:aggregations] = @aggregations.to_hash
|
80
|
+
end
|
81
|
+
@hash
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
@@ -0,0 +1,193 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
#
|
3
|
+
# The OpenSearch Contributors require contributions made to
|
4
|
+
# this file be licensed under the Apache-2.0 license or a
|
5
|
+
# compatible open source license.
|
6
|
+
#
|
7
|
+
# Modifications Copyright OpenSearch Contributors. See
|
8
|
+
# GitHub history for details.
|
9
|
+
#
|
10
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
11
|
+
# license agreements. See the NOTICE file distributed with
|
12
|
+
# this work for additional information regarding copyright
|
13
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
14
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
15
|
+
# not use this file except in compliance with the License.
|
16
|
+
# You may obtain a copy of the License at
|
17
|
+
#
|
18
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
19
|
+
#
|
20
|
+
# Unless required by applicable law or agreed to in writing,
|
21
|
+
# software distributed under the License is distributed on an
|
22
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
23
|
+
# KIND, either express or implied. See the License for the
|
24
|
+
# specific language governing permissions and limitations
|
25
|
+
# under the License.
|
26
|
+
|
27
|
+
module OpenSearch
|
28
|
+
module DSL
|
29
|
+
module Search
|
30
|
+
|
31
|
+
# Module containing common functionality for DSL classes
|
32
|
+
#
|
33
|
+
module BaseComponent
|
34
|
+
def self.included(base)
|
35
|
+
base.__send__ :extend, ClassMethods
|
36
|
+
base.__send__ :include, InstanceMethods
|
37
|
+
|
38
|
+
base.instance_eval do
|
39
|
+
# Defines an "inner" method for DSL classes
|
40
|
+
#
|
41
|
+
# @example Define a method `bar` for the MyQuery class which updates the query definition
|
42
|
+
#
|
43
|
+
# class MyQuery
|
44
|
+
# include BaseComponent
|
45
|
+
#
|
46
|
+
# option_method :bar
|
47
|
+
# end
|
48
|
+
#
|
49
|
+
# q = MyQuery.new :foo do
|
50
|
+
# bar 'TEST'
|
51
|
+
# end
|
52
|
+
#
|
53
|
+
# q.to_hash
|
54
|
+
# # => {:myquery=>{:foo=>{:bar=>"TEST"}}}
|
55
|
+
#
|
56
|
+
# @example Define a method `bar` with custom logic for updating the Hash with query definition
|
57
|
+
#
|
58
|
+
# class MyCustomQuery
|
59
|
+
# include BaseComponent
|
60
|
+
#
|
61
|
+
# option_method :bar, lambda { |*args| @hash[self.name.to_sym][@args].update custom: args.pop }
|
62
|
+
# end
|
63
|
+
#
|
64
|
+
# q = MyCustomQuery.new :foo do
|
65
|
+
# bar 'TEST'
|
66
|
+
# end
|
67
|
+
#
|
68
|
+
# q.to_hash
|
69
|
+
# # => {:mycustomquery=>{:foo=>{:custom=>"TEST"}}}
|
70
|
+
#
|
71
|
+
def option_method(name, block=nil)
|
72
|
+
option_methods << name
|
73
|
+
if block
|
74
|
+
self.__send__ :define_method, name, &block
|
75
|
+
else
|
76
|
+
self.__send__ :define_method, name do |*args|
|
77
|
+
# 1. Component has empty @args (ie. no user supplied name or @hash value)
|
78
|
+
if @args && @args.respond_to?(:to_hash) && @args.empty?
|
79
|
+
@hash[self.name.to_sym].update name.to_sym => args.first
|
80
|
+
# 2. Component user-supplied name or @hash value passed in @args
|
81
|
+
else
|
82
|
+
@hash[self.name.to_sym] = { @args => {} } unless @hash[self.name.to_sym][@args]
|
83
|
+
@hash[self.name.to_sym][@args].update name.to_sym => args.first
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def initialize(*args, &block)
|
92
|
+
@hash = { name => {} }
|
93
|
+
@args = args.first || {}
|
94
|
+
@options = args.size > 1 ? args.last : {}
|
95
|
+
@block = block
|
96
|
+
end
|
97
|
+
|
98
|
+
module ClassMethods
|
99
|
+
|
100
|
+
# Get or set the name for the DSL class
|
101
|
+
#
|
102
|
+
# @example Set the index name for the `Article` model and re-evaluate it on each call
|
103
|
+
#
|
104
|
+
# class MyQuery
|
105
|
+
# include BaseComponent
|
106
|
+
# name :my_special_query
|
107
|
+
# end
|
108
|
+
#
|
109
|
+
# MyQuery.name
|
110
|
+
# # => :my_special_query
|
111
|
+
#
|
112
|
+
def name(value=nil)
|
113
|
+
if value
|
114
|
+
@name = value.to_sym
|
115
|
+
else
|
116
|
+
@name ||= begin
|
117
|
+
value = self.to_s.split('::').last
|
118
|
+
value.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
|
119
|
+
value.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
120
|
+
value.tr!("-", "_")
|
121
|
+
value.downcase!
|
122
|
+
value.to_sym
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# Set the name for the DSL class
|
128
|
+
#
|
129
|
+
def name=(value)
|
130
|
+
@name = value.to_sym
|
131
|
+
end
|
132
|
+
|
133
|
+
def option_methods
|
134
|
+
@option_methods ||= []
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
module InstanceMethods
|
139
|
+
|
140
|
+
# Return the name for instance of the DSL class
|
141
|
+
#
|
142
|
+
# @return [String]
|
143
|
+
#
|
144
|
+
def name
|
145
|
+
self.class.name
|
146
|
+
end
|
147
|
+
|
148
|
+
# Evaluates any block passed to the query
|
149
|
+
#
|
150
|
+
# @return [self]
|
151
|
+
#
|
152
|
+
def call
|
153
|
+
@block.arity < 1 ? self.instance_eval(&@block) : @block.call(self) if @block
|
154
|
+
self
|
155
|
+
end
|
156
|
+
|
157
|
+
# Return true when the component definition is empty
|
158
|
+
#
|
159
|
+
def empty?
|
160
|
+
to_hash[name].respond_to?(:empty?) && to_hash[name].empty?
|
161
|
+
end
|
162
|
+
|
163
|
+
# Convert the query definition to a Hash
|
164
|
+
#
|
165
|
+
# A default implementation, DSL classes can overload it.
|
166
|
+
#
|
167
|
+
# @return [Hash]
|
168
|
+
#
|
169
|
+
def to_hash(options={})
|
170
|
+
case
|
171
|
+
# 1. Create hash from the block
|
172
|
+
when @block
|
173
|
+
@hash = (@args && ! @args.empty?) ? { name => { @args => {} } } : { name => {} }
|
174
|
+
call
|
175
|
+
@hash[self.name.to_sym].update @options unless @options.empty?
|
176
|
+
@hash
|
177
|
+
# 2. Hash created with option methods
|
178
|
+
when @hash[self.name.to_sym] && ! @args.is_a?(Hash) && @hash[self.name.to_sym][@args]
|
179
|
+
@hash[self.name.to_sym].update @options unless @options.empty?
|
180
|
+
@hash
|
181
|
+
# 3. Hash passsed as @args
|
182
|
+
when @hash[self.name.to_sym] && @args.respond_to?(:to_hash) && ! @args.empty?
|
183
|
+
{ name => @args.to_hash }
|
184
|
+
# 4. Hash already built
|
185
|
+
else
|
186
|
+
@hash
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
#
|
3
|
+
# The OpenSearch Contributors require contributions made to
|
4
|
+
# this file be licensed under the Apache-2.0 license or a
|
5
|
+
# compatible open source license.
|
6
|
+
#
|
7
|
+
# Modifications Copyright OpenSearch Contributors. See
|
8
|
+
# GitHub history for details.
|
9
|
+
#
|
10
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
11
|
+
# license agreements. See the NOTICE file distributed with
|
12
|
+
# this work for additional information regarding copyright
|
13
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
14
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
15
|
+
# not use this file except in compliance with the License.
|
16
|
+
# You may obtain a copy of the License at
|
17
|
+
#
|
18
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
19
|
+
#
|
20
|
+
# Unless required by applicable law or agreed to in writing,
|
21
|
+
# software distributed under the License is distributed on an
|
22
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
23
|
+
# KIND, either express or implied. See the License for the
|
24
|
+
# specific language governing permissions and limitations
|
25
|
+
# under the License.
|
26
|
+
|
27
|
+
module OpenSearch
|
28
|
+
module DSL
|
29
|
+
module Search
|
30
|
+
|
31
|
+
# Module containing common functionality for a "compound" (wrapping) filters, such as `and`, `or`, `not`
|
32
|
+
#
|
33
|
+
module BaseCompoundFilterComponent
|
34
|
+
include Enumerable
|
35
|
+
|
36
|
+
def initialize(*args, &block)
|
37
|
+
super
|
38
|
+
@value = []
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.included(base)
|
42
|
+
base.__send__ :include, InstanceMethods
|
43
|
+
base.__send__ :include, EnumerableMethods
|
44
|
+
base.__send__ :include, MethodDelegation
|
45
|
+
end
|
46
|
+
|
47
|
+
# Common functionality for the compound filter components
|
48
|
+
#
|
49
|
+
module InstanceMethods
|
50
|
+
# Evaluates the block passed to initializer, ensuring it is called just once
|
51
|
+
#
|
52
|
+
# @return [self]
|
53
|
+
#
|
54
|
+
# @api private
|
55
|
+
#
|
56
|
+
def call
|
57
|
+
@block.arity < 1 ? self.instance_eval(&@block) : @block.call(self) if @block && ! @_block_called
|
58
|
+
@_block_called = true
|
59
|
+
self
|
60
|
+
end
|
61
|
+
|
62
|
+
# Convert the component to a Hash
|
63
|
+
#
|
64
|
+
# A default implementation, DSL classes can overload it.
|
65
|
+
#
|
66
|
+
# @return [Hash]
|
67
|
+
#
|
68
|
+
def to_hash(options={})
|
69
|
+
case
|
70
|
+
when @value.empty? && ! @block
|
71
|
+
@hash = super
|
72
|
+
when @block
|
73
|
+
call
|
74
|
+
@hash = { name.to_sym => @value.map { |i| i.to_hash } }
|
75
|
+
else
|
76
|
+
@hash = { name.to_sym => @value }
|
77
|
+
end
|
78
|
+
@hash
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Implements the {Enumerable} methods
|
83
|
+
#
|
84
|
+
module EnumerableMethods
|
85
|
+
def each(&block)
|
86
|
+
@value.each(&block)
|
87
|
+
end
|
88
|
+
|
89
|
+
def slice(*args)
|
90
|
+
@value.slice(*args)
|
91
|
+
end; alias :[] :slice
|
92
|
+
|
93
|
+
def size
|
94
|
+
@value.size
|
95
|
+
end
|
96
|
+
|
97
|
+
def <<(value)
|
98
|
+
@value << value
|
99
|
+
end
|
100
|
+
|
101
|
+
def empty?
|
102
|
+
@value.empty?
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
module MethodDelegation
|
107
|
+
# Looks up the corresponding class for a method being invoked, and initializes it
|
108
|
+
#
|
109
|
+
# @raise [NoMethodError] When the corresponding class cannot be found
|
110
|
+
#
|
111
|
+
def method_missing(name, *args, &block)
|
112
|
+
klass = Utils.__camelize(name)
|
113
|
+
if Filters.const_defined? klass
|
114
|
+
@value << Filters.const_get(klass).new(*args, &block)
|
115
|
+
else
|
116
|
+
raise NoMethodError, "undefined method '#{name}' for #{self}"
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|