search_flip 3.1.1 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/lib/search_flip/criteria.rb +19 -29
- data/lib/search_flip/version.rb +1 -1
- data/spec/search_flip/criteria_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 51aeb6ec190e4ee6ff8d291d46e038e55bec7eb2b09cfc5eb410b9f523b75f8a
|
|
4
|
+
data.tar.gz: 89882033f77adf5c29104ae35e5c0ee2fd4d4222111ba98ad76cfb508a92da8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5fd5f110807947f0a1bc9906ced03be0c20a1c79a792321cd472d24b0c50a68e6ed88927f1db087ce64f45fd1544d85a5b434b25365f90f2ef83f9d06a8cb6db
|
|
7
|
+
data.tar.gz: cf8e8c77ec27b895249d39e8498207f4a4484776d9f3aefb79f163f5c9e262c80516e4ff99573e833f83ad1de96659a1b2707c1ae7d2786bd72d5d59631ba00b
|
data/.travis.yml
CHANGED
|
@@ -5,7 +5,7 @@ env:
|
|
|
5
5
|
- ES_IMAGE=elasticsearch:5.4
|
|
6
6
|
- ES_IMAGE=docker.elastic.co/elasticsearch/elasticsearch:6.7.0
|
|
7
7
|
- ES_IMAGE=docker.elastic.co/elasticsearch/elasticsearch:7.0.0
|
|
8
|
-
- ES_IMAGE=docker.elastic.co/elasticsearch/elasticsearch:7.
|
|
8
|
+
- ES_IMAGE=docker.elastic.co/elasticsearch/elasticsearch:7.9.0
|
|
9
9
|
rvm:
|
|
10
10
|
- ruby-2.5.3
|
|
11
11
|
- ruby-2.6.2
|
data/CHANGELOG.md
CHANGED
data/lib/search_flip/criteria.rb
CHANGED
|
@@ -44,35 +44,25 @@ module SearchFlip
|
|
|
44
44
|
other = other.criteria
|
|
45
45
|
|
|
46
46
|
fresh.tap do |criteria|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
criteria.must_not_values = (criteria.must_not_values || []) + other.must_not_values if other.must_not_values
|
|
67
|
-
criteria.filter_values = (criteria.filter_values || []) + other.filter_values if other.filter_values
|
|
68
|
-
criteria.post_must_values = (criteria.post_must_values || []) + other.post_must_values if other.post_must_values
|
|
69
|
-
criteria.post_must_not_values = (criteria.post_must_not_values || []) + other.post_must_not_values if other.post_must_not_values
|
|
70
|
-
criteria.post_filter_values = (criteria.post_filter_values || []) + other.post_filter_values if other.post_filter_values
|
|
71
|
-
|
|
72
|
-
criteria.highlight_values = (criteria.highlight_values || {}).merge(other.highlight_values) if other.highlight_values
|
|
73
|
-
criteria.suggest_values = (criteria.suggest_values || {}).merge(other.suggest_values) if other.suggest_values
|
|
74
|
-
criteria.custom_value = (criteria.custom_value || {}).merge(other.custom_value) if other.custom_value
|
|
75
|
-
criteria.aggregation_values = (criteria.aggregation_values || {}).merge(other.aggregation_values) if other.aggregation_values
|
|
47
|
+
[
|
|
48
|
+
:profile_value, :failsafe_value, :terminate_after_value, :timeout_value, :offset_value,
|
|
49
|
+
:limit_value, :scroll_args, :source_value, :preference_value, :search_type_value,
|
|
50
|
+
:routing_value, :track_total_hits_value, :explain_value
|
|
51
|
+
].each do |name|
|
|
52
|
+
criteria.send(:"#{name}=", other.send(name)) unless other.send(name).nil?
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
[
|
|
56
|
+
:sort_values, :includes_values, :preload_values, :eager_load_values, :must_values,
|
|
57
|
+
:must_not_values, :filter_values, :post_must_values, :post_must_not_values,
|
|
58
|
+
:post_filter_values
|
|
59
|
+
].each do |name|
|
|
60
|
+
criteria.send(:"#{name}=", (criteria.send(name) || []) + other.send(name)) if other.send(name)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
[:highlight_values, :suggest_values, :custom_value, :aggregation_values].each do |name|
|
|
64
|
+
criteria.send(:"#{name}=", (criteria.send(name) || {}).merge(other.send(name))) if other.send(name)
|
|
65
|
+
end
|
|
76
66
|
end
|
|
77
67
|
end
|
|
78
68
|
|
data/lib/search_flip/version.rb
CHANGED
|
@@ -110,6 +110,16 @@ RSpec.describe SearchFlip::Criteria do
|
|
|
110
110
|
|
|
111
111
|
expect(criteria1.merge(criteria2).send(method)).to eq("value2")
|
|
112
112
|
end
|
|
113
|
+
|
|
114
|
+
it "handles false values correctly" do
|
|
115
|
+
criteria1 = SearchFlip::Criteria.new(target: TestIndex)
|
|
116
|
+
criteria1.send("#{method}=", true)
|
|
117
|
+
|
|
118
|
+
criteria2 = SearchFlip::Criteria.new(target: TestIndex)
|
|
119
|
+
criteria2.send("#{method}=", false)
|
|
120
|
+
|
|
121
|
+
expect(criteria1.merge(criteria2).send(method)).to eq(false)
|
|
122
|
+
end
|
|
113
123
|
end
|
|
114
124
|
end
|
|
115
125
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: search_flip
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.1.
|
|
4
|
+
version: 3.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Benjamin Vetter
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-10-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|