elastic_record 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'elastic_record'
5
- s.version = '0.4.1'
5
+ s.version = '0.5.0'
6
6
  s.summary = 'Use Elastic Search with your objects'
7
7
  s.description = 'Find your records with elastic search'
8
8
 
@@ -1,5 +1,7 @@
1
1
  require 'arelastic'
2
2
  require 'rubberband'
3
+ require 'active_support/core_ext/object/blank' # required because ActiveModel depends on this but does not require it
4
+ require 'active_model'
3
5
 
4
6
  module ElasticRecord
5
7
  autoload :Callbacks, 'elastic_record/callbacks'
@@ -1,12 +1,15 @@
1
1
  require 'elastic_record/index/documents'
2
2
  require 'elastic_record/index/manage'
3
3
  require 'elastic_record/index/mapping'
4
+ require 'elastic_record/index/percolator'
5
+ require 'net/http'
4
6
 
5
7
  module ElasticRecord
6
8
  class Index
7
9
  include Documents
8
10
  include Manage
9
11
  include Mapping
12
+ include Percolator
10
13
 
11
14
  attr_accessor :model
12
15
  attr_accessor :disabled
@@ -32,25 +35,46 @@ module ElasticRecord
32
35
  @disabled = false
33
36
  end
34
37
 
35
- private
38
+ # private
36
39
  def new_index_name
37
40
  "#{alias_name}_#{Time.now.to_i}"
38
41
  end
39
42
 
40
- def json_get(path)
41
- ActiveSupport::JSON.decode http.get(path).body
43
+ def head(path)
44
+ http_request(Net::HTTP::Head, path).code
42
45
  end
43
46
 
44
- def json_post(path, json)
45
- http.post(path, ActiveSupport::JSON.encode(json))
47
+ def json_get(path, json = nil)
48
+ json_request Net::HTTP::Get, path, json
46
49
  end
47
50
 
48
- def json_put(path, json)
49
- http.put(path, ActiveSupport::JSON.encode(json))
51
+ def json_post(path, json = nil)
52
+ json_request Net::HTTP::Post, path, json
50
53
  end
51
54
 
52
- def json_delete(path)
53
- ActiveSupport::JSON.decode http.delete(path).body
55
+ def json_put(path, json = nil)
56
+ json_request Net::HTTP::Put, path, json
57
+ end
58
+
59
+ def json_delete(path, json = nil)
60
+ json_request Net::HTTP::Delete, path, json
61
+ end
62
+
63
+ def json_request(request_klass, path, json)
64
+ body = json ? ActiveSupport::JSON.encode(json) : nil
65
+ response = http_request(request_klass, path, body)
66
+ json = ActiveSupport::JSON.decode response.body
67
+
68
+ raise json['error'] if json['error']
69
+
70
+ json
71
+ end
72
+
73
+ def http_request(request_klass, path, body = nil)
74
+ request = request_klass.new(path)
75
+ request.body = body
76
+
77
+ http.request(request)
54
78
  end
55
79
 
56
80
  def connection
@@ -8,13 +8,13 @@ module ElasticRecord
8
8
  end
9
9
 
10
10
  def create(index_name = new_index_name)
11
- http.put("/#{index_name}", '')
11
+ json_put "/#{index_name}"
12
12
  update_mapping(index_name)
13
13
  index_name
14
14
  end
15
15
 
16
16
  def delete(index_name)
17
- http.delete("/#{index_name}")
17
+ json_delete "/#{index_name}"
18
18
  end
19
19
 
20
20
  def delete_all
@@ -24,7 +24,7 @@ module ElasticRecord
24
24
  end
25
25
 
26
26
  def exists?(index_name)
27
- http.head("/#{index_name}").code == '200'
27
+ head("/#{index_name}") == '200'
28
28
  end
29
29
 
30
30
  def deploy(index_name)
@@ -50,7 +50,6 @@ module ElasticRecord
50
50
  end
51
51
 
52
52
  def update_mapping(index_name)
53
- # connection.update_mapping(mapping, index: index_name)
54
53
  json_put "/#{index_name}/#{type}/_mapping", type => mapping
55
54
  end
56
55
 
