inquisitio 2.1.0 → 2.1.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: f276ddda623e737c046197a26d4696dc87859265
4
- data.tar.gz: 60eac7285494fc1adad7edb022ca36e6030f9db5
3
+ metadata.gz: 1ec9cf90b4eb054bcd0cc4a50657012bfc244aa6
4
+ data.tar.gz: ce88645dad186e3f94c2d020ad14a3cb89e3a077
5
5
  SHA512:
6
- metadata.gz: 59bc49ebc2a61c0dcf17118ad7de9329be918b13088df8c78e9175ec8bb964135523e3972a743864b704057442e4e4f39286933ed3b131528682004eb96246fe
7
- data.tar.gz: b48f671ce616589f245bd9ecf308920832900ca35711385579b9544324769e3f37e0d7b08436f9a5ade1a63539467b0c569a250d1f1dba783e3d3ae7c079689c
6
+ metadata.gz: faf0ec26e69d120267f7d956aa52ac5926f21dc8d210786275cf0cff972d4653106b8510eb4c91e29c46567290b3c2eccc71155c4f86ee349a78e74787f0f4ca
7
+ data.tar.gz: 36423bc33afe9a853d20a5aa30d3352b37c00c7dacaa96de767bcf230b245c59d2791b551c9dcd3632c3059faa601db0bb892c357ed36169607d8dc7cc0da325
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ 2.1.1 / 2015-07-23
2
+ [BUGFIX] result_facets now returns an empty set in the event no facets were requested or returned
3
+
1
4
  2.1.0 / 2015-07-22
2
5
  [FEATURE] Add support for filter queries (fq) as Searcher#filter
3
6
  [FEATURE] Add support for facets as Searcher#facets
@@ -3,7 +3,7 @@ module Inquisitio
3
3
  extend Forwardable
4
4
 
5
5
  def initialize(facets)
6
- @facets = JSON.parse(facets.to_json, symbolize_names: true)
6
+ @facets = facets.nil? ? {} : JSON.parse(facets.to_json, symbolize_names: true)
7
7
  end
8
8
 
9
9
  def fields
@@ -1,3 +1,3 @@
1
1
  module Inquisitio
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
data/test/facets_test.rb CHANGED
@@ -68,5 +68,18 @@ module Inquisitio
68
68
  assert_equal 2, facets[:rating][:buckets][1][:count]
69
69
  end
70
70
 
71
+ def test_should_return_empty_if_no_facets_requested
72
+ body = {
73
+ 'status' => {'rid' => 'u9aP4eYo8gIK0csK', 'time-ms' => 4},
74
+ 'hits' => {'found' => 1, 'start' => 0, 'hit' => [{'data' => {'id' => ['20'], 'title' => ['Foobar2'], 'type' => ['Module_Dog']}}], }
75
+ }.to_json
76
+ Excon.stubs.clear
77
+ Excon.stub({}, {body: body, status: 200})
78
+
79
+ searcher = Searcher.where('star_wars')
80
+ facets = searcher.result_facets
81
+ assert_equal [], facets.fields
82
+ end
83
+
71
84
  end
72
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inquisitio
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker