Commit 478d5fccb6ac18e4c08889d27de557f0fdc04a8d
1 parent
d0637c39
Exists in
master
and in
21 other branches
Added limit, offset, and explain
Showing
2 changed files
with
18 additions
and
0 deletions
Show diff stats
lib/searchkick/search.rb
test/searchkick_test.rb
... | ... | @@ -183,6 +183,21 @@ class TestSearchkick < Minitest::Unit::TestCase |
183 | 183 | assert_search "zero", ["Zero Boost A", "Zero Boost B", "Zero Boost C"] |
184 | 184 | end |
185 | 185 | |
186 | + # search method | |
187 | + | |
188 | + def test_limit | |
189 | + store_names ["Product A", "Product B"] | |
190 | + assert_equal 1, Product.search("Product", limit: 1).size | |
191 | + end | |
192 | + | |
193 | + def test_offset | |
194 | + store_names ["Product A", "Product B"] | |
195 | + assert_equal 1, Product.search("Product", offset: 1).size | |
196 | + end | |
197 | + | |
198 | + def test_where | |
199 | + end | |
200 | + | |
186 | 201 | protected |
187 | 202 | |
188 | 203 | def store(documents) | ... | ... |