@@ -0,0 +1,31 @@
1
+ module ElasticRecord
2
+ class Index
3
+ module Percolator
4
+ def create_percolator(name, elastic_query)
5
+ unless exists? percolator_index_name
6
+ create percolator_index_name
7
+ else
8
+ update_mapping percolator_index_name
9
+ end
10
+
11
+ json_put "/_percolator/#{percolator_index_name}/#{name}", elastic_query
12
+ end
13
+
14
+ def delete_percolator(name)
15
+ json_delete "/_percolator/#{percolator_index_name}/#{name}"
16
+ end
17
+
18
+ def percolator_exists?(name)
19
+ json_get("/_percolator/#{percolator_index_name}/#{name}")['exists']
20
+ end
21
+
22
+ def percolate(document)
23
+ json_get("/#{percolator_index_name}/#{type}/_percolate", 'doc' => document)['matches']
24
+ end
25
+
26
+ def percolator_index_name
27
+ @percolator_index_name ||= "percolate_#{alias_name}"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -25,6 +25,10 @@ module ElasticRecord
25
25
  to_hits.facets
26
26
  end
27
27
 
28
+ def create_percolator(name)
29
+ klass.elastic_index.create_percolator(name, as_elastic)
30
+ end
31
+
28
32
  def reset
29
33
  @hits = @records = nil
30
34
  end
@@ -1,26 +1,28 @@
1
1
  module ElasticRecord
2
- module Batches
3
- def find_each
4
- find_in_batches do |records|
5
- records.each { |record| yield record }
2
+ class Relation
3
+ module Batches
4
+ def find_each
5
+ find_in_batches do |records|
6
+ records.each { |record| yield record }
7
+ end
6
8
  end
7
- end
8
9
 
9
- def find_in_batches(options = {})
10
- options[:size] ||= 100
11
- options[:scroll] ||= '20m'
12
- options[:search_type] = 'scan'
10
+ def find_in_batches(options = {})
11
+ options[:size] ||= 100
12
+ options[:scroll] ||= '20m'
13
+ options[:search_type] = 'scan'
13
14
 
14
- hits = klass.elastic_connection.search(as_elastic, options)
15
+ hits = klass.elastic_connection.search(as_elastic, options)
15
16
 
16
- klass.elastic_connection.scroll(hits.scroll_id, scroll: options[:scroll], ids_only: true) do |hits|
17
- yield klass.find(hits.to_a)
17
+ klass.elastic_connection.scroll(hits.scroll_id, scroll: options[:scroll], ids_only: true) do |hits|
18
+ yield klass.find(hits.to_a)
19
+ end
18
20
  end
19
- end
20
21
 
21
- def reindex
22
- relation.find_in_batches do |batch|
23
- elastic_index.bulk_add(batch)
22
+ def reindex
23
+ relation.find_in_batches do |batch|
24
+ elastic_index.bulk_add(batch)
25
+ end
24
26
  end
25
27
  end
26
28
  end
@@ -1,22 +1,24 @@
1
1
  module ElasticRecord
2
- module Delegation
3
- def to_ary
4
- to_a.to_ary
5
- end
2
+ class Relation
3
+ module Delegation
4
+ def to_ary
5
+ to_a.to_ary
6
+ end
6
7
 
7
- def include?(obj)
8
- to_a.include?(obj)
9
- end
8
+ def include?(obj)
9
+ to_a.include?(obj)
10
+ end
10
11
 
11
- private
12
- def method_missing(method, *args, &block)
13
- if klass.respond_to?(method)
14
- scoping { klass.send(method, *args, &block) }
15
- elsif Array.method_defined?(method)
16
- to_a.send(method, *args, &block)
17
- else
18
- super
12
+ private
13
+ def method_missing(method, *args, &block)
14
+ if klass.respond_to?(method)
15
+ scoping { klass.send(method, *args, &block) }
16
+ elsif Array.method_defined?(method)
17
+ to_a.send(method, *args, &block)
18
+ else
19
+ super
20
+ end
19
21
  end
20
- end
22
+ end
21
23
  end
22
24
  end
@@ -1,25 +1,27 @@
1
1
  module ElasticRecord
2
- module FinderMethods
3
- def find(id)
4
- filter(arelastic.filter.ids(id)).to_a.first
5
- end
2
+ class Relation
3
+ module FinderMethods
4
+ def find(id)
5
+ filter(arelastic.filter.ids(id)).to_a.first
6
+ end
6
7
 
7
- def first
8
- find_one order('_uid')
9
- end
8
+ def first
9
+ find_one order('_uid')
10
+ end
10
11
 
11
- def last
12
- find_one order('color' => 'reverse')
13
- end
12
+ def last
13
+ find_one order('color' => 'reverse')
14
+ end
14
15
 
