elastic_searchable 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -4
- data/README.md +4 -0
- data/elastic_searchable.gemspec +6 -7
- data/lib/elastic_searchable.rb +3 -2
- data/lib/elastic_searchable/active_record_extensions.rb +2 -1
- data/lib/elastic_searchable/index.rb +9 -11
- data/lib/elastic_searchable/pagination/kaminari.rb +37 -0
- data/lib/elastic_searchable/pagination/will_paginate.rb +44 -0
- data/lib/elastic_searchable/paginator.rb +41 -0
- data/lib/elastic_searchable/queries.rb +5 -5
- data/lib/elastic_searchable/version.rb +1 -1
- data/test/helper.rb +1 -1
- data/test/setup_database.rb +0 -9
- data/test/test_elastic_searchable.rb +30 -12
- metadata +49 -54
data/.rvmrc
CHANGED
data/README.md
CHANGED
@@ -33,6 +33,10 @@ gem 'elastic_searchable'
|
|
33
33
|
# (optional) customize elasticsearch host
|
34
34
|
# default is localhost:9200
|
35
35
|
ElasticSearchable.base_uri = 'server:9200'
|
36
|
+
|
37
|
+
# (optional) customize elasticsearch paginator
|
38
|
+
# default is ElasticSearchable::Pagination::WillPaginate
|
39
|
+
ElasticSearchable::Paginator.handler = ElasticSearchable::Pagination::Kaminari
|
36
40
|
```
|
37
41
|
|
38
42
|
## Contributing
|
data/elastic_searchable.gemspec
CHANGED
@@ -8,22 +8,21 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Ryan Sonnek"]
|
10
10
|
s.email = ["ryan@codecrate.com"]
|
11
|
-
s.homepage = %q{http://github.com/
|
11
|
+
s.homepage = %q{http://github.com/socialcast/elastic_searchable}
|
12
12
|
s.summary = %q{elastic search for activerecord}
|
13
13
|
s.description = %q{integrate the elastic search engine with rails}
|
14
14
|
|
15
15
|
s.rubyforge_project = "elastic_searchable"
|
16
|
-
|
16
|
+
|
17
17
|
s.add_runtime_dependency(%q<activerecord>, [">= 3.0.5"])
|
18
|
-
s.add_runtime_dependency(%q<will_paginate>, [">= 3.0.pre2"])
|
19
18
|
s.add_runtime_dependency(%q<httparty>, ["~> 0.6.0"])
|
20
19
|
s.add_runtime_dependency(%q<backgrounded>, ["~> 0.7.0"])
|
20
|
+
s.add_runtime_dependency(%q<multi_json>, ["~> 1.0.0"])
|
21
|
+
s.add_development_dependency(%q<rake>, ["0.9.2"])
|
22
|
+
s.add_development_dependency(%q<sqlite3-ruby>, ["~> 1.3.2"])
|
23
|
+
s.add_development_dependency(%q<pry>, ["0.9.6.2"])
|
21
24
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
22
25
|
s.add_development_dependency(%q<mocha>, [">= 0"])
|
23
|
-
s.add_development_dependency(%q<bundler>, [">= 0"])
|
24
|
-
s.add_development_dependency(%q<rcov>, [">= 0"])
|
25
|
-
s.add_development_dependency(%q<sqlite3-ruby>, ["~> 1.3.2"])
|
26
|
-
s.add_development_dependency(%q<ruby-debug>, [">= 0"])
|
27
26
|
|
28
27
|
s.files = `git ls-files`.split("\n")
|
29
28
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/lib/elastic_searchable.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'httparty'
|
2
|
+
require 'multi_json'
|
2
3
|
require 'logger'
|
3
4
|
require 'elastic_searchable/active_record_extensions'
|
4
5
|
|
@@ -25,7 +26,7 @@ module ElasticSearchable
|
|
25
26
|
# encapsulate encoding hash into json string
|
26
27
|
# support Yajl encoder if installed
|
27
28
|
def encode_json(options = {})
|
28
|
-
|
29
|
+
MultiJson.encode options
|
29
30
|
end
|
30
31
|
# perform a request to the elasticsearch server
|
31
32
|
# configuration:
|
@@ -33,7 +34,7 @@ module ElasticSearchable
|
|
33
34
|
# ElasticSearchable.debug_output outputs all http traffic to console
|
34
35
|
def request(method, url, options = {})
|
35
36
|
options.merge! :headers => {'Content-Type' => 'application/json'}
|
36
|
-
options.merge! :body => ElasticSearchable.encode_json(options
|
37
|
+
options.merge! :body => ElasticSearchable.encode_json(options.delete(:json_body)) if options[:json_body]
|
37
38
|
|
38
39
|
response = self.send(method, url, options)
|
39
40
|
logger.debug "elasticsearch request: #{method} #{url} #{"took #{response['took']}ms" if response['took']}"
|
@@ -3,6 +3,7 @@ require 'backgrounded'
|
|
3
3
|
require 'elastic_searchable/queries'
|
4
4
|
require 'elastic_searchable/callbacks'
|
5
5
|
require 'elastic_searchable/index'
|
6
|
+
require 'elastic_searchable/paginator'
|
6
7
|
|
7
8
|
module ElasticSearchable
|
8
9
|
module ActiveRecordExtensions
|
@@ -11,7 +12,7 @@ module ElasticSearchable
|
|
11
12
|
# :type (optional) configue type to store data in. default to model table name
|
12
13
|
# :index_options (optional) configure index properties (ex: tokenizer)
|
13
14
|
# :mapping (optional) configure field properties for this model (ex: skip analyzer for field)
|
14
|
-
# :if (optional) reference symbol/proc condition to only index when condition is true
|
15
|
+
# :if (optional) reference symbol/proc condition to only index when condition is true
|
15
16
|
# :unless (optional) reference symbol/proc condition to skip indexing when condition is true
|
16
17
|
# :json (optional) configure the json document to be indexed (see http://api.rubyonrails.org/classes/ActiveModel/Serializers/JSON.html#method-i-as_json for available options)
|
17
18
|
#
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'will_paginate'
|
2
|
-
|
3
1
|
module ElasticSearchable
|
4
2
|
module Indexing
|
5
3
|
module ClassMethods
|
@@ -68,13 +66,13 @@ module ElasticSearchable
|
|
68
66
|
# TODO: move this to AREL relation to remove the options scope param
|
69
67
|
def reindex(options = {})
|
70
68
|
self.update_index_mapping
|
71
|
-
options.reverse_merge! :page => 1, :per_page => 1000
|
69
|
+
options.reverse_merge! :page => 1, :per_page => 1000
|
72
70
|
scope = options.delete(:scope) || self
|
73
|
-
|
74
|
-
|
71
|
+
page = options[:page]
|
72
|
+
per_page = options[:per_page]
|
73
|
+
records = scope.limit(per_page).offset(per_page * (page -1)).all
|
75
74
|
while records.any? do
|
76
|
-
ElasticSearchable.logger.debug "reindexing batch ##{
|
77
|
-
|
75
|
+
ElasticSearchable.logger.debug "reindexing batch ##{page}..."
|
78
76
|
actions = []
|
79
77
|
records.each do |record|
|
80
78
|
next unless record.should_index?
|
@@ -89,12 +87,12 @@ module ElasticSearchable
|
|
89
87
|
begin
|
90
88
|
ElasticSearchable.request(:put, '/_bulk', :body => "\n#{actions.join("\n")}\n") if actions.any?
|
91
89
|
rescue ElasticError => e
|
92
|
-
ElasticSearchable.logger.warn "Error indexing batch ##{
|
90
|
+
ElasticSearchable.logger.warn "Error indexing batch ##{page}: #{e.message}"
|
93
91
|
ElasticSearchable.logger.warn e
|
94
92
|
end
|
95
93
|
|
96
|
-
|
97
|
-
records = scope.
|
94
|
+
page += 1
|
95
|
+
records = scope.limit(per_page).offset(per_page* (page-1)).all
|
98
96
|
end
|
99
97
|
end
|
100
98
|
|
@@ -109,7 +107,7 @@ module ElasticSearchable
|
|
109
107
|
|
110
108
|
module InstanceMethods
|
111
109
|
# reindex the object in elasticsearch
|
112
|
-
# fires after_index callbacks after operation is complete
|
110
|
+
# fires after_index callbacks after operation is complete
|
113
111
|
# see http://www.elasticsearch.org/guide/reference/api/index_.html
|
114
112
|
def reindex(lifecycle = nil)
|
115
113
|
query = {}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module ElasticSearchable
|
2
|
+
module Pagination
|
3
|
+
class Kaminari < ::ElasticSearchable::Paginator
|
4
|
+
attr_accessor :page, :limit_value, :total_entries, :total_pages
|
5
|
+
|
6
|
+
def initialize(results, page, per_page, total = nil)
|
7
|
+
self.page = page
|
8
|
+
self.limit_value = per_page
|
9
|
+
self.total_entries = total if total
|
10
|
+
self.replace results
|
11
|
+
end
|
12
|
+
|
13
|
+
alias :current_page :page
|
14
|
+
alias :per_page :limit_value
|
15
|
+
|
16
|
+
# total item numbers of the original array
|
17
|
+
def total_count
|
18
|
+
total_entries
|
19
|
+
end
|
20
|
+
|
21
|
+
# Total number of pages
|
22
|
+
def num_pages
|
23
|
+
(total_count.to_f / per_page).ceil
|
24
|
+
end
|
25
|
+
|
26
|
+
# First page of the collection ?
|
27
|
+
def first_page?
|
28
|
+
current_page == 1
|
29
|
+
end
|
30
|
+
|
31
|
+
# Last page of the collection?
|
32
|
+
def last_page?
|
33
|
+
current_page >= num_pages
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module ElasticSearchable
|
2
|
+
module Pagination
|
3
|
+
class WillPaginate < ::ElasticSearchable::Paginator
|
4
|
+
attr_reader :current_page, :per_page, :total_entries, :total_pages
|
5
|
+
|
6
|
+
def initialize(results, page, per_page, total = nil)
|
7
|
+
@current_page = page.to_i
|
8
|
+
raise InvalidPage.new(page, @current_page) if @current_page < 1
|
9
|
+
@per_page = per_page.to_i
|
10
|
+
raise ArgumentError, "`per_page` setting cannot be less than 1 (#{@per_page} given)" if @per_page < 1
|
11
|
+
|
12
|
+
self.total_entries = total if total
|
13
|
+
self.replace results
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.create(page, per_page, total = nil)
|
17
|
+
pager = new(page, per_page, total)
|
18
|
+
yield pager
|
19
|
+
pager
|
20
|
+
end
|
21
|
+
|
22
|
+
def out_of_bounds?
|
23
|
+
current_page > total_pages
|
24
|
+
end
|
25
|
+
|
26
|
+
def offset
|
27
|
+
(current_page - 1) * per_page
|
28
|
+
end
|
29
|
+
|
30
|
+
def previous_page
|
31
|
+
current_page > 1 ? (current_page - 1) : nil
|
32
|
+
end
|
33
|
+
|
34
|
+
def next_page
|
35
|
+
current_page < total_pages ? (current_page + 1) : nil
|
36
|
+
end
|
37
|
+
|
38
|
+
def total_entries=(number)
|
39
|
+
@total_entries = number.to_i
|
40
|
+
@total_pages = (@total_entries / per_page.to_f).ceil
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
|
2
|
+
module ElasticSearchable
|
3
|
+
class Paginator < Array
|
4
|
+
class << self
|
5
|
+
def handler
|
6
|
+
@handler ||= ElasticSearchable::Pagination::WillPaginate
|
7
|
+
end
|
8
|
+
|
9
|
+
def handler=(handler)
|
10
|
+
@handler = handler
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# This is a magic wrapper for the original Array#replace method. It serves
|
15
|
+
# for populating the paginated collection after initialization.
|
16
|
+
#
|
17
|
+
# Why magic? Because it tries to guess the total number of entries judging
|
18
|
+
# by the size of given array. If it is shorter than +per_page+ limit, then we
|
19
|
+
# know we're on the last page. This trick is very useful for avoiding
|
20
|
+
# unnecessary hits to the database to do the counting after we fetched the
|
21
|
+
# data for the current page.
|
22
|
+
#
|
23
|
+
# However, after using +replace+ you should always test the value of
|
24
|
+
# +total_entries+ and set it to a proper value if it's +nil+. See the example
|
25
|
+
# in +create+.
|
26
|
+
def replace(array)
|
27
|
+
result = super
|
28
|
+
|
29
|
+
# The collection is shorter then page limit? Rejoice, because
|
30
|
+
# then we know that we are on the last page!
|
31
|
+
if total_entries.nil? and length < per_page and (current_page == 1 or length > 0)
|
32
|
+
self.total_entries = offset + length
|
33
|
+
end
|
34
|
+
|
35
|
+
result
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
require 'elastic_searchable/pagination/kaminari'
|
41
|
+
require 'elastic_searchable/pagination/will_paginate'
|
@@ -1,9 +1,11 @@
|
|
1
|
-
require 'will_paginate/collection'
|
2
|
-
|
3
1
|
module ElasticSearchable
|
4
2
|
module Queries
|
5
3
|
PER_PAGE_DEFAULT = 20
|
6
4
|
|
5
|
+
def per_page
|
6
|
+
PER_PAGE_DEFAULT
|
7
|
+
end
|
8
|
+
|
7
9
|
# search returns a will_paginate collection of ActiveRecord objects for the search results
|
8
10
|
# supported options:
|
9
11
|
# :page - page of results to search for
|
@@ -38,9 +40,7 @@ module ElasticSearchable
|
|
38
40
|
ids = hits['hits'].collect {|h| h['_id'].to_i }
|
39
41
|
results = self.find(ids).sort_by {|result| ids.index(result.id) }
|
40
42
|
|
41
|
-
|
42
|
-
page.replace results
|
43
|
-
page
|
43
|
+
ElasticSearchable::Paginator.handler.new(results, page, options[:size], hits['total'])
|
44
44
|
end
|
45
45
|
|
46
46
|
private
|
data/test/helper.rb
CHANGED
data/test/setup_database.rb
CHANGED
@@ -37,12 +37,3 @@ ActiveRecord::Schema.define(:version => 1) do
|
|
37
37
|
t.belongs_to :parent
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
41
|
-
if WillPaginate.respond_to?(:enable_activerecord)
|
42
|
-
puts 'configuring will_paginate v2.x'
|
43
|
-
WillPaginate.enable_activerecord
|
44
|
-
else
|
45
|
-
puts 'configuring will_paginate v3.x'
|
46
|
-
require 'will_paginate/finders/active_record'
|
47
|
-
WillPaginate::Finders::ActiveRecord.enable!
|
48
|
-
end
|
@@ -4,7 +4,7 @@ class TestElasticSearchable < Test::Unit::TestCase
|
|
4
4
|
def setup
|
5
5
|
delete_index
|
6
6
|
end
|
7
|
-
ElasticSearchable.debug_output
|
7
|
+
# ElasticSearchable.debug_output
|
8
8
|
SINGLE_NODE_CLUSTER_CONFIG = {'number_of_replicas' => 0, 'number_of_shards' => 1}
|
9
9
|
|
10
10
|
context 'non elastic activerecord class' do
|
@@ -194,7 +194,7 @@ class TestElasticSearchable < Test::Unit::TestCase
|
|
194
194
|
assert_nil @results.next_page
|
195
195
|
end
|
196
196
|
end
|
197
|
-
|
197
|
+
|
198
198
|
context 'searching for results using a query Hash' do
|
199
199
|
setup do
|
200
200
|
@results = Post.search({
|
@@ -244,7 +244,7 @@ class TestElasticSearchable < Test::Unit::TestCase
|
|
244
244
|
assert_equal @first_post, @results.last
|
245
245
|
end
|
246
246
|
end
|
247
|
-
|
247
|
+
|
248
248
|
context 'advanced sort options' do
|
249
249
|
setup do
|
250
250
|
@results = Post.search 'foo', :sort => [{:id => 'desc'}]
|
@@ -294,7 +294,7 @@ class TestElasticSearchable < Test::Unit::TestCase
|
|
294
294
|
'number_of_shards' => 1,
|
295
295
|
"analysis.analyzer.default.tokenizer" => 'standard',
|
296
296
|
"analysis.analyzer.default.filter" => ["standard", "lowercase", 'porterStem']},
|
297
|
-
:mapping => {:properties => {:name => {:type =>
|
297
|
+
:mapping => {:properties => {:name => {:type => 'string', :index => 'not_analyzed'}}}
|
298
298
|
end
|
299
299
|
context 'activerecord class with :index_options and :mapping' do
|
300
300
|
context 'creating index' do
|
@@ -302,7 +302,7 @@ class TestElasticSearchable < Test::Unit::TestCase
|
|
302
302
|
User.create_index
|
303
303
|
end
|
304
304
|
should 'have used custom index_options' do
|
305
|
-
@status = ElasticSearchable.request :get, '/elastic_searchable/
|
305
|
+
@status = ElasticSearchable.request :get, '/elastic_searchable/_settings'
|
306
306
|
expected = {
|
307
307
|
"index.number_of_replicas" => "0",
|
308
308
|
"index.number_of_shards" => "1",
|
@@ -311,18 +311,16 @@ class TestElasticSearchable < Test::Unit::TestCase
|
|
311
311
|
"index.analysis.analyzer.default.filter.1" => "lowercase",
|
312
312
|
"index.analysis.analyzer.default.filter.2" => "porterStem"
|
313
313
|
}
|
314
|
-
assert_equal expected, @status['
|
314
|
+
assert_equal expected, @status['elastic_searchable']['settings'], @status.inspect
|
315
315
|
end
|
316
316
|
should 'have set mapping' do
|
317
317
|
@status = ElasticSearchable.request :get, '/elastic_searchable/users/_mapping'
|
318
318
|
expected = {
|
319
|
-
"
|
320
|
-
"
|
321
|
-
"name"=> {"type"=>"string", "index"=>"not_analyzed"}
|
322
|
-
}
|
319
|
+
"properties"=> {
|
320
|
+
"name"=> {"type"=>"string", "index"=>"not_analyzed"}
|
323
321
|
}
|
324
322
|
}
|
325
|
-
assert_equal expected, @status['
|
323
|
+
assert_equal expected, @status['users'], @status.inspect
|
326
324
|
end
|
327
325
|
end
|
328
326
|
end
|
@@ -427,8 +425,25 @@ class TestElasticSearchable < Test::Unit::TestCase
|
|
427
425
|
@second = MaxPageSizeClass.create! :name => 'foo two'
|
428
426
|
MaxPageSizeClass.refresh_index
|
429
427
|
end
|
430
|
-
context 'MaxPageSizeClass.search with default options' do
|
428
|
+
context 'MaxPageSizeClass.search with default options and WillPaginate' do
|
429
|
+
setup do
|
430
|
+
ElasticSearchable::Paginator.handler = ElasticSearchable::Pagination::WillPaginate
|
431
|
+
@results = MaxPageSizeClass.search 'foo'
|
432
|
+
end
|
433
|
+
should 'have one per page' do
|
434
|
+
assert_equal 1, @results.per_page
|
435
|
+
end
|
436
|
+
should 'return one instance' do
|
437
|
+
assert_equal 1, @results.length
|
438
|
+
end
|
439
|
+
should 'have second page' do
|
440
|
+
assert_equal 2, @results.total_entries
|
441
|
+
end
|
442
|
+
end
|
443
|
+
|
444
|
+
context 'MaxPageSizeClass.search with default options and Kaminari' do
|
431
445
|
setup do
|
446
|
+
ElasticSearchable::Paginator.handler = ElasticSearchable::Pagination::Kaminari
|
432
447
|
@results = MaxPageSizeClass.search 'foo'
|
433
448
|
end
|
434
449
|
should 'have one per page' do
|
@@ -440,6 +455,9 @@ class TestElasticSearchable < Test::Unit::TestCase
|
|
440
455
|
should 'have second page' do
|
441
456
|
assert_equal 2, @results.total_entries
|
442
457
|
end
|
458
|
+
should 'have a total of 2 pages' do
|
459
|
+
assert_equal 2, @results.num_pages
|
460
|
+
end
|
443
461
|
end
|
444
462
|
end
|
445
463
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastic_searchable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 1.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Sonnek
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-20 00:00:00 -07:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: activerecord
|
@@ -34,98 +35,104 @@ dependencies:
|
|
34
35
|
type: :runtime
|
35
36
|
version_requirements: *id001
|
36
37
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
+
name: httparty
|
38
39
|
prerelease: false
|
39
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
42
|
requirements:
|
42
|
-
- -
|
43
|
+
- - ~>
|
43
44
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
45
|
+
hash: 7
|
45
46
|
segments:
|
46
|
-
- 3
|
47
47
|
- 0
|
48
|
-
-
|
49
|
-
-
|
50
|
-
version:
|
48
|
+
- 6
|
49
|
+
- 0
|
50
|
+
version: 0.6.0
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
54
|
+
name: backgrounded
|
55
55
|
prerelease: false
|
56
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
61
|
+
hash: 3
|
62
62
|
segments:
|
63
63
|
- 0
|
64
|
-
-
|
64
|
+
- 7
|
65
65
|
- 0
|
66
|
-
version: 0.
|
66
|
+
version: 0.7.0
|
67
67
|
type: :runtime
|
68
68
|
version_requirements: *id003
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: multi_json
|
71
71
|
prerelease: false
|
72
72
|
requirement: &id004 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
hash:
|
77
|
+
hash: 23
|
78
78
|
segments:
|
79
|
+
- 1
|
79
80
|
- 0
|
80
|
-
- 7
|
81
81
|
- 0
|
82
|
-
version: 0.
|
82
|
+
version: 1.0.0
|
83
83
|
type: :runtime
|
84
84
|
version_requirements: *id004
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
86
|
+
name: rake
|
87
87
|
prerelease: false
|
88
88
|
requirement: &id005 !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
91
|
-
- - "
|
91
|
+
- - "="
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
hash:
|
93
|
+
hash: 63
|
94
94
|
segments:
|
95
95
|
- 0
|
96
|
-
|
96
|
+
- 9
|
97
|
+
- 2
|
98
|
+
version: 0.9.2
|
97
99
|
type: :development
|
98
100
|
version_requirements: *id005
|
99
101
|
- !ruby/object:Gem::Dependency
|
100
|
-
name:
|
102
|
+
name: sqlite3-ruby
|
101
103
|
prerelease: false
|
102
104
|
requirement: &id006 !ruby/object:Gem::Requirement
|
103
105
|
none: false
|
104
106
|
requirements:
|
105
|
-
- -
|
107
|
+
- - ~>
|
106
108
|
- !ruby/object:Gem::Version
|
107
|
-
hash:
|
109
|
+
hash: 31
|
108
110
|
segments:
|
109
|
-
-
|
110
|
-
|
111
|
+
- 1
|
112
|
+
- 3
|
113
|
+
- 2
|
114
|
+
version: 1.3.2
|
111
115
|
type: :development
|
112
116
|
version_requirements: *id006
|
113
117
|
- !ruby/object:Gem::Dependency
|
114
|
-
name:
|
118
|
+
name: pry
|
115
119
|
prerelease: false
|
116
120
|
requirement: &id007 !ruby/object:Gem::Requirement
|
117
121
|
none: false
|
118
122
|
requirements:
|
119
|
-
- - "
|
123
|
+
- - "="
|
120
124
|
- !ruby/object:Gem::Version
|
121
|
-
hash:
|
125
|
+
hash: 27
|
122
126
|
segments:
|
123
127
|
- 0
|
124
|
-
|
128
|
+
- 9
|
129
|
+
- 6
|
130
|
+
- 2
|
131
|
+
version: 0.9.6.2
|
125
132
|
type: :development
|
126
133
|
version_requirements: *id007
|
127
134
|
- !ruby/object:Gem::Dependency
|
128
|
-
name:
|
135
|
+
name: shoulda
|
129
136
|
prerelease: false
|
130
137
|
requirement: &id008 !ruby/object:Gem::Requirement
|
131
138
|
none: false
|
@@ -139,25 +146,9 @@ dependencies:
|
|
139
146
|
type: :development
|
140
147
|
version_requirements: *id008
|
141
148
|
- !ruby/object:Gem::Dependency
|
142
|
-
name:
|
149
|
+
name: mocha
|
143
150
|
prerelease: false
|
144
151
|
requirement: &id009 !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
|
-
requirements:
|
147
|
-
- - ~>
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
hash: 31
|
150
|
-
segments:
|
151
|
-
- 1
|
152
|
-
- 3
|
153
|
-
- 2
|
154
|
-
version: 1.3.2
|
155
|
-
type: :development
|
156
|
-
version_requirements: *id009
|
157
|
-
- !ruby/object:Gem::Dependency
|
158
|
-
name: ruby-debug
|
159
|
-
prerelease: false
|
160
|
-
requirement: &id010 !ruby/object:Gem::Requirement
|
161
152
|
none: false
|
162
153
|
requirements:
|
163
154
|
- - ">="
|
@@ -167,7 +158,7 @@ dependencies:
|
|
167
158
|
- 0
|
168
159
|
version: "0"
|
169
160
|
type: :development
|
170
|
-
version_requirements: *
|
161
|
+
version_requirements: *id009
|
171
162
|
description: integrate the elastic search engine with rails
|
172
163
|
email:
|
173
164
|
- ryan@codecrate.com
|
@@ -191,13 +182,17 @@ files:
|
|
191
182
|
- lib/elastic_searchable/active_record_extensions.rb
|
192
183
|
- lib/elastic_searchable/callbacks.rb
|
193
184
|
- lib/elastic_searchable/index.rb
|
185
|
+
- lib/elastic_searchable/pagination/kaminari.rb
|
186
|
+
- lib/elastic_searchable/pagination/will_paginate.rb
|
187
|
+
- lib/elastic_searchable/paginator.rb
|
194
188
|
- lib/elastic_searchable/queries.rb
|
195
189
|
- lib/elastic_searchable/version.rb
|
196
190
|
- test/database.yml
|
197
191
|
- test/helper.rb
|
198
192
|
- test/setup_database.rb
|
199
193
|
- test/test_elastic_searchable.rb
|
200
|
-
|
194
|
+
has_rdoc: true
|
195
|
+
homepage: http://github.com/socialcast/elastic_searchable
|
201
196
|
licenses: []
|
202
197
|
|
203
198
|
post_install_message:
|
@@ -226,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
221
|
requirements: []
|
227
222
|
|
228
223
|
rubyforge_project: elastic_searchable
|
229
|
-
rubygems_version: 1.
|
224
|
+
rubygems_version: 1.5.3
|
230
225
|
signing_key:
|
231
226
|
specification_version: 3
|
232
227
|
summary: elastic search for activerecord
|