es-elasticity 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe85514d61fcf6a3e0fe8154a2bcf9abf13efae4
4
- data.tar.gz: aa8fb32667cbf72c30ee881c906b24908cb369cf
3
+ metadata.gz: 0894b365ac839909536201e53a77446302a51606
4
+ data.tar.gz: 1aac5d88c4ea51c355babcef0d6d62218d3f6b52
5
5
  SHA512:
6
- metadata.gz: b2c0f4c966b6ea8aa54946901fc99c27498b73af2b00388dd6a2b098aec6f88c79e1cb140ac5f0f3af36d025bc85b9b0a6d2f0c8d7c6730a4802a13f876df321
7
- data.tar.gz: 266c4a46686ed27aa7cbb8eee58cb128f193c41f30612036e541c5a14f1feba659dd080c13c62fb083d126920208efbdd5d127eb5aaf3e2ad4b33c53b34c14e5
6
+ metadata.gz: d349ea21084175b7b9c933c521d5af7b02d37d868929248f64ddeaa7ede415dc2d254d6edca448a8886af04d8bdd69f4fe658034c77f0b210d4f168cba395d61
7
+ data.tar.gz: a889157a7788f7ccbfd9dedc6a540f924f473af7a2d70a792b88617f37e0be52f377391a6ac64a1cdb287273660b423b1600185e572ddd10d4b8a641fe07e9f5
@@ -12,7 +12,7 @@ module Elasticity
12
12
  end
13
13
 
14
14
  # Define common attributes for all documents
15
- attr_accessor :_id, :highlighted, :_score
15
+ attr_accessor :_id, :highlighted, :_score, :sort
16
16
 
17
17
  def attributes=(attributes)
18
18
  attributes.each do |attr, value|
@@ -138,6 +138,7 @@ module Elasticity
138
138
  def map_hit(hit)
139
139
  attrs = { _id: hit["_id"] }
140
140
  attrs.merge!(_score: hit["_score"])
141
+ attrs.merge!(sort: hit["sort"])
141
142
  attrs.merge!(hit["_source"]) if hit["_source"]
142
143
 
143
144
  if hit["highlight"]
@@ -1,3 +1,3 @@
1
1
  module Elasticity
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -42,8 +42,8 @@ RSpec.describe "Persistence", elasticsearch: true do
42
42
  end
43
43
 
44
44
  it "successfully index, update, search, count and delete" do
45
- john = subject.new(name: "John", birthdate: "1985-10-31")
46
- mari = subject.new(name: "Mari", birthdate: "1986-09-24")
45
+ john = subject.new(name: "John", birthdate: "1985-10-31", sort: ['john'])
46
+ mari = subject.new(name: "Mari", birthdate: "1986-09-24", sort: ['mari'])
47
47
 
48
48
  john.update
49
49
  mari.update
@@ -194,8 +194,8 @@ RSpec.describe "Persistence", elasticsearch: true do
194
194
  end
195
195
 
196
196
  it "remaps to a different index transparently" do
197
- john = subject.new(id: 1, name: "John", birthdate: "1985-10-31")
198
- mari = subject.new(id: 2, name: "Mari", birthdate: "1986-09-24")
197
+ john = subject.new(id: 1, name: "John", birthdate: "1985-10-31", sort: ['john'])
198
+ mari = subject.new(id: 2, name: "Mari", birthdate: "1986-09-24", sort: ['mari'])
199
199
 
200
200
  john.update
201
201
  mari.update
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: es-elasticity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Kochenburger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-18 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  requirements: []
232
232
  rubyforge_project:
233
- rubygems_version: 2.4.5
233
+ rubygems_version: 2.4.5.1
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: ActiveModel-based library for working with Elasticsearch