searchkick 0.8.1 → 0.8.2

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: dfbf6c27b23821e31c3de0338259ee8c2adf5130
4
- data.tar.gz: f3b47e7a6d98f990f53d95410c88e2a2fc791b36
3
+ metadata.gz: 647df0215d082ec2eed37cabd3f1949aafc6c058
4
+ data.tar.gz: b3be78d876de64f7323fe31fbbe7829f7885ebc4
5
5
  SHA512:
6
- metadata.gz: 1b0d6d2d11bde9c7a3f316a6ac6dc4886f639b8a02ddc6b49e280ae0535b38f7f43e53e1507528587cdc578b0b1ad165816aa23b89d4e21043a4e480790f181c
7
- data.tar.gz: 39b962185cf9b507be764e1175e8bbe2d27822eed2005ad02923849577237c348d80b77e3ee8b3128676f7191ac43f23b2044075051751b532260a32597a877b
6
+ metadata.gz: 9326c663870b3dcf60384515ec29873a9b7c3ce6325922e3250ee0c7f75ebd933859d1a481275d035f2a8e00ac2b5c55ee0d342dfd55e698b575ca947f781f93
7
+ data.tar.gz: e6aaaa85a4ee9ccea8dba7bbd3077aef5164be1a5381ea60e1716881035050505575e1190494f9e53c1bef92b89852050b587a3fe3d84b4b35019eb9c8364ba8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.8.2
2
+
3
+ - Added `async` to `callbacks` option
4
+ - Added `wordnet` option
5
+ - Added `edit_distance` option to eventually replace `distance` option
6
+ - Catch misspelling of `misspellings` option
7
+ - Improved logging
8
+
1
9
  ## 0.8.1
2
10
 
3
11
  - Added `search_method_name` option
data/README.md CHANGED
@@ -243,6 +243,27 @@ end
243
243
 
244
244
  Call `Product.reindex` after changing synonyms.
245
245
 