15
- def all
16
- to_a
17
- end
16
+ def all
17
+ to_a
18
+ end
18
19
 
19
- private
20
+ private
20
21
 
21
- def find_one(relation)
22
- relation.limit(1).to_a.first
22
+ def find_one(relation)
23
+ relation.limit(1).to_a.first
24
+ end
23
25
  end
24
26
  end
25
27
  end
@@ -1,34 +1,36 @@
1
1
  module ElasticRecord
2
- module Merging
3
- def merge!(other)
4
- Merger.new(self, other).merge
5
- end
6
-
7
- def merge(other)
8
- clone.merge!(other)
9
- end
2
+ class Relation
3
+ module Merging
4
+ def merge!(other)
5
+ Merger.new(self, other).merge
6
+ end
10
7
 
11
- private
12
- class Merger
13
- attr_accessor :relation, :values
8
+ def merge(other)
9
+ clone.merge!(other)
10
+ end
14
11
 
15
- def initialize(relation, other)
16
- @relation = relation
17
- @values = other.values
18
- end
12
+ private
13
+ class Merger
14
+ attr_accessor :relation, :values
19
15
 
20
- def normal_values
21
- Relation::MULTI_VALUE_METHODS + Relation::SINGLE_VALUE_METHODS
22
- end
16
+ def initialize(relation, other)
17
+ @relation = relation
18
+ @values = other.values
19
+ end
23
20
 
24
- def merge
25
- normal_values.each do |name|
26
- value = values[name]
27
- relation.send("#{name}!", value) unless value.blank?
21
+ def normal_values
22
+ Relation::MULTI_VALUE_METHODS + Relation::SINGLE_VALUE_METHODS
28
23
  end
29
24
 
30
- relation
25
+ def merge
26
+ normal_values.each do |name|
27
+ value = values[name]
28
+ relation.send("#{name}!", value) unless value.blank?
29
+ end
30
+
31
+ relation
32
+ end
31
33
  end
32
- end
34
+ end
33
35
  end
34
36
  end
@@ -1,213 +1,215 @@
1
1
  module ElasticRecord
