stretcher 1.9.0 → 1.10.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.
@@ -24,7 +24,7 @@ module Stretcher
24
24
  if r.key?('highlight')
25
25
  doc.merge!({"_highlight" => r['highlight']})
26
26
  end
27
- doc.merge!({"_id" => r['_id'], "_index" => r['_index'], "_type" => r['_type']})
27
+ doc.merge!({"_id" => r['_id'], "_index" => r['_index'], "_type" => r['_type'], "_score" => r['_score']})
28
28
  end
29
29
  end
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module Stretcher
2
- VERSION = "1.9.0"
2
+ VERSION = "1.10.0"
3
3
  end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ describe Stretcher::SearchResults do
4
+ let(:result) do
5
+ Hashie::Mash.new({
6
+ 'raw' => {
7
+ 'facets' => [],
8
+ 'hits' => {
9
+ 'total' => 1,
10
+ 'hits' => [{
11
+ '_score' => 255,
12
+ '_id' => 2,
13
+ '_index' => 'index_name',
14
+ '_type' => 'type_name'
15
+ }]
16
+ }
17
+ }
18
+ })
19
+ end
20
+
21
+ context 'merges in select keys' do
22
+ subject(:search_result) { Stretcher::SearchResults.new(result).results.first }
23
+ its(:_score) { should == 255 }
24
+ its(:_id) { should == 2 }
25
+ its(:_index) { should == 'index_name' }
26
+ its(:_type) { should == 'type_name' }
27
+ end
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stretcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-06 00:00:00.000000000 Z
12
+ date: 2013-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -162,6 +162,7 @@ files:
162
162
  - lib/stretcher/version.rb
163
163
  - spec/lib/stretcher_index_spec.rb
164
164
  - spec/lib/stretcher_index_type_spec.rb
165
+ - spec/lib/stretcher_search_results_spec.rb
165
166
  - spec/lib/stretcher_server_spec.rb
166
167
  - spec/spec_helper.rb
167
168
  - spec/stretcher_spec.rb
@@ -194,6 +195,7 @@ summary: The elegant ElasticSearch client, supporting persistent connections, an
194
195
  test_files:
195
196
  - spec/lib/stretcher_index_spec.rb
196
197
  - spec/lib/stretcher_index_type_spec.rb
198
+ - spec/lib/stretcher_search_results_spec.rb
197
199
  - spec/lib/stretcher_server_spec.rb
198
200
  - spec/spec_helper.rb
199
201
  - spec/stretcher_spec.rb