searchkick 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/README.md +11 -8
- data/lib/searchkick/search.rb +1 -2
- data/lib/searchkick/version.rb +1 -1
- data/test/searchkick_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cffaa2412f04c693b99dbd54f530b22f7ab32c53
|
4
|
+
data.tar.gz: 2dd98e1341946940a3cb0997400fe88d2687f540
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16f646bd8e81672e98dc619d25814f071037b3522d63d235e64ee2aa7af782c483ab08e139411dd0a7501bb1e73163b475b9fffb69b44483525ad01d8f4b6981
|
7
|
+
data.tar.gz: 95b73d727ddbe424a8e9167dd2b62c2fead9fefe326a08a6da3c26cf98a33d8d824cc2c2f68921dca25b1167e26baced0cf80a802b1c976f4049a87e4cef1fec
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Searchkick
|
2
2
|
|
3
|
-
:rocket:
|
3
|
+
:rocket: Intelligent search made easy
|
4
4
|
|
5
|
-
Searchkick
|
5
|
+
Searchkick learns what **your users** are looking for. As more people search, it gets smarter and the results get better. It’s friendly for developers - and magical for your users.
|
6
|
+
|
7
|
+
Searchkick handles:
|
6
8
|
|
7
9
|
- stemming - `tomatoes` matches `tomato`
|
8
10
|
- special characters - `jalapeno` matches `jalapeño`
|
@@ -14,7 +16,6 @@ Plus:
|
|
14
16
|
|
15
17
|
- query like SQL - no need to learn a new query language
|
16
18
|
- reindex without downtime
|
17
|
-
- continually improve results from conversions - **pretty awesome**
|
18
19
|
|
19
20
|
:tangerine: Battle-tested at [Instacart](https://www.instacart.com)
|
20
21
|
|
@@ -140,7 +141,7 @@ You must call `Product.reindex` after changing synonyms.
|
|
140
141
|
|
141
142
|
### Indexing
|
142
143
|
|
143
|
-
|
144
|
+
Control what data is indexed with the `search_data` method.
|
144
145
|
|
145
146
|
```ruby
|
146
147
|
class Product < ActiveRecord::Base
|
@@ -168,9 +169,11 @@ end
|
|
168
169
|
|
169
170
|
### Continually Improve Results
|
170
171
|
|
171
|
-
|
172
|
+
Searchkick uses conversion data to learn what users are looking for.
|
173
|
+
|
174
|
+
First, choose a conversion metric for your application. At Instacart, an item added to the cart is a conversion.
|
172
175
|
|
173
|
-
|
176
|
+
Next, track the conversions. The database works well for low volume, but feel free to use Redis or another datastore.
|
174
177
|
|
175
178
|
```ruby
|
176
179
|
class Search < ActiveRecord::Base
|
@@ -194,10 +197,10 @@ class Product < ActiveRecord::Base
|
|
194
197
|
end
|
195
198
|
```
|
196
199
|
|
197
|
-
Reindex and
|
200
|
+
Reindex and set up a cron job to add new conversions daily.
|
198
201
|
|
199
202
|
```ruby
|
200
|
-
|
203
|
+
heroku run rake searchkick:reindex CLASS=Product
|
201
204
|
```
|
202
205
|
|
203
206
|
### Facets
|
data/lib/searchkick/search.rb
CHANGED
@@ -32,8 +32,7 @@ module Searchkick
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
|
-
|
36
|
-
if options[:conversions]
|
35
|
+
unless options[:conversions] == false
|
37
36
|
should do
|
38
37
|
nested path: "conversions", score_mode: "total" do
|
39
38
|
query do
|
data/lib/searchkick/version.rb
CHANGED
data/test/searchkick_test.rb
CHANGED
@@ -280,7 +280,7 @@ class TestSearchkick < Minitest::Unit::TestCase
|
|
280
280
|
end
|
281
281
|
|
282
282
|
def assert_search(term, expected, options = {})
|
283
|
-
assert_equal expected, Product.search(term, options.merge(fields: [:name]
|
283
|
+
assert_equal expected, Product.search(term, options.merge(fields: [:name])).map(&:name)
|
284
284
|
end
|
285
285
|
|
286
286
|
end
|
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.1.
|
4
|
+
version: 0.1.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: 2013-07-
|
11
|
+
date: 2013-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tire
|