gummi 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gummi/db_layer/document/search/searching.rb +2 -2
- data/lib/gummi/repository_layer/repository.rb +9 -3
- data/lib/gummi/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/{fixtures → support/models}/admin/auto.rb +0 -0
- data/spec/{fixtures → support/models}/admin/cars.rb +0 -0
- data/spec/{fixtures → support/models}/admin/countries.rb +0 -0
- data/spec/{fixtures → support/models}/admin/country.rb +0 -0
- data/spec/{fixtures → support/models}/admin/db/country.rb +0 -0
- data/spec/{fixtures → support/models}/admin/db/vehicle.rb +0 -0
- data/spec/{fixtures → support/models}/cities.rb +0 -0
- data/spec/{fixtures → support/models}/city.rb +0 -0
- data/spec/{fixtures → support/models}/db/animal.rb +0 -0
- data/spec/{fixtures → support/models}/db/boat.rb +0 -0
- data/spec/{fixtures → support/models}/db/car.rb +0 -0
- data/spec/{fixtures → support/models}/db/city.rb +0 -0
- data/spec/{fixtures → support/models}/db/enemy.rb +0 -0
- data/spec/{fixtures → support/models}/db/game.rb +0 -0
- data/spec/{fixtures → support/models}/db/person.rb +0 -0
- data/spec/{fixtures → support/models}/db/rating.rb +0 -0
- data/spec/{fixtures → support/models}/db/ship.rb +0 -0
- data/spec/{fixtures → support/models}/people.rb +0 -0
- data/spec/{fixtures → support/models}/person.rb +0 -0
- metadata +39 -39
@@ -9,11 +9,11 @@ module Gummi
|
|
9
9
|
include Virtus.model
|
10
10
|
|
11
11
|
attribute :document_class, Class
|
12
|
-
attribute :index, String,
|
12
|
+
attribute :index, String, default: lambda { |search, attr| Gummi::DbLayer::DefaultIndex.name }
|
13
13
|
attribute :type, String
|
14
14
|
attribute :page, Gummi::DbLayer::Fields::PositiveInteger, default: 1
|
15
15
|
attribute :per_page, Gummi::DbLayer::Fields::PositiveInteger, default: 300
|
16
|
-
attribute :options, Hash,
|
16
|
+
attribute :options, Hash, default: {}
|
17
17
|
end
|
18
18
|
|
19
19
|
def to_client_args
|
@@ -15,9 +15,15 @@ module Gummi
|
|
15
15
|
db_instance_to_entity document if document
|
16
16
|
end
|
17
17
|
|
18
|
-
def search(&block)
|
19
|
-
search = db_class.new_filtered_search
|
20
|
-
yield search
|
18
|
+
def search(options = {}, &block)
|
19
|
+
search = db_class.new_filtered_search(options)
|
20
|
+
yield search if block_given?
|
21
|
+
Repository::Result.new search.execute, self
|
22
|
+
end
|
23
|
+
|
24
|
+
def raw_search(options = {}, &block)
|
25
|
+
search = db_class.new_raw_search(options)
|
26
|
+
yield search if block_given?
|
21
27
|
Repository::Result.new search.execute, self
|
22
28
|
end
|
23
29
|
|
data/lib/gummi/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gummi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -232,30 +232,30 @@ files:
|
|
232
232
|
- lib/repobahn/entity.rb
|
233
233
|
- lib/repobahn/repository.rb
|
234
234
|
- lib/repobahn/repository/active_record.rb
|
235
|
-
- spec/fixtures/admin/auto.rb
|
236
|
-
- spec/fixtures/admin/cars.rb
|
237
|
-
- spec/fixtures/admin/countries.rb
|
238
|
-
- spec/fixtures/admin/country.rb
|
239
|
-
- spec/fixtures/admin/db/country.rb
|
240
|
-
- spec/fixtures/admin/db/vehicle.rb
|
241
|
-
- spec/fixtures/cities.rb
|
242
|
-
- spec/fixtures/city.rb
|
243
|
-
- spec/fixtures/db/animal.rb
|
244
|
-
- spec/fixtures/db/boat.rb
|
245
|
-
- spec/fixtures/db/car.rb
|
246
|
-
- spec/fixtures/db/city.rb
|
247
|
-
- spec/fixtures/db/enemy.rb
|
248
|
-
- spec/fixtures/db/game.rb
|
249
|
-
- spec/fixtures/db/person.rb
|
250
|
-
- spec/fixtures/db/rating.rb
|
251
|
-
- spec/fixtures/db/ship.rb
|
252
|
-
- spec/fixtures/people.rb
|
253
|
-
- spec/fixtures/person.rb
|
254
235
|
- spec/lib/gummi/db_layer/document_spec.rb
|
255
236
|
- spec/lib/gummi/entity_layer/entity_spec.rb
|
256
237
|
- spec/lib/gummi/repository_layer/repository_spec.rb
|
257
238
|
- spec/lib/repobahn/repository_spec.rb
|
258
239
|
- spec/spec_helper.rb
|
240
|
+
- spec/support/models/admin/auto.rb
|
241
|
+
- spec/support/models/admin/cars.rb
|
242
|
+
- spec/support/models/admin/countries.rb
|
243
|
+
- spec/support/models/admin/country.rb
|
244
|
+
- spec/support/models/admin/db/country.rb
|
245
|
+
- spec/support/models/admin/db/vehicle.rb
|
246
|
+
- spec/support/models/cities.rb
|
247
|
+
- spec/support/models/city.rb
|
248
|
+
- spec/support/models/db/animal.rb
|
249
|
+
- spec/support/models/db/boat.rb
|
250
|
+
- spec/support/models/db/car.rb
|
251
|
+
- spec/support/models/db/city.rb
|
252
|
+
- spec/support/models/db/enemy.rb
|
253
|
+
- spec/support/models/db/game.rb
|
254
|
+
- spec/support/models/db/person.rb
|
255
|
+
- spec/support/models/db/rating.rb
|
256
|
+
- spec/support/models/db/ship.rb
|
257
|
+
- spec/support/models/people.rb
|
258
|
+
- spec/support/models/person.rb
|
259
259
|
homepage: ''
|
260
260
|
licenses:
|
261
261
|
- MIT
|
@@ -282,27 +282,27 @@ signing_key:
|
|
282
282
|
specification_version: 3
|
283
283
|
summary: A small wrapper around Elasticsearch
|
284
284
|
test_files:
|
285
|
-
- spec/fixtures/admin/auto.rb
|
286
|
-
- spec/fixtures/admin/cars.rb
|
287
|
-
- spec/fixtures/admin/countries.rb
|
288
|
-
- spec/fixtures/admin/country.rb
|
289
|
-
- spec/fixtures/admin/db/country.rb
|
290
|
-
- spec/fixtures/admin/db/vehicle.rb
|
291
|
-
- spec/fixtures/cities.rb
|
292
|
-
- spec/fixtures/city.rb
|
293
|
-
- spec/fixtures/db/animal.rb
|
294
|
-
- spec/fixtures/db/boat.rb
|
295
|
-
- spec/fixtures/db/car.rb
|
296
|
-
- spec/fixtures/db/city.rb
|
297
|
-
- spec/fixtures/db/enemy.rb
|
298
|
-
- spec/fixtures/db/game.rb
|
299
|
-
- spec/fixtures/db/person.rb
|
300
|
-
- spec/fixtures/db/rating.rb
|
301
|
-
- spec/fixtures/db/ship.rb
|
302
|
-
- spec/fixtures/people.rb
|
303
|
-
- spec/fixtures/person.rb
|
304
285
|
- spec/lib/gummi/db_layer/document_spec.rb
|
305
286
|
- spec/lib/gummi/entity_layer/entity_spec.rb
|
306
287
|
- spec/lib/gummi/repository_layer/repository_spec.rb
|
307
288
|
- spec/lib/repobahn/repository_spec.rb
|
308
289
|
- spec/spec_helper.rb
|
290
|
+
- spec/support/models/admin/auto.rb
|
291
|
+
- spec/support/models/admin/cars.rb
|
292
|
+
- spec/support/models/admin/countries.rb
|
293
|
+
- spec/support/models/admin/country.rb
|
294
|
+
- spec/support/models/admin/db/country.rb
|
295
|
+
- spec/support/models/admin/db/vehicle.rb
|
296
|
+
- spec/support/models/cities.rb
|
297
|
+
- spec/support/models/city.rb
|
298
|
+
- spec/support/models/db/animal.rb
|
299
|
+
- spec/support/models/db/boat.rb
|
300
|
+
- spec/support/models/db/car.rb
|
301
|
+
- spec/support/models/db/city.rb
|
302
|
+
- spec/support/models/db/enemy.rb
|
303
|
+
- spec/support/models/db/game.rb
|
304
|
+
- spec/support/models/db/person.rb
|
305
|
+
- spec/support/models/db/rating.rb
|
306
|
+
- spec/support/models/db/ship.rb
|
307
|
+
- spec/support/models/people.rb
|
308
|
+
- spec/support/models/person.rb
|