chewy 0.1.0 → 0.2.0
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 +5 -13
- data/.travis.yml +3 -2
- data/CHANGELOG.md +28 -2
- data/README.md +156 -7
- data/filters +6 -4
- data/lib/chewy/index.rb +114 -18
- data/lib/chewy/index/actions.rb +117 -14
- data/lib/chewy/index/aliases.rb +21 -0
- data/lib/chewy/query.rb +5 -5
- data/lib/chewy/query/compose.rb +59 -0
- data/lib/chewy/query/criteria.rb +8 -55
- data/lib/chewy/query/{context.rb → filters.rb} +60 -7
- data/lib/chewy/query/loading.rb +1 -1
- data/lib/chewy/query/nodes/has_child.rb +14 -0
- data/lib/chewy/query/nodes/has_parent.rb +14 -0
- data/lib/chewy/query/nodes/has_relation.rb +61 -0
- data/lib/chewy/query/nodes/match_all.rb +11 -0
- data/lib/chewy/railtie.rb +2 -2
- data/lib/chewy/rspec/update_index.rb +1 -0
- data/lib/chewy/type.rb +1 -1
- data/lib/chewy/type/adapter/active_record.rb +28 -12
- data/lib/chewy/type/adapter/object.rb +12 -2
- data/lib/chewy/type/import.rb +60 -20
- data/lib/chewy/type/wrapper.rb +1 -1
- data/lib/chewy/version.rb +1 -1
- data/lib/tasks/chewy.rake +41 -8
- data/spec/chewy/index/actions_spec.rb +282 -2
- data/spec/chewy/index/aliases_spec.rb +50 -0
- data/spec/chewy/index_spec.rb +64 -0
- data/spec/chewy/query/criteria_spec.rb +11 -11
- data/spec/chewy/query/{context_spec.rb → filters_spec.rb} +2 -2
- data/spec/chewy/query/loading_spec.rb +5 -3
- data/spec/chewy/query/nodes/and_spec.rb +1 -1
- data/spec/chewy/query/nodes/bool_spec.rb +1 -1
- data/spec/chewy/query/nodes/equal_spec.rb +1 -1
- data/spec/chewy/query/nodes/exists_spec.rb +1 -1
- data/spec/chewy/query/nodes/has_child_spec.rb +40 -0
- data/spec/chewy/query/nodes/has_parent_spec.rb +40 -0
- data/spec/chewy/query/nodes/match_all_spec.rb +11 -0
- data/spec/chewy/query/nodes/missing_spec.rb +1 -1
- data/spec/chewy/query/nodes/not_spec.rb +1 -1
- data/spec/chewy/query/nodes/or_spec.rb +1 -1
- data/spec/chewy/query/nodes/prefix_spec.rb +1 -1
- data/spec/chewy/query/nodes/query_spec.rb +1 -1
- data/spec/chewy/query/nodes/range_spec.rb +1 -1
- data/spec/chewy/query/nodes/raw_spec.rb +1 -1
- data/spec/chewy/query/nodes/regexp_spec.rb +1 -1
- data/spec/chewy/query/nodes/script_spec.rb +1 -1
- data/spec/chewy/query/pagination_spec.rb +7 -7
- data/spec/chewy/query_spec.rb +60 -0
- data/spec/chewy/type/adapter/active_record_spec.rb +68 -9
- data/spec/chewy/type/adapter/object_spec.rb +18 -0
- data/spec/chewy/type/import_spec.rb +87 -2
- data/spec/spec_helper.rb +1 -0
- metadata +47 -33
data/spec/chewy/query_spec.rb
CHANGED
@@ -164,4 +164,64 @@ describe Chewy::Query do
|
|
164
164
|
specify { subject.filter { name == 'name' }.merge(query.filter { age == 42 }).criteria.filters
|
165
165
|
.should == [{term: {'name' => 'name'}}, {term: {'age' => 42}}] }
|
166
166
|
end
|
167
|
+
|
168
|
+
describe 'to_a' do
|
169
|
+
before { stub_model(:city) }
|
170
|
+
let(:cities) { 3.times.map { |i| City.create! name: "name#{i}", rating: i } }
|
171
|
+
|
172
|
+
context do
|
173
|
+
before do
|
174
|
+
stub_index(:cities) do
|
175
|
+
define_type :city do
|
176
|
+
field :name
|
177
|
+
field :rating, type: 'integer'
|
178
|
+
field :nested, type: 'object', value: ->{ {name: name} }
|
179
|
+
end
|
180
|
+
end.tap(&:create!)
|
181
|
+
end
|
182
|
+
|
183
|
+
before { CitiesIndex::City.import cities }
|
184
|
+
|
185
|
+
specify { CitiesIndex.order(:rating).first.should be_a CitiesIndex::City }
|
186
|
+
specify { CitiesIndex.order(:rating).first.name.should == 'name0' }
|
187
|
+
specify { CitiesIndex.order(:rating).first.rating.should == 0 }
|
188
|
+
specify { CitiesIndex.order(:rating).first.nested.should == {'name' => 'name0'} }
|
189
|
+
specify { CitiesIndex.order(:rating).first.id.should == cities.first.id.to_s }
|
190
|
+
|
191
|
+
specify { CitiesIndex.order(:rating).only(:name).first.name.should == 'name0' }
|
192
|
+
specify { CitiesIndex.order(:rating).only(:name).first.rating.should be_nil }
|
193
|
+
specify { CitiesIndex.order(:rating).only(:nested).first.nested.should == {'name' => 'name0'} }
|
194
|
+
|
195
|
+
specify { CitiesIndex.order(:rating).first._score.should be_nil }
|
196
|
+
specify { CitiesIndex.all.first._score.should be > 0 }
|
197
|
+
specify { CitiesIndex.query(match: {name: 'name0'}).first._score.should be > 0 }
|
198
|
+
|
199
|
+
specify { CitiesIndex.order(:rating).first._explanation.should be_nil }
|
200
|
+
specify { CitiesIndex.order(:rating).explain.first._explanation.should be_present }
|
201
|
+
end
|
202
|
+
|
203
|
+
context 'sourceless' do
|
204
|
+
before do
|
205
|
+
stub_index(:cities) do
|
206
|
+
define_type :city do
|
207
|
+
root _source: {enabled: false} do
|
208
|
+
field :name
|
209
|
+
field :rating, type: 'integer'
|
210
|
+
field :nested, type: 'object', value: ->{ {name: name} }
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end.tap(&:create!)
|
214
|
+
end
|
215
|
+
before { CitiesIndex::City.import cities }
|
216
|
+
|
217
|
+
specify { CitiesIndex.order(:rating).first.should be_a CitiesIndex::City }
|
218
|
+
specify { CitiesIndex.order(:rating).first.name.should be_nil }
|
219
|
+
specify { CitiesIndex.order(:rating).first.rating.should be_nil }
|
220
|
+
specify { CitiesIndex.order(:rating).first.nested.should be_nil }
|
221
|
+
|
222
|
+
specify { CitiesIndex.order(:rating).only(:name).first.name.should be_nil }
|
223
|
+
specify { CitiesIndex.order(:rating).only(:name).first.rating.should be_nil }
|
224
|
+
specify { CitiesIndex.order(:rating).only(:nested).first.nested.should be_nil }
|
225
|
+
end
|
226
|
+
end
|
167
227
|
end
|
@@ -22,9 +22,6 @@ describe Chewy::Type::Adapter::ActiveRecord do
|
|
22
22
|
result
|
23
23
|
end
|
24
24
|
|
25
|
-
specify { subject.import(3.times.map { |i| City.create! }) { |data| true }.should be_true }
|
26
|
-
specify { subject.import(3.times.map { |i| City.create! }) { |data| false }.should be_false }
|
27
|
-
|
28
25
|
context do
|
29
26
|
let!(:cities) { 3.times.map { |i| City.create! } }
|
30
27
|
let!(:deleted) { 3.times.map { |i| City.create!.tap(&:destroy!) } }
|
@@ -83,20 +80,82 @@ describe Chewy::Type::Adapter::ActiveRecord do
|
|
83
80
|
{delete: [cities.last.id] + deleted.first(1).map(&:id)},
|
84
81
|
{delete: deleted.last(1).map(&:id)}] }
|
85
82
|
end
|
83
|
+
|
84
|
+
context 'error handling' do
|
85
|
+
let!(:cities) { 3.times.map { |i| City.create! } }
|
86
|
+
let!(:deleted) { 2.times.map { |i| City.create!.tap(&:destroy!) } }
|
87
|
+
let(:ids) { (cities + deleted).map(&:id) }
|
88
|
+
subject { described_class.new(City) }
|
89
|
+
|
90
|
+
let(:data_comparer) do
|
91
|
+
->(id, data) { object = (data[:index] || data[:delete]).first; (object.try(:id) || object) != id }
|
92
|
+
end
|
93
|
+
|
94
|
+
context 'implicit scope' do
|
95
|
+
specify { subject.import { |data| true }.should be_true }
|
96
|
+
specify { subject.import { |data| false }.should be_false }
|
97
|
+
specify { subject.import(batch_size: 1, &data_comparer.curry[cities[0].id]).should be_false }
|
98
|
+
specify { subject.import(batch_size: 1, &data_comparer.curry[cities[1].id]).should be_false }
|
99
|
+
specify { subject.import(batch_size: 1, &data_comparer.curry[cities[2].id]).should be_false }
|
100
|
+
specify { subject.import(batch_size: 1, &data_comparer.curry[deleted[0].id]).should be_true }
|
101
|
+
specify { subject.import(batch_size: 1, &data_comparer.curry[deleted[1].id]).should be_true }
|
102
|
+
end
|
103
|
+
|
104
|
+
context 'explicit scope' do
|
105
|
+
let(:scope) { City.where(id: ids) }
|
106
|
+
|
107
|
+
specify { subject.import(scope) { |data| true }.should be_true }
|
108
|
+
specify { subject.import(scope) { |data| false }.should be_false }
|
109
|
+
specify { subject.import(scope, batch_size: 1, &data_comparer.curry[cities[0].id]).should be_false }
|
110
|
+
specify { subject.import(scope, batch_size: 1, &data_comparer.curry[cities[1].id]).should be_false }
|
111
|
+
specify { subject.import(scope, batch_size: 1, &data_comparer.curry[cities[2].id]).should be_false }
|
112
|
+
specify { subject.import(scope, batch_size: 1, &data_comparer.curry[deleted[0].id]).should be_true }
|
113
|
+
specify { subject.import(scope, batch_size: 1, &data_comparer.curry[deleted[1].id]).should be_true }
|
114
|
+
end
|
115
|
+
|
116
|
+
context 'objects' do
|
117
|
+
specify { subject.import(cities + deleted) { |data| true }.should be_true }
|
118
|
+
specify { subject.import(cities + deleted) { |data| false }.should be_false }
|
119
|
+
specify { subject.import(cities + deleted, batch_size: 1, &data_comparer.curry[cities[0].id]).should be_false }
|
120
|
+
specify { subject.import(cities + deleted, batch_size: 1, &data_comparer.curry[cities[1].id]).should be_false }
|
121
|
+
specify { subject.import(cities + deleted, batch_size: 1, &data_comparer.curry[cities[2].id]).should be_false }
|
122
|
+
specify { subject.import(cities + deleted, batch_size: 1, &data_comparer.curry[deleted[0].id]).should be_false }
|
123
|
+
specify { subject.import(cities + deleted, batch_size: 1, &data_comparer.curry[deleted[1].id]).should be_false }
|
124
|
+
end
|
125
|
+
|
126
|
+
context 'ids' do
|
127
|
+
specify { subject.import(ids) { |data| true }.should be_true }
|
128
|
+
specify { subject.import(ids) { |data| false }.should be_false }
|
129
|
+
specify { subject.import(ids, batch_size: 1, &data_comparer.curry[cities[0].id]).should be_false }
|
130
|
+
specify { subject.import(ids, batch_size: 1, &data_comparer.curry[cities[1].id]).should be_false }
|
131
|
+
specify { subject.import(ids, batch_size: 1, &data_comparer.curry[cities[2].id]).should be_false }
|
132
|
+
specify { subject.import(ids, batch_size: 1, &data_comparer.curry[deleted[0].id]).should be_false }
|
133
|
+
specify { subject.import(ids, batch_size: 1, &data_comparer.curry[deleted[1].id]).should be_false }
|
134
|
+
end
|
135
|
+
end
|
86
136
|
end
|
87
137
|
|
88
138
|
describe '#load' do
|
89
139
|
let!(:cities) { 3.times.map { |i| City.create!(country_id: i/2) } }
|
90
140
|
let!(:deleted) { 2.times.map { |i| City.create!.tap(&:destroy!) } }
|
141
|
+
|
142
|
+
let(:type) { double(type_name: 'user') }
|
143
|
+
|
91
144
|
subject { described_class.new(City) }
|
92
145
|
|
93
|
-
specify { subject.load(cities.map { |c| double(id: c.id) }).should == cities }
|
94
|
-
specify { subject.load(cities.map { |c| double(id: c.id) }.reverse).should == cities.reverse }
|
95
|
-
specify { subject.load(deleted.map { |c| double(id: c.id) }).should == [nil, nil] }
|
96
|
-
specify { subject.load((cities + deleted).map { |c| double(id: c.id) }).should == [*cities, nil, nil] }
|
97
|
-
specify { subject.load(cities.map { |c| double(id: c.id) }, scope: ->
|
146
|
+
specify { subject.load(cities.map { |c| double(id: c.id) }, _type: type).should == cities }
|
147
|
+
specify { subject.load(cities.map { |c| double(id: c.id) }.reverse, _type: type).should == cities.reverse }
|
148
|
+
specify { subject.load(deleted.map { |c| double(id: c.id) }, _type: type).should == [nil, nil] }
|
149
|
+
specify { subject.load((cities + deleted).map { |c| double(id: c.id) }, _type: type).should == [*cities, nil, nil] }
|
150
|
+
specify { subject.load(cities.map { |c| double(id: c.id) }, _type: type, scope: ->{ where(country_id: 0) })
|
98
151
|
.should == cities.first(2) + [nil] }
|
99
|
-
specify { subject.load(cities.map { |c| double(id: c.id) },
|
152
|
+
specify { subject.load(cities.map { |c| double(id: c.id) },
|
153
|
+
_type: type, scope: ->{ where(country_id: 0) }, user: {scope: ->{ where(country_id: 1)}})
|
100
154
|
.should == [nil, nil] + cities.last(1) }
|
155
|
+
specify { subject.load(cities.map { |c| double(id: c.id) }, _type: type, scope: City.where(country_id: 1))
|
156
|
+
.should == [nil, nil] + cities.last(1) }
|
157
|
+
specify { subject.load(cities.map { |c| double(id: c.id) },
|
158
|
+
_type: type, scope: City.where(country_id: 1), user: {scope: ->{ where(country_id: 0)}})
|
159
|
+
.should == cities.first(2) + [nil] }
|
101
160
|
end
|
102
161
|
end
|
@@ -53,6 +53,24 @@ describe Chewy::Type::Adapter::Object do
|
|
53
53
|
specify { import(products).should == [{index: products}] }
|
54
54
|
specify { expect { import(products, non_product) {} }.to raise_error }
|
55
55
|
end
|
56
|
+
|
57
|
+
context 'error handling' do
|
58
|
+
let(:products) { 3.times.map { |i| double.tap { |product| product.stub(rating: i.next) } } }
|
59
|
+
let(:deleted) { 2.times.map { |i| double(destroyed?: true, rating: i + 4) } }
|
60
|
+
subject { described_class.new('product') }
|
61
|
+
|
62
|
+
let(:data_comparer) do
|
63
|
+
->(n, data) { (data[:index] || data[:delete]).first.rating != n }
|
64
|
+
end
|
65
|
+
|
66
|
+
specify { subject.import(products, deleted) { |data| true }.should be_true }
|
67
|
+
specify { subject.import(products, deleted) { |data| false }.should be_false }
|
68
|
+
specify { subject.import(products, deleted, batch_size: 1, &data_comparer.curry[1]).should be_false }
|
69
|
+
specify { subject.import(products, deleted, batch_size: 1, &data_comparer.curry[2]).should be_false }
|
70
|
+
specify { subject.import(products, deleted, batch_size: 1, &data_comparer.curry[3]).should be_false }
|
71
|
+
specify { subject.import(products, deleted, batch_size: 1, &data_comparer.curry[4]).should be_false }
|
72
|
+
specify { subject.import(products, deleted, batch_size: 1, &data_comparer.curry[5]).should be_false }
|
73
|
+
end
|
56
74
|
end
|
57
75
|
|
58
76
|
describe '#load' do
|
@@ -3,6 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe Chewy::Type::Import do
|
4
4
|
include ClassHelpers
|
5
5
|
|
6
|
+
before { Chewy.client.indices.delete }
|
7
|
+
|
6
8
|
before do
|
7
9
|
stub_model(:city)
|
8
10
|
end
|
@@ -18,6 +20,10 @@ describe Chewy::Type::Import do
|
|
18
20
|
let!(:dummy_cities) { 3.times.map { |i| City.create(name: "name#{i}") } }
|
19
21
|
let(:city) { CitiesIndex::City }
|
20
22
|
|
23
|
+
describe '.bulk' do
|
24
|
+
|
25
|
+
end
|
26
|
+
|
21
27
|
describe '.import' do
|
22
28
|
specify { city.import.should be_true }
|
23
29
|
specify { city.import([]).should be_true }
|
@@ -48,11 +54,11 @@ describe Chewy::Type::Import do
|
|
48
54
|
specify do
|
49
55
|
dummy_cities.first.destroy
|
50
56
|
expect(CitiesIndex.client).to receive(:bulk).with(hash_including(
|
51
|
-
body: [{delete: {
|
57
|
+
body: [{delete: {_id: dummy_cities.first.id}}]
|
52
58
|
))
|
53
59
|
dummy_cities.from(1).each.with_index do |c, i|
|
54
60
|
expect(CitiesIndex.client).to receive(:bulk).with(hash_including(
|
55
|
-
body: [{index: {_id: c.id,
|
61
|
+
body: [{index: {_id: c.id, data: {'name' => "name#{i+1}"}}}]
|
56
62
|
))
|
57
63
|
end
|
58
64
|
city.import dummy_cities.map(&:id), batch_size: 1
|
@@ -92,6 +98,85 @@ describe Chewy::Type::Import do
|
|
92
98
|
city.import dummy_cities
|
93
99
|
outer_payload.should == {type: CitiesIndex::City, import: {delete: 1, index: 2}}
|
94
100
|
end
|
101
|
+
|
102
|
+
specify do
|
103
|
+
outer_payload = nil
|
104
|
+
ActiveSupport::Notifications.subscribe('import_objects.chewy') do |name, start, finish, id, payload|
|
105
|
+
outer_payload = payload
|
106
|
+
end
|
107
|
+
|
108
|
+
dummy_cities.first.destroy
|
109
|
+
city.import dummy_cities, batch_size: 1
|
110
|
+
outer_payload.should == {type: CitiesIndex::City, import: {delete: 1, index: 2}}
|
111
|
+
end
|
112
|
+
|
113
|
+
specify do
|
114
|
+
outer_payload = nil
|
115
|
+
ActiveSupport::Notifications.subscribe('import_objects.chewy') do |name, start, finish, id, payload|
|
116
|
+
outer_payload = payload
|
117
|
+
end
|
118
|
+
|
119
|
+
city.import dummy_cities, batch_size: 1
|
120
|
+
outer_payload.should == {type: CitiesIndex::City, import: {index: 3}}
|
121
|
+
end
|
122
|
+
|
123
|
+
context do
|
124
|
+
before do
|
125
|
+
stub_index(:cities) do
|
126
|
+
define_type City do
|
127
|
+
field :name, type: 'object'
|
128
|
+
end
|
129
|
+
end.tap(&:create!)
|
130
|
+
end
|
131
|
+
|
132
|
+
specify do
|
133
|
+
outer_payload = nil
|
134
|
+
ActiveSupport::Notifications.subscribe('import_objects.chewy') do |name, start, finish, id, payload|
|
135
|
+
outer_payload = payload
|
136
|
+
end
|
137
|
+
|
138
|
+
city.import dummy_cities, batch_size: 1
|
139
|
+
outer_payload.should == {
|
140
|
+
type: CitiesIndex::City,
|
141
|
+
errors: {
|
142
|
+
index: {
|
143
|
+
'MapperParsingException[object mapping for [city] tried to parse as object, but got EOF, has a concrete value been provided to it?]' => ['1', '2', '3']
|
144
|
+
}
|
145
|
+
},
|
146
|
+
import: {index: 3}
|
147
|
+
}
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
context 'error handling' do
|
153
|
+
context do
|
154
|
+
before do
|
155
|
+
stub_index(:cities) do
|
156
|
+
define_type City do
|
157
|
+
field :name, type: 'object'
|
158
|
+
end
|
159
|
+
end.tap(&:create!)
|
160
|
+
end
|
161
|
+
|
162
|
+
specify { city.import(dummy_cities).should be_false }
|
163
|
+
specify { city.import(dummy_cities.map(&:id)).should be_false }
|
164
|
+
specify { city.import(dummy_cities, batch_size: 1).should be_false }
|
165
|
+
end
|
166
|
+
|
167
|
+
context do
|
168
|
+
before do
|
169
|
+
stub_index(:cities) do
|
170
|
+
define_type City do
|
171
|
+
field :name, type: 'object', value: ->{ name == 'name1' ? name : {name: name} }
|
172
|
+
end
|
173
|
+
end.tap(&:create!)
|
174
|
+
end
|
175
|
+
|
176
|
+
specify { city.import(dummy_cities).should be_false }
|
177
|
+
specify { city.import(dummy_cities.map(&:id)).should be_false }
|
178
|
+
specify { city.import(dummy_cities, batch_size: 1).should be_false }
|
179
|
+
end
|
95
180
|
end
|
96
181
|
end
|
97
182
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,37 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chewy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pyromaniac
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
|
-
type: :development
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
16
|
requirements:
|
18
|
-
- -
|
17
|
+
- - '>='
|
19
18
|
- !ruby/object:Gem::Version
|
20
19
|
version: '0'
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
|
-
type: :development
|
30
29
|
requirement: !ruby/object:Gem::Requirement
|
31
30
|
requirements:
|
32
31
|
- - ~>
|
33
32
|
- !ruby/object:Gem::Version
|
34
33
|
version: '2.14'
|
34
|
+
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
@@ -40,100 +40,100 @@ dependencies:
|
|
40
40
|
version: '2.14'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3
|
43
|
-
type: :development
|
44
43
|
requirement: !ruby/object:Gem::Requirement
|
45
44
|
requirements:
|
46
|
-
- -
|
45
|
+
- - '>='
|
47
46
|
- !ruby/object:Gem::Version
|
48
47
|
version: '0'
|
48
|
+
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: kaminari
|
57
|
-
type: :development
|
58
57
|
requirement: !ruby/object:Gem::Requirement
|
59
58
|
requirements:
|
60
|
-
- -
|
59
|
+
- - '>='
|
61
60
|
- !ruby/object:Gem::Version
|
62
61
|
version: '0'
|
62
|
+
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activerecord
|
71
|
-
type: :development
|
72
71
|
requirement: !ruby/object:Gem::Requirement
|
73
72
|
requirements:
|
74
|
-
- -
|
73
|
+
- - '>='
|
75
74
|
- !ruby/object:Gem::Version
|
76
75
|
version: '3.2'
|
76
|
+
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.2'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: database_cleaner
|
85
|
-
type: :development
|
86
85
|
requirement: !ruby/object:Gem::Requirement
|
87
86
|
requirements:
|
88
|
-
- -
|
87
|
+
- - '>='
|
89
88
|
- !ruby/object:Gem::Version
|
90
89
|
version: '0'
|
90
|
+
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: elasticsearch-extensions
|
99
|
-
type: :development
|
100
99
|
requirement: !ruby/object:Gem::Requirement
|
101
100
|
requirements:
|
102
|
-
- -
|
101
|
+
- - '>='
|
103
102
|
- !ruby/object:Gem::Version
|
104
103
|
version: '0'
|
104
|
+
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: activesupport
|
113
|
-
type: :runtime
|
114
113
|
requirement: !ruby/object:Gem::Requirement
|
115
114
|
requirements:
|
116
|
-
- -
|
115
|
+
- - '>='
|
117
116
|
- !ruby/object:Gem::Version
|
118
117
|
version: '3.2'
|
118
|
+
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '3.2'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: elasticsearch
|
127
|
-
type: :runtime
|
128
127
|
requirement: !ruby/object:Gem::Requirement
|
129
128
|
requirements:
|
130
|
-
- -
|
129
|
+
- - '>='
|
131
130
|
- !ruby/object:Gem::Version
|
132
131
|
version: '0'
|
132
|
+
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
description: Chewy provides functionality for Elasticsearch index handling, documents
|
@@ -162,10 +162,12 @@ files:
|
|
162
162
|
- lib/chewy/fields/root.rb
|
163
163
|
- lib/chewy/index.rb
|
164
164
|
- lib/chewy/index/actions.rb
|
165
|
+
- lib/chewy/index/aliases.rb
|
165
166
|
- lib/chewy/index/search.rb
|
166
167
|
- lib/chewy/query.rb
|
167
|
-
- lib/chewy/query/
|
168
|
+
- lib/chewy/query/compose.rb
|
168
169
|
- lib/chewy/query/criteria.rb
|
170
|
+
- lib/chewy/query/filters.rb
|
169
171
|
- lib/chewy/query/loading.rb
|
170
172
|
- lib/chewy/query/nodes/and.rb
|
171
173
|
- lib/chewy/query/nodes/base.rb
|
@@ -174,6 +176,10 @@ files:
|
|
174
176
|
- lib/chewy/query/nodes/exists.rb
|
175
177
|
- lib/chewy/query/nodes/expr.rb
|
176
178
|
- lib/chewy/query/nodes/field.rb
|
179
|
+
- lib/chewy/query/nodes/has_child.rb
|
180
|
+
- lib/chewy/query/nodes/has_parent.rb
|
181
|
+
- lib/chewy/query/nodes/has_relation.rb
|
182
|
+
- lib/chewy/query/nodes/match_all.rb
|
177
183
|
- lib/chewy/query/nodes/missing.rb
|
178
184
|
- lib/chewy/query/nodes/not.rb
|
179
185
|
- lib/chewy/query/nodes/or.rb
|
@@ -203,15 +209,19 @@ files:
|
|
203
209
|
- spec/chewy/fields/default_spec.rb
|
204
210
|
- spec/chewy/fields/root_spec.rb
|
205
211
|
- spec/chewy/index/actions_spec.rb
|
212
|
+
- spec/chewy/index/aliases_spec.rb
|
206
213
|
- spec/chewy/index/search_spec.rb
|
207
214
|
- spec/chewy/index_spec.rb
|
208
|
-
- spec/chewy/query/context_spec.rb
|
209
215
|
- spec/chewy/query/criteria_spec.rb
|
216
|
+
- spec/chewy/query/filters_spec.rb
|
210
217
|
- spec/chewy/query/loading_spec.rb
|
211
218
|
- spec/chewy/query/nodes/and_spec.rb
|
212
219
|
- spec/chewy/query/nodes/bool_spec.rb
|
213
220
|
- spec/chewy/query/nodes/equal_spec.rb
|
214
221
|
- spec/chewy/query/nodes/exists_spec.rb
|
222
|
+
- spec/chewy/query/nodes/has_child_spec.rb
|
223
|
+
- spec/chewy/query/nodes/has_parent_spec.rb
|
224
|
+
- spec/chewy/query/nodes/match_all_spec.rb
|
215
225
|
- spec/chewy/query/nodes/missing_spec.rb
|
216
226
|
- spec/chewy/query/nodes/not_spec.rb
|
217
227
|
- spec/chewy/query/nodes/or_spec.rb
|
@@ -245,17 +255,17 @@ require_paths:
|
|
245
255
|
- lib
|
246
256
|
required_ruby_version: !ruby/object:Gem::Requirement
|
247
257
|
requirements:
|
248
|
-
- -
|
258
|
+
- - '>='
|
249
259
|
- !ruby/object:Gem::Version
|
250
260
|
version: '0'
|
251
261
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
252
262
|
requirements:
|
253
|
-
- -
|
263
|
+
- - '>='
|
254
264
|
- !ruby/object:Gem::Version
|
255
265
|
version: '0'
|
256
266
|
requirements: []
|
257
267
|
rubyforge_project:
|
258
|
-
rubygems_version: 2.1
|
268
|
+
rubygems_version: 2.2.1
|
259
269
|
signing_key:
|
260
270
|
specification_version: 4
|
261
271
|
summary: Elasticsearch ODM client wrapper
|
@@ -265,15 +275,19 @@ test_files:
|
|
265
275
|
- spec/chewy/fields/default_spec.rb
|
266
276
|
- spec/chewy/fields/root_spec.rb
|
267
277
|
- spec/chewy/index/actions_spec.rb
|
278
|
+
- spec/chewy/index/aliases_spec.rb
|
268
279
|
- spec/chewy/index/search_spec.rb
|
269
280
|
- spec/chewy/index_spec.rb
|
270
|
-
- spec/chewy/query/context_spec.rb
|
271
281
|
- spec/chewy/query/criteria_spec.rb
|
282
|
+
- spec/chewy/query/filters_spec.rb
|
272
283
|
- spec/chewy/query/loading_spec.rb
|
273
284
|
- spec/chewy/query/nodes/and_spec.rb
|
274
285
|
- spec/chewy/query/nodes/bool_spec.rb
|
275
286
|
- spec/chewy/query/nodes/equal_spec.rb
|
276
287
|
- spec/chewy/query/nodes/exists_spec.rb
|
288
|
+
- spec/chewy/query/nodes/has_child_spec.rb
|
289
|
+
- spec/chewy/query/nodes/has_parent_spec.rb
|
290
|
+
- spec/chewy/query/nodes/match_all_spec.rb
|
277
291
|
- spec/chewy/query/nodes/missing_spec.rb
|
278
292
|
- spec/chewy/query/nodes/not_spec.rb
|
279
293
|
- spec/chewy/query/nodes/or_spec.rb
|