Commit 744ef325e75a195128433c18813d1ebae4b7059e
1 parent
caa68105
Exists in
master
and in
2 other branches
Removed prefix
Showing
5 changed files
with
14 additions
and
14 deletions
Show diff stats
lib/searchkick.rb
... | ... | @@ -171,7 +171,7 @@ module Searchkick |
171 | 171 | end |
172 | 172 | |
173 | 173 | options = options.merge(block: block) if block |
174 | - Searchkick::Relation.new(klass, term, **options) | |
174 | + Relation.new(klass, term, **options) | |
175 | 175 | end |
176 | 176 | |
177 | 177 | def self.multi_search(queries) |
... | ... | @@ -183,7 +183,7 @@ module Searchkick |
183 | 183 | body: queries.flat_map { |q| [q.params.except(:body).to_json, q.body.to_json] }.map { |v| "#{v}\n" }.join, |
184 | 184 | } |
185 | 185 | ActiveSupport::Notifications.instrument("multi_search.searchkick", event) do |
186 | - Searchkick::MultiSearch.new(queries).perform | |
186 | + MultiSearch.new(queries).perform | |
187 | 187 | end |
188 | 188 | end |
189 | 189 | |
... | ... | @@ -241,9 +241,9 @@ module Searchkick |
241 | 241 | end |
242 | 242 | |
243 | 243 | def self.reindex_status(index_name) |
244 | - raise Searchkick::Error, "Redis not configured" unless redis | |
244 | + raise Error, "Redis not configured" unless redis | |
245 | 245 | |
246 | - batches_left = Searchkick::Index.new(index_name).batches_left | |
246 | + batches_left = Index.new(index_name).batches_left | |
247 | 247 | { |
248 | 248 | completed: batches_left == 0, |
249 | 249 | batches_left: batches_left | ... | ... |
lib/searchkick/index_options.rb
... | ... | @@ -513,7 +513,7 @@ module Searchkick |
513 | 513 | else |
514 | 514 | [:searchkick_search2, :searchkick_word_search].each do |analyzer| |
515 | 515 | unless settings[:analysis][:analyzer][analyzer].key?(:filter) |
516 | - raise Searchkick::Error, "Search synonyms are not supported yet for language" | |
516 | + raise Error, "Search synonyms are not supported yet for language" | |
517 | 517 | end |
518 | 518 | |
519 | 519 | settings[:analysis][:analyzer][analyzer][:filter].insert(2, "searchkick_synonym_graph") | ... | ... |
lib/searchkick/query.rb
... | ... | @@ -187,11 +187,11 @@ module Searchkick |
187 | 187 | end |
188 | 188 | |
189 | 189 | # set execute for multi search |
190 | - @execute = Searchkick::Results.new(searchkick_klass, response, opts) | |
190 | + @execute = Results.new(searchkick_klass, response, opts) | |
191 | 191 | end |
192 | 192 | |
193 | 193 | def retry_misspellings?(response) |
194 | - @misspellings_below && Searchkick::Results.new(searchkick_klass, response).total_count < @misspellings_below | |
194 | + @misspellings_below && Results.new(searchkick_klass, response).total_count < @misspellings_below | |
195 | 195 | end |
196 | 196 | |
197 | 197 | private | ... | ... |
lib/searchkick/record_indexer.rb
... | ... | @@ -14,7 +14,7 @@ module Searchkick |
14 | 14 | case mode |
15 | 15 | when :async |
16 | 16 | unless defined?(ActiveJob) |
17 | - raise Searchkick::Error, "Active Job not found" | |
17 | + raise Error, "Active Job not found" | |
18 | 18 | end |
19 | 19 | |
20 | 20 | # we could likely combine ReindexV2Job, BulkReindexJob, and ProcessBatchJob |
... | ... | @@ -45,7 +45,7 @@ module Searchkick |
45 | 45 | end |
46 | 46 | when :queue |
47 | 47 | if method_name |
48 | - raise Searchkick::Error, "Partial reindex not supported with queue option" | |
48 | + raise Error, "Partial reindex not supported with queue option" | |
49 | 49 | end |
50 | 50 | |
51 | 51 | index.reindex_queue.push_records(records) | ... | ... |
lib/searchkick/results.rb
... | ... | @@ -141,7 +141,7 @@ module Searchkick |
141 | 141 | |
142 | 142 | def hits |
143 | 143 | if error |
144 | - raise Searchkick::Error, "Query error - use the error method to view it" | |
144 | + raise Error, "Query error - use the error method to view it" | |
145 | 145 | else |
146 | 146 | @response["hits"]["hits"] |
147 | 147 | end |
... | ... | @@ -178,7 +178,7 @@ module Searchkick |
178 | 178 | end |
179 | 179 | |
180 | 180 | def scroll |
181 | - raise Searchkick::Error, "Pass `scroll` option to the search method for scrolling" unless scroll_id | |
181 | + raise Error, "Pass `scroll` option to the search method for scrolling" unless scroll_id | |
182 | 182 | |
183 | 183 | if block_given? |
184 | 184 | records = self |
... | ... | @@ -191,10 +191,10 @@ module Searchkick |
191 | 191 | else |
192 | 192 | begin |
193 | 193 | # TODO Active Support notifications for this scroll call |
194 | - Searchkick::Results.new(@klass, Searchkick.client.scroll(scroll: options[:scroll], body: {scroll_id: scroll_id}), @options) | |
194 | + Results.new(@klass, Searchkick.client.scroll(scroll: options[:scroll], body: {scroll_id: scroll_id}), @options) | |
195 | 195 | rescue => e |
196 | 196 | if Searchkick.not_found_error?(e) && e.message =~ /search_context_missing_exception/i |
197 | - raise Searchkick::Error, "Scroll id has expired" | |
197 | + raise Error, "Scroll id has expired" | |
198 | 198 | else |
199 | 199 | raise e |
200 | 200 | end |
... | ... | @@ -232,7 +232,7 @@ module Searchkick |
232 | 232 | index_alias = index.split("_")[0..-2].join("_") |
233 | 233 | Array((options[:index_mapping] || {})[index_alias]) |
234 | 234 | end |
235 | - raise Searchkick::Error, "Unknown model for index: #{index}. Pass the `models` option to the search method." unless models.any? | |
235 | + raise Error, "Unknown model for index: #{index}. Pass the `models` option to the search method." unless models.any? | |
236 | 236 | index_models[index] = models |
237 | 237 | end |
238 | 238 | ... | ... |