gummi 0.0.9 → 0.1.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.
data/lib/gummi/api.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Gummi
2
2
  module API
3
3
  def self.client
4
- @client ||= ::Elasticsearch::Client.new log: true
4
+ @client ||= ::Elasticsearch::Client.new log: false
5
5
  end
6
6
  end
7
7
  end
@@ -5,21 +5,21 @@ module Gummi
5
5
  include Gummi::Document::Search::Searching
6
6
 
7
7
  attribute :query_string, Gummi::Fields::SanitizedString
8
- attribute :terms, Array[Hash], default: []
9
8
  attribute :query_filters, Array[Hash], default: []
10
9
  attribute :facets, Hash, default: {}
11
10
 
12
11
  def to_client_args
13
- args = {}
14
- args[:index] = index
15
- args[:type] = type if type
16
- args[:from] = from
12
+ args = super
17
13
  args[:body] = {query: filtered, facets: facets }
18
14
  args
19
15
  end
20
16
 
21
17
  def query
22
- {query_string: { query: query_string}} if query_string.present?
18
+ if query_string.present?
19
+ {query_string: { query: query_string}}
20
+ else
21
+ {match_all: {}}
22
+ end
23
23
  end
24
24
 
25
25
  def filtered
@@ -17,7 +17,7 @@ module Gummi
17
17
 
18
18
  def records
19
19
  entities = Array(@repository.to_entity_from_db(@db_records)) if @db_records
20
- Leaflet::Collection.new entities, per_page: @per_page, page: @page, total: total
20
+ Leaflet::Collection.new entities, page: @page, total: total, per_page: @per_page
21
21
  end
22
22
  end
23
23
  end
data/lib/gummi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gummi
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -4,7 +4,7 @@ module DB
4
4
  class Person
5
5
  include Gummi::Document
6
6
 
7
- attribute :name, Gummi::Fields::Keyword
7
+ attribute :name, Gummi::Fields::String
8
8
  attribute :computed_name, Gummi::Fields::String
9
9
  attribute :born_at, Gummi::Fields::Time
10
10
 
@@ -4,8 +4,4 @@ class Person
4
4
 
5
5
  attribute :name, String
6
6
  attribute :converted_name, String
7
-
8
- def self.hello
9
- puts "hej"
10
- end
11
7
  end
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.0.9
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -230,12 +230,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
230
230
  - - ! '>='
231
231
  - !ruby/object:Gem::Version
232
232
  version: '0'
233
+ segments:
234
+ - 0
235
+ hash: 2387628349001688798
233
236
  required_rubygems_version: !ruby/object:Gem::Requirement
234
237
  none: false
235
238
  requirements:
236
239
  - - ! '>='
237
240
  - !ruby/object:Gem::Version
238
241
  version: '0'
242
+ segments:
243
+ - 0
244
+ hash: 2387628349001688798
239
245
  requirements: []
240
246
  rubyforge_project:
241
247
  rubygems_version: 1.8.23