2
- module SearchMethods
3
- Relation::MULTI_VALUE_METHODS.each do |name|
4
- class_eval <<-CODE, __FILE__, __LINE__ + 1
5
- def #{name}_values # def filter_values
6
- @values[:#{name}] || [] # @values[:filter] || []
7
- end # end
8
- #
9
- def #{name}_values=(values) # def filter_values=(values)
10
- @values[:#{name}] = values # @values[:filter] = values
11
- end # end
12
- CODE
13
- end
2
+ class Relation
3
+ module SearchMethods
4
+ Relation::MULTI_VALUE_METHODS.each do |name|
5
+ class_eval <<-CODE, __FILE__, __LINE__ + 1
6
+ def #{name}_values # def filter_values
7
+ @values[:#{name}] || [] # @values[:filter] || []
8
+ end # end
9
+ #
10
+ def #{name}_values=(values) # def filter_values=(values)
11
+ @values[:#{name}] = values # @values[:filter] = values
12
+ end # end
13
+ CODE
14
+ end
14
15
 
15
- Relation::SINGLE_VALUE_METHODS.each do |name|
16
- class_eval <<-CODE, __FILE__, __LINE__ + 1
17
- def #{name}_value # def offset_value
18
- @values[:#{name}] # @values[:offset]
19
- end # end
16
+ Relation::SINGLE_VALUE_METHODS.each do |name|
17
+ class_eval <<-CODE, __FILE__, __LINE__ + 1
18
+ def #{name}_value # def offset_value
19
+ @values[:#{name}] # @values[:offset]
20
+ end # end
20
21
 
21
- def #{name}_value=(value) # def offset_value=(value)
22
- @values[:#{name}] = value # @values[:offset] = value
23
- end # end
24
- CODE
25
- end
22
+ def #{name}_value=(value) # def offset_value=(value)
23
+ @values[:#{name}] = value # @values[:offset] = value
24
+ end # end
25
+ CODE
26
+ end
26
27
 
27
- def query!(value)
28
- self.query_value = value
29
- self
30
- end
31
-
32
- def query(value)
33
- clone.query! value
34
- end
28
+ def query!(value)
29
+ self.query_value = value
30
+ self
31
+ end
35
32
 
36
- def filter!(*args)
37
- self.filter_values += args.flatten
38
- self
39
- end
33
+ def query(value)
34
+ clone.query! value
35
+ end
40
36
 
41
- def filter(*args)
42
- clone.filter!(*args)
43
- end
37
+ def filter!(*args)
38
+ self.filter_values += args.flatten
39
+ self
40
+ end
44
41
 
45
- def limit!(value)
46
- self.limit_value = value
47
- self
48
- end
42
+ def filter(*args)
43
+ clone.filter!(*args)
44
+ end
49
45
 
50
- def limit(value)
51
- clone.limit!(value)
52
- end
46
+ def limit!(value)
47
+ self.limit_value = value
48
+ self
49
+ end
53
50
 
54
- def offset!(value)
55
- self.offset_value = value
56
- self
57
- end
51
+ def limit(value)
52
+ clone.limit!(value)
53
+ end
58
54
 
59
- def offset(value)
60
- clone.offset! value
61
- end
55
+ def offset!(value)
56
+ self.offset_value = value
57
+ self
58
+ end
62
59
 
63
- def select!(*args)
64
- self.select_values += args.flatten
65
- self
66
- end
60
+ def offset(value)
61
+ clone.offset! value
62
+ end
67
63
 
68
- def select(*args, &block)
69
- if block_given?
70
- to_a.select(&block)
71
- else
72
- clone.select! *args
64
+ def select!(*args)
65
+ self.select_values += args.flatten
66
+ self
73
67
  end
74
- end
75
68
 
76
- def facet!(name_or_facet, options = {})
77
- if name_or_facet.is_a?(String)
78
- self.facet_values += [arelastic.facet[name_or_facet].terms(name_or_facet, options)]
79
- else
80
- self.facet_values += [name_or_facet]
69
+ def select(*args, &block)
70
+ if block_given?
71
+ to_a.select(&block)
72
+ else
73
+ clone.select! *args
74
+ end
81
75
  end
82
76
 
83
- self
84
- end
77
+ def facet!(name_or_facet, options = {})
78
+ if name_or_facet.is_a?(String)
79
+ self.facet_values += [arelastic.facet[name_or_facet].terms(name_or_facet, options)]
80
+ else
81
+ self.facet_values += [name_or_facet]
82
+ end
85
83
 
86
- def facet(facet_or_name, options = {})
87
- clone.facet! facet_or_name, options = {}
88
- end
84
+ self
85
+ end
89
86
 
90
- def order!(*args)
91
- self.order_values += args.flatten
92
- self
93
- end
87
+ def facet(facet_or_name, options = {})
88
+ clone.facet! facet_or_name, options = {}
89
+ end
94
90
 
95
- def order(*args)
96
- clone.order! *args
97
- end
91
+ def order!(*args)
92
+ self.order_values += args.flatten
93
+ self
94
+ end
98
95
 
99
- def extending!(*modules, &block)
100
- modules << Module.new(&block) if block_given?
96
+ def order(*args)
97
+ clone.order! *args
98
+ end
101
99
 
102
- self.extending_values += modules.flatten
103
- extend(*extending_values)
100
+ def extending!(*modules, &block)
101
+ modules << Module.new(&block) if block_given?
104
102
 
105
- self
106
- end
103
+ self.extending_values += modules.flatten
104
+ extend(*extending_values)
107
105
 
108
- def extending(*modules, &block)
109
- clone.extending!(*modules, &block)
110
- end
106
+ self
107
+ end
111
108
 
112
- def as_elastic
113
- build_search.as_elastic
114
- end
109
+ def extending(*modules, &block)
110
+ clone.extending!(*modules, &block)
111
+ end
115
112
 
116
- private
117
- def build_search
118
- searches = [
119
- build_query_and_filter(query_value, filter_values),
120
- build_limit(limit_value),
121
- build_offset(offset_value),
122
- build_facets(facet_values),
123
- build_orders(order_values)
124
- ].compact
125
-
126
- Arelastic::Nodes::HashGroup.new searches
127
- end
128
-
129
- def build_query_and_filter(query, filters)
130
- query = build_query(query)
131
- filter = build_filter(filters)
132
- if query && filter
133
- arelastic.query.filtered(query, filter)
134
- elsif query
135
- query
136
- elsif filter
137
- arelastic.query.constant_score(filter)
138
- else
139
- arelastic.query.match_all
140
- end
113
+ def as_elastic
114
+ build_search.as_elastic
141
115
  end
142
116
 
143
- def build_query(query)
144
- if query.is_a?(String)
145
- query = Arelastic::Queries::QueryString.new query
117
+ private
118
+ def build_search
119
+ searches = [
120
+ build_query_and_filter(query_value, filter_values),
121
+ build_limit(limit_value),
122
+ build_offset(offset_value),
123
+ build_facets(facet_values),
124
+ build_orders(order_values)
125
+ ].compact
126
+
127
+ Arelastic::Nodes::HashGroup.new searches
146
128
  end
147
129
 
148
- if query
149
- Arelastic::Searches::Query.new query
130
+ def build_query_and_filter(query, filters)
131
+ query = build_query(query)
132
+ filter = build_filter(filters)
133
+ if query && filter
134
+ arelastic.query.filtered(query, filter)
135
+ elsif query
136
+ query
137
+ elsif filter
138
+ arelastic.query.constant_score(filter)
139
+ else
140
+ arelastic.query.match_all
141
+ end
150
142
  end
151
- end
152
143
 
153
- def build_filter(filters)
154
- nodes = []
144
+ def build_query(query)
145
+ if query.is_a?(String)
146
+ query = Arelastic::Queries::QueryString.new query
147
+ end
155
148
 
156
- filters.map do |filter|
157
- if filter.is_a?(Arelastic::Filters::Filter)
158
- nodes << filter
159
- else
160
- filter.each do |field, terms|
161
- case terms
162
- when Array, Range
163
- nodes << arelastic[field].in(terms)
164
- when Hash
165
- nodes << {field => terms}
166
- else
167
- nodes << arelastic[field].eq(terms)
149
+ if query
150
+ Arelastic::Searches::Query.new query
151
+ end
152
+ end
153
+
154
+ def build_filter(filters)
155
+ nodes = []
156
+
157
+ filters.map do |filter|
158
+ if filter.is_a?(Arelastic::Filters::Filter)
159
+ nodes << filter
160
+ else
161
+ filter.each do |field, terms|
162
+ case terms
163
+ when Array, Range
164
+ nodes << arelastic[field].in(terms)
165
+ when Hash
166
+ nodes << {field => terms}
167
+ else
168
+ nodes << arelastic[field].eq(terms)
169
+ end
168
170
  end
169
171
  end
170
172
  end
171
- end
172
173
 
173
- if nodes.size == 1
174
- Arelastic::Searches::Filter.new nodes.first
175
- elsif nodes.size > 1
176
- Arelastic::Searches::Filter.new Arelastic::Filters::And.new(nodes)
174
+ if nodes.size == 1
175
+ Arelastic::Searches::Filter.new nodes.first
176
+ elsif nodes.size > 1
177
+ Arelastic::Searches::Filter.new Arelastic::Filters::And.new(nodes)
178
+ end
177
179
  end
178
- end
179
180
 
180
- # def normalize_value(value)
181
- # case value
182
- # when true
183
- # "T"
184
- # when false
185
- # "F"
186
- # when Time
187
- # value.iso8601
188
- # else
189
- # value
190
- # end
191
- # end
192
-
193
- def build_limit(limit)
194
- if limit
195
- Arelastic::Searches::Size.new(limit)
181
+ # def normalize_value(value)
182
+ # case value
183
+ # when true
184
+ # "T"
185
+ # when false
186
+ # "F"
187
+ # when Time
188
+ # value.iso8601
189
+ # else
190
+ # value
191
+ # end
192
+ # end
193
+
194
+ def build_limit(limit)
195
+ if limit
196
+ Arelastic::Searches::Size.new(limit)
197
+ end
196
198
  end
197
- end
198
199
 
199
- def build_offset(offset)
200
- if offset
201
- Arelastic::Searches::From.new(offset)
200
+ def build_offset(offset)
201
+ if offset
202
+ Arelastic::Searches::From.new(offset)
203
+ end
202
204
  end
203
- end
204
205
 
205
- def build_facets(facets)
206
- Arelastic::Searches::Facets.new(facets) unless facets.empty?
207
- end
206
+ def build_facets(facets)
207
+ Arelastic::Searches::Facets.new(facets) unless facets.empty?
208
+ end
208
209
 
209
- def build_orders(orders)
210
- Arelastic::Searches::Sort.new(orders) unless orders.empty?
211
- end
210
+ def build_orders(orders)
211
+ Arelastic::Searches::Sort.new(orders) unless orders.empty?
212
+ end
213
+ end
212
214
  end
213
215
  end
@@ -0,0 +1,22 @@
1
+ require 'helper'
2
+
3
+ class ElasticRecord::Index::PercolatorTest < MiniTest::Spec
4
+ def test_create_percolator
5
+ index.delete(index.percolator_index_name) if index.exists?(index.percolator_index_name)
6
+
7
+ index.create_percolator('green', 'color' => 'green')
8
+
9
+ assert index.exists?(index.percolator_index_name)
10
+ assert index.percolator_exists?('green')
11
+ refute index.percolator_exists?('blue')
12
+ end
13
+
14
+ def test_percolator_index_name
15
+ assert_equal 'percolate_widgets', index.percolator_index_name
16
+ end
17
+
18
+ private
19
+ def index
20
+ Widget.elastic_index
21
+ end
22
+ end
@@ -3,7 +3,28 @@ require 'helper'
3
3
  class ElasticRecord::RelationTest < MiniTest::Spec
4
4
  def setup
5
5
  Widget.elastic_index.reset
6
+ end
7
+
8
+ def test_count
6
9
  create_widgets
10
+
11
+ assert_equal 2, Widget.elastic_relation.count
12
+ end
13
+
14
+ def test_facets
15
+ create_widgets
16
+
17
+ facets = Widget.elastic_relation.facet(Widget.arelastic.facet['popular_colors'].terms('color')).facets
18
+
19
+ assert_equal 2, facets['popular_colors']['total']
20
+ end
21
+
22
+ def test_percolate
23
+ Widget.elastic_relation.filter(color: 'green').create_percolator('green')
24
+ Widget.elastic_relation.filter(color: 'blue').create_percolator('blue')
25
+ widget = Widget.new(color: 'green')
26
+
27
+ assert_equal ['green'], Widget.elastic_index.percolate(widget.as_search)
7
28
  end
8
29
 
9
30
  def test_to_hits
@@ -11,27 +32,21 @@ class ElasticRecord::RelationTest < MiniTest::Spec
11
32
  end
12
33
 
13
34
  def test_to_ids
35
+ create_widgets
14
36
  assert_equal ['5', '10'], Widget.elastic_relation.to_ids
15
37
  end
16
38
 
17
39
  def test_to_a
40
+ create_widgets
18
41
  array = Widget.elastic_relation.to_a
19
42
 
20
43
  assert_equal 2, array.size
21
44
  assert array.first.is_a?(Widget)
22
45
  end
23
46
 
24
- def test_count
25
- assert_equal 2, Widget.elastic_relation.count
26
- end
27
-
28
- def test_facets
29
- facets = Widget.elastic_relation.facet(Widget.arelastic.facet['popular_colors'].terms('color')).facets
30
-
31
- assert_equal 2, facets['popular_colors']['total']
32
- end
33
-
34
47
  def test_equal
48
+ create_widgets
49
+
35
50
  assert(Widget.elastic_relation.filter(color: 'green') == Widget.elastic_relation.filter(color: 'green'))
36
51
  assert(Widget.elastic_relation.filter(color: 'green') != Widget.elastic_relation.filter(color: 'blue'))
37
52
 
data/test/helper.rb CHANGED
@@ -3,9 +3,6 @@ Bundler.require
3
3
 
4
4
  require 'minitest/autorun'
5
5
 
6
- require 'active_support/core_ext/object/blank'
7
- require 'active_model'
8
-
9
6
  require 'support/widget'
10
7
  require 'support/connect'
11
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-05 00:00:00.000000000 Z
12
+ date: 2012-09-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: arelastic
@@ -80,6 +80,7 @@ files:
80
80
  - lib/elastic_record/index/documents.rb
81
81
  - lib/elastic_record/index/manage.rb
82
82
  - lib/elastic_record/index/mapping.rb
83
+ - lib/elastic_record/index/percolator.rb
83
84
  - lib/elastic_record/model.rb
84
85
  - lib/elastic_record/orm/active_record.rb
85
86
  - lib/elastic_record/railtie.rb
@@ -98,6 +99,7 @@ files:
98
99
  - test/elastic_record/index/documents_test.rb
99
100
  - test/elastic_record/index/manage_test.rb
100
101
  - test/elastic_record/index/mapping_test.rb
102
+ - test/elastic_record/index/percolator_test.rb
101
103
  - test/elastic_record/index_test.rb
102
104
  - test/elastic_record/model_test.rb
103
105
  - test/elastic_record/relation/batches_test.rb