searchkick 0.7.3 → 0.7.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: 174eaff2241d0285d027261332c228bae2cf9215
4
- data.tar.gz: db755391a04705242e8d21a54c8374518a1b7344
3
+ metadata.gz: 4b8625d5f69db773beb2bda77ee3b78fdd54398e
4
+ data.tar.gz: d796061050099ca9a13ec01e61511b4e66e2a760
5
5
  SHA512:
6
- metadata.gz: 587dc4255bb875770e109c1c120fac8775a83f818d009d42bdea27d664af88c93ac3b4bc4e37d7bce033e60f54213fbb41eb5f873bfaffcdb9b6ab0d4605a1ec
7
- data.tar.gz: a2da459414ad0a95efbe58c313593367f1e1d7dd3d61d6539c404c813ac204e0b37cae0144ea8366ee0af73fff9a9aeff9d24057b00d001fe00eee5e92caff4a
6
+ metadata.gz: 8e9774402df7d1e076cbfac13f577fe1ec51464405d1e157c2f9078ddc8d757ab64ce7d4a0d96427897f62e34d58753a7045c6e1731a18c9c3f2ca009010c8d6
7
+ data.tar.gz: ecf0c24cc9908419d018d31118ff3f744534f7d426936e4daa8ddc90ee30759e65e452087c697bfa60d87aa330e2c39692f902e2c260c67c159b0e374df86643
@@ -1,3 +1,7 @@
1
+ ## 0.7.4
2
+
3
+ - Fixed reindex with inheritance
4
+
1
5
  ## 0.7.3
2
6
 
3
7
  - Fixed multi-index searches
data/README.md CHANGED
@@ -21,13 +21,15 @@ Plus:
21
21
  - “Did you mean” suggestions
22
22
  - works with ActiveRecord and Mongoid
23
23
 
24
+ :speech_balloon: Get [handcrafted updates](http://chartkick.us7.list-manage.com/subscribe?u=952c861f99eb43084e0a49f98&id=6ea6541e8e&group[0][4]=true) for new features
25
+
24
26
  :tangerine: Battle-tested at [Instacart](https://www.instacart.com)
25
27
 
26
28
  [![Build Status](https://travis-ci.org/ankane/searchkick.png?branch=master)](https://travis-ci.org/ankane/searchkick)
27
29
 
28
30
  We highly recommend tracking queries and conversions
29
31
 
30
- :zap: [Searchjoy](http://ankane.github.io/searchjoy/) makes it easy
32
+ :zap: [Searchjoy](https://github.com/ankane/searchjoy) makes it easy
31
33
 
32
34
  ## Get Started
33
35
 
@@ -40,11 +40,11 @@ module Searchkick
40
40
  end
41
41
 
42
42
  def import(records)
43
- if records.any?
43
+ records.group_by{|r| document_type(r) }.each do |type, batch|
44
44
  client.bulk(
45
45
  index: name,
46
- type: document_type(records.first),
47
- body: records.map{|r| data = search_data(r); {index: {_id: data["_id"] || data["id"] || r.id, data: data}} }
46
+ type: type,
47
+ body: batch.map{|r| data = search_data(r); {index: {_id: data["_id"] || data["id"] || r.id, data: data}} }
48
48
  )
49
49
  end
50
50
  end
@@ -1,3 +1,3 @@
1
1
  module Searchkick
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.4"
3
3
  end
@@ -62,6 +62,13 @@ class TestInheritance < Minitest::Unit::TestCase
62
62
  assert_equal ["tiger"], Animal.search("tige", fields: [:name], suggest: true).suggestions.sort
63
63
  end
64
64
 
65
+ def test_reindex
66
+ store_names ["Bear A"], Cat
67
+ store_names ["Bear B"], Dog
68
+ Animal.reindex
69
+ assert_equal 1, Dog.search("bear").size
70
+ end
71
+
65
72
  # TODO move somewhere better
66
73
 
67
74
  def test_multiple_indices
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-01 00:00:00.000000000 Z
11
+ date: 2014-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel