es-elasticity 0.4.3 → 0.4.4

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: 1c5f0cdc13a933f514fc74015c2dc23b8733f8a0
4
- data.tar.gz: f345594a1b7770bfc40ad274e947b3db3b3b5ffd
3
+ metadata.gz: 50e49ee213d45f6888663d417c8f019ed79d4c9f
4
+ data.tar.gz: 103bb2370e73a3a61e98e92c77491521d95a83f5
5
5
  SHA512:
6
- metadata.gz: 22d071dd3e4166f747022a8fb0202edbd468e108874a310408f98227738b99201f37e167208d6c663ce61913a502ceda3d4f4165c1cbb874b8c57da28556b676
7
- data.tar.gz: b32c8f0fdfc9d27822f13125f18fc71248b3d41b3e5dd73c0465603fabf63eacac6844d6c4cd93b0838c7503f1b3b34dcf35ab8b0344e036cac5ac8a1bb1e478
6
+ metadata.gz: 766f198bb518a44bd3808ca020bbbff4b98b9449fd0cbf429c41f573fe3f14715c4a31a191c3a4fa5e5ca06f7219c815315c92131e57414681117ac583fd035f
7
+ data.tar.gz: 9641a5fbc45325e1468585b8052e931946cfad57adb2012373ac98a3c1343a79c80ed0aca6939b0d7c5a0a766e578d933b8d10d1fae22004f712b2baac502636
data/CHANGELOG ADDED
@@ -0,0 +1,2 @@
1
+ v0.4.4
2
+ - Added support for surfacing document _score on query results.
@@ -12,7 +12,7 @@ module Elasticity
12
12
  end
13
13
 
14
14
  # Define common attributes for all documents
15
- attr_accessor :_id, :highlighted
15
+ attr_accessor :_id, :highlighted, :_score
16
16
 
17
17
  def attributes=(attributes)
18
18
  attributes.each do |attr, value|
@@ -122,6 +122,7 @@ module Elasticity
122
122
  # Creates a instance of a document from a ElasticSearch hit data.
123
123
  def map_hit(hit)
124
124
  attrs = { _id: hit["_id"] }
125
+ attrs.merge!(_score: hit["_score"])
125
126
  attrs.merge!(hit["_source"]) if hit["_source"]
126
127
 
127
128
  if hit["highlight"]
@@ -1,3 +1,3 @@
1
1
  module Elasticity
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
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.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Kochenburger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-19 00:00:00.000000000 Z
11
+ date: 2016-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -176,6 +176,7 @@ files:
176
176
  - ".rspec"
177
177
  - ".simplecov"
178
178
  - ".travis.yml"
179
+ - CHANGELOG
179
180
  - CONTRIBUTING.md
180
181
  - Gemfile
181
182
  - LICENSE.txt
@@ -229,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
230
  version: '0'
230
231
  requirements: []
231
232
  rubyforge_project:
232
- rubygems_version: 2.4.5
233
+ rubygems_version: 2.2.2
233
234
  signing_key:
234
235
  specification_version: 4
235
236
  summary: ActiveModel-based library for working with Elasticsearch
@@ -242,4 +243,3 @@ test_files:
242
243
  - spec/units/multi_search_spec.rb
243
244
  - spec/units/search_spec.rb
244
245
  - spec/units/strategies/single_index_spec.rb
245
- has_rdoc: