elasticsearch_autocomplete 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -40,7 +40,7 @@ module ElasticsearchAutocomplete
|
|
40
40
|
def ac_search(query, options={})
|
41
41
|
options.reverse_merge!({:per_page => 50, :search_fields => ac_search_fields})
|
42
42
|
|
43
|
-
tire.search :per_page => options[:per_page] do
|
43
|
+
tire.search :per_page => options[:per_page], :page => options[:page] do
|
44
44
|
query do
|
45
45
|
if query.size.zero?
|
46
46
|
all
|
@@ -61,4 +61,10 @@ describe 'search filters' do
|
|
61
61
|
it 'limit suggestions collection size' do
|
62
62
|
model.ac_search('Laura', :per_page => 1).to_a.should have(1).result
|
63
63
|
end
|
64
|
+
|
65
|
+
it 'paginate suggestions' do
|
66
|
+
res = model.ac_search('Laura', :per_page => 1, :page => 2).to_a
|
67
|
+
res.should have(1).result
|
68
|
+
res.first.full_name.should == 'Laura Flores'
|
69
|
+
end
|
64
70
|
end
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: elasticsearch_autocomplete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Alex Leschenko
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
segments:
|
116
116
|
- 0
|
117
|
-
hash:
|
117
|
+
hash: 4258391315820171784
|
118
118
|
none: false
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
segments:
|
125
125
|
- 0
|
126
|
-
hash:
|
126
|
+
hash: 4258391315820171784
|
127
127
|
none: false
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|