246
+ ### WordNet
247
+
248
+ Prepopulate English synonyms with the [WordNet database](http://en.wikipedia.org/wiki/WordNet).
249
+
250
+ Download [WordNet 3.0](http://wordnetcode.princeton.edu/3.0/WNprolog-3.0.tar.gz) to each Elasticsearch server and move `wn_s.pl` to the `/var/lib` directory.
251
+
252
+ ```sh
253
+ cd /tmp
254
+ curl -o wordnet.tar.gz http://wordnetcode.princeton.edu/3.0/WNprolog-3.0.tar.gz
255
+ tar -zxvf wordnet.tar.gz
256
+ mv prolog/wn_s.pl /var/lib
257
+ ```
258
+
259
+ Tell each model to use it:
260
+
261
+ ```ruby
262
+ class Product < ActiveRecord::Base
263
+ searchkick wordnet: true
264
+ end
265
+ ```
266
+
246
267
  ### Misspellings
247
268
 
248
269
  By default, Searchkick handles misspelled queries by returning results with an [edit distance](http://en.wikipedia.org/wiki/Levenshtein_distance) of one. To turn off this feature, use:
@@ -254,7 +275,7 @@ Product.search "zuchini", misspellings: false # no zucchini
254
275
  You can also change the edit distance with:
255
276
 
256
277
  ```ruby
257
- Product.search "zucini", misspellings: {distance: 2} # zucchini
278
+ Product.search "zucini", misspellings: {edit_distance: 2} # zucchini
258
279
  ```
259
280
 
260
281
  ### Indexing
@@ -303,7 +324,36 @@ end
303
324
  #### No need to reindex
304
325
 
305
326
  - App starts
306
- - Records are inserted, updated or deleted (syncs automatically)
327
+
328
+ ### Stay Synced
329
+
330
+ There are three strategies for keeping the index synced with your database.
331
+
332
+ 1. Immediate (default)
333
+
334
+ Anytime a record is inserted, updated, or deleted
335
+
336
+ 2. Asynchronous
337
+
338
+ Use background jobs for better performance
339
+
340
+ ```ruby
341
+ class Product < ActiveRecord::Base
342
+ searchkick callbacks: :async
343
+ end
344
+ ```
345
+
346
+ Supports [Delayed Job](https://github.com/collectiveidea/delayed_job) only at the moment
347
+
348
+ 3. Manual
349
+
350
+ Turn off automatic syncing
351
+
352
+ ```ruby
353
+ class Product < ActiveRecord::Base
354
+ searchkick callbacks: false
355
+ end
356
+ ```
307
357
 
308
358
  ### Keep Getting Better
309
359
 
@@ -742,15 +792,7 @@ class Product < ActiveRecord::Base
742
792
  end
743
793
  ```
744
794
 
745
- Turn off callbacks permanently
746
-
747
- ```ruby
748
- class Product < ActiveRecord::Base
749
- searchkick callbacks: false
750
- end
751
- ```
752
-
753
- or temporarily
795
+ Turn off callbacks temporarily
754
796
 
755
797
  ```ruby
756
798
  Product.disable_search_callbacks # or use Searchkick.disable_callbacks for all models
@@ -794,25 +836,20 @@ class Product < ActiveRecord::Base
794
836
  end
795
837
  ```
796
838
 
797
- Asynchronous reindexing
839
+ Reindex asynchronously
798
840
 
799
841
  ```ruby
800
842
  class Product < ActiveRecord::Base
801
843
  searchkick callbacks: false
802
844
 
803
- # add the callbacks manually
804
-
805
- # ActiveRecord - one callback
806
- after_commit :reindex_async
807
-
808
- # Mongoid - two callbacks
809
- after_save :reindex_async
810
- after_destroy :reindex_async
811
-
812
845
  def reindex_async
813
- # delayed job
814
- delay.reindex
846
+ # custom code to reindex
815
847
  end
848
+
849
+ after_commit :reindex_async
850
+ # or for Mongoid
851
+ # after_save :reindex_async
852
+ # after_destroy :reindex_async
816
853
  end
817
854
  ```
818
855
 
data/lib/searchkick.rb CHANGED
@@ -7,6 +7,7 @@ require "searchkick/reindex"
7
7
  require "searchkick/results"
8
8
  require "searchkick/query"
9
9
  require "searchkick/similar"
10
+ require "searchkick/reindex_job"
10
11
  require "searchkick/model"
11
12
  require "searchkick/tasks"
12
13
  require "searchkick/logging" if defined?(Rails)
@@ -17,9 +18,13 @@ module Searchkick
17
18
  class InvalidQueryError < Elasticsearch::Transport::Transport::Errors::BadRequest; end
18
19
 
19
20
  class << self
21
+ attr_accessor :callbacks
20
22
  attr_accessor :search_method_name
23
+ attr_accessor :wordnet_path
21
24
  end
25
+ self.callbacks = true
22
26
  self.search_method_name = :search
27
+ self.wordnet_path = "/var/lib/wn_s.pl"
23
28
 
24
29
  def self.client
25
30
  @client ||= Elasticsearch::Client.new(url: ENV["ELASTICSEARCH_URL"])
@@ -33,18 +38,16 @@ module Searchkick
33
38
  @server_version ||= client.info["version"]["number"]
34
39
  end
35
40
 
36
- @callbacks = true
37
-
38
41
  def self.enable_callbacks
39
- @callbacks = true
42
+ self.callbacks = true
40
43
  end
41
44
 
42
45
  def self.disable_callbacks
43
- @callbacks = false
46
+ self.callbacks = false
44
47
  end
45
48
 
46
49
  def self.callbacks?
47
- @callbacks
50
+ callbacks
48
51
  end
49
52
  end
50
53
 
@@ -11,10 +11,44 @@ module Searchkick
11
11
  execute_without_instrumentation
12
12
  end
13
13
  end
14
-
15
14
  alias_method_chain :execute, :instrumentation
16
15
  end
17
16
 
17
+ class Index
18
+ def store_with_instrumentation(record)
19
+ event = {
20
+ name: "#{record.searchkick_klass.name} Store",
21
+ id: search_id(record)
22
+ }
23
+ ActiveSupport::Notifications.instrument("request.searchkick", event) do
24
+ store_without_instrumentation(record)
25
+ end
26
+ end
27
+ alias_method_chain :store, :instrumentation
28
+
29
+ def remove_with_instrumentation(record)
30
+ event = {
31
+ name: "#{record.searchkick_klass.name} Remove",
32
+ id: search_id(record)
33
+ }
34
+ ActiveSupport::Notifications.instrument("request.searchkick", event) do
35
+ remove_without_instrumentation(record)
36
+ end
37
+ end
38
+ alias_method_chain :remove, :instrumentation
39
+
40
+ def import_with_instrumentation(records)
41
+ event = {
42
+ name: "#{records.first.searchkick_klass.name} Import",
43
+ count: records.size
44
+ }
45
+ ActiveSupport::Notifications.instrument("request.searchkick", event) do
46
+ import_without_instrumentation(records)
47
+ end
48
+ end
49
+ alias_method_chain :import, :instrumentation
50
+ end
51
+
18
52
  # https://github.com/rails/rails/blob/master/activerecord/lib/active_record/log_subscriber.rb
19
53
  class LogSubscriber < ActiveSupport::LogSubscriber
20
54
  def self.runtime=(value)
@@ -43,6 +77,16 @@ module Searchkick
43
77
  host = Searchkick.client.transport.hosts.first
44
78
  debug " #{color(name, YELLOW, true)} curl #{host[:protocol]}://#{host[:host]}:#{host[:port]}/#{CGI.escape(index)}#{type ? "/#{type.map{|t| CGI.escape(t) }.join(",")}" : ""}/_search?pretty -d '#{payload[:query][:body].to_json}'"
45
79
  end
80
+
81
+ def request(event)
82
+ self.class.runtime += event.duration
83
+ return unless logger.debug?
84
+
85
+ payload = event.payload
86
+ name = "#{payload[:name]} (#{event.duration.round(1)}ms)"
87
+
88
+ debug " #{color(name, YELLOW, true)} #{payload.except(:name).to_json}"
89
+ end
46
90
  end
47
91
 
48
92
  # https://github.com/rails/rails/blob/master/activerecord/lib/active_record/railties/controller_runtime.rb
@@ -7,10 +7,12 @@ module Searchkick
7
7
  class_eval do
8
8
  cattr_reader :searchkick_options, :searchkick_env, :searchkick_klass
9
9
 
10
+ callbacks = options.has_key?(:callbacks) ? options[:callbacks] : true
11
+
10
12
  class_variable_set :@@searchkick_options, options.dup
11
13
  class_variable_set :@@searchkick_env, ENV["RACK_ENV"] || ENV["RAILS_ENV"] || "development"
12
14
  class_variable_set :@@searchkick_klass, self
13
- class_variable_set :@@searchkick_callbacks, options[:callbacks] != false
15
+ class_variable_set :@@searchkick_callbacks, callbacks
14
16
  class_variable_set :@@searchkick_index, options[:index_name] || [options[:index_prefix], model_name.plural, searchkick_env].compact.join("_")
15
17
 
16
18
  def self.searchkick_index
@@ -30,11 +32,20 @@ module Searchkick
30
32
  extend Searchkick::Reindex
31
33
  include Searchkick::Similar
32
34
 
33
- if respond_to?(:after_commit)
34
- after_commit :reindex, if: proc{ self.class.search_callbacks? }
35
- else
36
- after_save :reindex, if: proc{ self.class.search_callbacks? }
37
- after_destroy :reindex, if: proc{ self.class.search_callbacks? }
35
+ if callbacks == :async
36
+ def reindex_async
37
+ Delayed::Job.enqueue Searchkick::ReindexJob.new(self.class.name, id)
38
+ end
39
+ end
40
+
41
+ if callbacks
42
+ callback_name = callbacks == :async ? :reindex_async : :reindex
43
+ if respond_to?(:after_commit)
44
+ after_commit callback_name, if: proc{ self.class.search_callbacks? }
45
+ else
46
+ after_save callback_name, if: proc{ self.class.search_callbacks? }
47
+ after_destroy callback_name, if: proc{ self.class.search_callbacks? }
48
+ end
38
49
  end
39
50
 
40
51
  def self.enable_search_callbacks
@@ -102,11 +102,12 @@ module Searchkick
102
102
  shared_options.merge(boost: 10 * factor, analyzer: "searchkick_search"),
103
103
  shared_options.merge(boost: 10 * factor, analyzer: "searchkick_search2")
104
104
  ]
105
- if options[:misspellings] != false
106
- distance = (options[:misspellings].is_a?(Hash) && options[:misspellings][:distance]) || 1
105
+ misspellings = options.has_key?(:misspellings) ? options[:misspellings] : options[:mispellings] # why not?
106
+ if misspellings != false
107
+ edit_distance = (misspellings.is_a?(Hash) && (misspellings[:edit_distance] || misspellings[:distance])) || 1
107
108
  qs.concat [
108
- shared_options.merge(fuzziness: distance, max_expansions: 3, analyzer: "searchkick_search"),
109
- shared_options.merge(fuzziness: distance, max_expansions: 3, analyzer: "searchkick_search2")
109
+ shared_options.merge(fuzziness: edit_distance, max_expansions: 3, analyzer: "searchkick_search"),
110
+ shared_options.merge(fuzziness: edit_distance, max_expansions: 3, analyzer: "searchkick_search2")
110
111
  ]
111
112
  end
112
113
  elsif field.end_with?(".exact")
@@ -230,6 +230,17 @@ module Searchkick
230
230
  settings[:analysis][:analyzer][:default_index][:filter] << "searchkick_synonym"
231
231
  end
232
232
 
233
+ if options[:wordnet]
234
+ settings[:analysis][:filter][:searchkick_wordnet] = {
235
+ type: "synonym",
236
+ format: "wordnet",
237
+ synonyms_path: Searchkick.wordnet_path
238
+ }
239
+
240
+ settings[:analysis][:analyzer][:default_index][:filter].insert(4, "searchkick_wordnet")
241
+ settings[:analysis][:analyzer][:default_index][:filter] << "searchkick_wordnet"
242
+ end
243
+
233
244
  if options[:special_characters] == false
234
245
  settings[:analysis][:analyzer].each do |analyzer, analyzer_settings|
235
246
  analyzer_settings[:filter].reject!{|f| f == "asciifolding" }
@@ -0,0 +1,28 @@
1
+ module Searchkick
2
+ class ReindexJob
3
+
4
+ def initialize(klass, id)
5
+ @klass = klass
6
+ @id = id
7
+ end
8
+
9
+ def perform
10
+ model = @klass.constantize
11
+ record = model.find(@id) rescue nil # TODO fix lazy coding
12
+ index = model.searchkick_index
13
+ if !record or !record.should_index?
14
+ # hacky
15
+ record ||= model.new
16
+ record.id = @id
17
+ begin
18
+ index.remove record
19
+ rescue Elasticsearch::Transport::Transport::Errors::NotFound
20
+ # do nothing
21
+ end
22
+ else
23
+ index.store record
24
+ end
25
+ end
26
+
27
+ end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module Searchkick
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
data/searchkick.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency "elasticsearch", ">= 1"
23
23
  spec.add_dependency "hashie"
24
24
 
25
- spec.add_development_dependency "bundler", "~> 1.3"
25
+ spec.add_development_dependency "bundler", "~> 1.6"
26
26
  spec.add_development_dependency "rake"
27
- spec.add_development_dependency "minitest", "~> 4.7"
27
+ spec.add_development_dependency "minitest"
28
28
  end
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestAutocomplete < Minitest::Unit::TestCase
3
+ class TestAutocomplete < Minitest::Test
4
4
 
5
5
  def test_autocomplete
6
6
  store_names ["Hummus"]
data/test/boost_test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestBoost < Minitest::Unit::TestCase
3
+ class TestBoost < Minitest::Test
4
4
 
5
5
  # conversions
6
6
 
data/test/facets_test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestFacets < Minitest::Unit::TestCase
3
+ class TestFacets < Minitest::Test
4
4
 
5
5
  def setup
6
6
  super
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestHighlight < Minitest::Unit::TestCase
3
+ class TestHighlight < Minitest::Test
4
4
 
5
5
  def test_basic
6
6
  store_names ["Two Door Cinema Club"]
data/test/index_test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestIndex < Minitest::Unit::TestCase
3
+ class TestIndex < Minitest::Test
4
4
 
5
5
  def test_clean_indices
6
6
  old_index = Searchkick::Index.new("products_test_20130801000000000")
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestInheritance < Minitest::Unit::TestCase
3
+ class TestInheritance < Minitest::Test
4
4
 
5
5
  def test_child_reindex
6
6
  store_names ["Max"], Cat
data/test/match_test.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative "test_helper"
4
4
 
5
- class TestMatch < Minitest::Unit::TestCase
5
+ class TestMatch < Minitest::Test
6
6
 
7
7
  # exact
8
8
 
data/test/model_test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestModel < Minitest::Unit::TestCase
3
+ class TestModel < Minitest::Test
4
4
 
5
5
  def test_disable_callbacks_model
6
6
  store_names ["product a"]
data/test/query_test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestQuery < Minitest::Unit::TestCase
3
+ class TestQuery < Minitest::Test
4
4
 
5
5
  def test_basic
6
6
  store_names ["Milk", "Apple"]
@@ -0,0 +1,33 @@
1
+ require_relative "test_helper"
2
+
3
+ class TestReindexJob < Minitest::Test
4
+
5
+ def setup
6
+ super
7
+ Searchkick.disable_callbacks
8
+ end
9
+
10
+ def teardown
11
+ Searchkick.enable_callbacks
12
+ end
13
+
14
+ def test_create
15
+ product = Product.create!(name: "Boom")
16
+ Product.searchkick_index.refresh
17
+ assert_search "*", []
18
+ Searchkick::ReindexJob.new("Product", product.id).perform
19
+ Product.searchkick_index.refresh
20
+ assert_search "*", ["Boom"]
21
+ end
22
+
23
+ def test_destroy
24
+ product = Product.create!(name: "Boom")
25
+ Product.reindex
26
+ assert_search "*", ["Boom"]
27
+ product.destroy
28
+ Searchkick::ReindexJob.new("Product", product.id).perform
29
+ Product.searchkick_index.refresh
30
+ assert_search "*", []
31
+ end
32
+
33
+ end
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestShouldIndex < Minitest::Unit::TestCase
3
+ class TestShouldIndex < Minitest::Test
4
4
 
5
5
  def test_basic
6
6
  store_names ["INDEX", "DO NOT INDEX"]
data/test/similar_test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestSimilar < Minitest::Unit::TestCase
3
+ class TestSimilar < Minitest::Test
4
4
 
5
5
  def test_similar
6
6
  store_names ["Annie's Naturals Organic Shiitake & Sesame Dressing"]
data/test/sql_test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestSql < Minitest::Unit::TestCase
3
+ class TestSql < Minitest::Test
4
4
 
5
5
  def test_limit
6
6
  store_names ["Product A", "Product B", "Product C", "Product D"]
data/test/suggest_test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestSuggest < Minitest::Unit::TestCase
3
+ class TestSuggest < Minitest::Test
4
4
 
5
5
  def test_basic
6
6
  store_names ["Great White Shark", "Hammerhead Shark", "Tiger Shark"]
@@ -1,6 +1,6 @@
1
1
  require_relative "test_helper"
2
2
 
3
- class TestSynonyms < Minitest::Unit::TestCase
3
+ class TestSynonyms < Minitest::Test
4
4
 
5
5
  def test_bleach
6
6
  store_names ["Clorox Bleach", "Kroger Bleach"]
@@ -42,4 +42,9 @@ class TestSynonyms < Minitest::Unit::TestCase
42
42
  assert_search "scallions", ["Green Onions"]
43
43
  end
44
44
 
45
+ # def test_wordnet
46
+ # store_names ["Creature", "Beast", "Dragon"], Animal
47
+ # assert_search "animal", ["Creature", "Beast"], {}, Animal
48
+ # end
49
+
45
50
  end
data/test/test_helper.rb CHANGED
@@ -6,6 +6,8 @@ require "logger"
6
6
 
7
7
  ENV["RACK_ENV"] = "test"
8
8
 
9
+ Minitest::Test = Minitest::Unit::TestCase unless defined?(Minitest::Test)
10
+
9
11
  File.delete("elasticsearch.log") if File.exists?("elasticsearch.log")
10
12
  Searchkick.client.transport.logger = Logger.new("elasticsearch.log")
11
13
 
@@ -169,7 +171,11 @@ class Store
169
171
  end
170
172
 
171
173
  class Animal
172
- searchkick autocomplete: [:name], suggest: [:name], index_name: -> { "#{self.name.tableize}-#{Date.today.year}" }
174
+ searchkick \
175
+ autocomplete: [:name],
176
+ suggest: [:name],
177
+ index_name: -> { "#{self.name.tableize}-#{Date.today.year}" }
178
+ # wordnet: true
173
179
  end
174
180
 
175
181
  Product.searchkick_index.delete if Product.searchkick_index.exists?
@@ -179,7 +185,7 @@ Product.reindex # run twice for both index paths
179
185
  Store.reindex
180
186
  Animal.reindex
181
187
 
182
- class Minitest::Unit::TestCase
188
+ class Minitest::Test
183
189
 
184
190
  def setup
185
191
  Product.destroy_all
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.8.1
4
+ version: 0.8.2
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-08-16 00:00:00.000000000 Z
11
+ date: 2014-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.3'
61
+ version: '1.6'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.3'
68
+ version: '1.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: minitest
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '4.7'
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '4.7'
96
+ version: '0'
97
97
  description: Intelligent search made easy
98
98
  email:
99
99
  - andrew@chartkick.com
@@ -117,8 +117,8 @@ files:
117
117
  - lib/searchkick/model.rb
118
118
  - lib/searchkick/query.rb
119
119
  - lib/searchkick/reindex.rb
120
+ - lib/searchkick/reindex_job.rb
120
121
  - lib/searchkick/results.rb
121
- - lib/searchkick/search.rb
122
122
  - lib/searchkick/similar.rb
123
123
  - lib/searchkick/tasks.rb
124
124
  - lib/searchkick/version.rb
@@ -132,6 +132,7 @@ files:
132
132
  - test/match_test.rb
133
133
  - test/model_test.rb
134
134
  - test/query_test.rb
135
+ - test/reindex_job_test.rb
135
136
  - test/should_index_test.rb
136
137
  - test/similar_test.rb
137
138
  - test/sql_test.rb
@@ -174,6 +175,7 @@ test_files:
174
175
  - test/match_test.rb
175
176
  - test/model_test.rb
176
177
  - test/query_test.rb
178
+ - test/reindex_job_test.rb
177
179
  - test/should_index_test.rb
178
180
  - test/similar_test.rb
179
181
  - test/sql_test.rb
@@ -1,14 +0,0 @@
1
- module Searchkick
2
- module Search
3
-
4
- def search(term = nil, options = {})
5
- query = Searchkick::Query.new(self, term, options)
6
- if options[:execute] == false
7
- query
8
- else
9
- query.execute
10
- end
11
- end
12
-
13
- end
14
- end