algoliasearch-rails 1.11.1 → 1.11.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff7268843b4187ac3dcf7935b7cc6210ae2537bc
4
- data.tar.gz: b2c861d79e0098fc865887ca837df5f95629e9ed
3
+ metadata.gz: 5e8dd1f75b435b4e192ce211b00c399417b42689
4
+ data.tar.gz: e211db3fc43bc4fa55ab38c6ec2e860a037cea10
5
5
  SHA512:
6
- metadata.gz: 4a07ec13513cbd052d1c44739ccb74d0c8270ad938cf232c960e8b7530dc5b4010baeb0c3b927eb913f52a3c75fa9e6df5b5025bb41d0c80859936c42da21927
7
- data.tar.gz: 0e553e1bcdfd3aff649438957e72705cdb0da1da64a8f29b854a7524b537e363c7956d74a0f4b3058d5a6a8bccbfb71b1c884c02d535f0e676a0bb8a792b5508
6
+ metadata.gz: e12c15de1151b7fc6e3fb5d69486844bbe2216769be212d60ebcd8f127d0b9b1b76416c8d1e85bf5fbd3671ba88f1e259b3801a2ec5d6f47aa2235aaa4f2ce9f
7
+ data.tar.gz: f6103d4b36d27ee3d2133280edc9e16d50e4bdbb09b6287d66f866afe47f39bf2255f7a8a08a15186b175b95ad9338d4517827d478a8721a3d4ce8251ea41fac
data/ChangeLog CHANGED
@@ -1,5 +1,9 @@
1
1
  CHANGELOG
2
2
 
3
+ 2014-09-02 1.11.2
4
+
5
+ * Ability to search in a slave or extra index using the ```:index```/```:slave``` parameter
6
+
3
7
  2014-08-25 1.11.1
4
8
 
5
9
  * While using a temporary index to reindex, do not set the "slaves" index setting (will be set at move-time)
data/README.md CHANGED
@@ -426,6 +426,14 @@ class Book < ActiveRecord::Base
426
426
  end
427
427
  ```
428
428
 
429
+ To search using a slave, use the following code:
430
+
431
+ ```ruby
432
+ Book.raw_search 'foo bar', slave: 'Book_by_editor'
433
+ # or
434
+ Book.search 'foo bar', slave: 'Book_by_editor'
435
+ ```
436
+
429
437
  Target multiple indexes
430
438
  ---------
431
439
 
@@ -462,6 +470,14 @@ class Book < ActiveRecord::Base
462
470
  end
463
471
  ```
464
472
 
473
+ To search using an extra index, use the following code:
474
+
475
+ ```ruby
476
+ Book.raw_search 'foo bar', index: 'Book_by_editor'
477
+ # or
478
+ Book.search 'foo bar', index: 'Book_by_editor'
479
+ ```
480
+
465
481
  Tags
466
482
  -----
467
483
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.11.1
1
+ 1.11.2
@@ -6,11 +6,11 @@
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "algoliasearch-rails"
9
- s.version = "1.11.1"
9
+ s.version = "1.11.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["Algolia"]
13
- s.date = "2014-08-25"
13
+ s.date = "2014-09-02"
14
14
  s.description = "AlgoliaSearch integration to your favorite ORM"
15
15
  s.email = "contact@algolia.com"
16
16
  s.extra_rdoc_files = [
@@ -343,7 +343,8 @@ module AlgoliaSearch
343
343
  end
344
344
 
345
345
  def algolia_raw_search(q, params = {})
346
- index = algolia_ensure_init
346
+ index_name = params.delete(:index) || params.delete('index') || params.delete(:slave) || params.delete('slave')
347
+ index = algolia_index(index_name)
347
348
  index.search(q, Hash[params.map { |k,v| [k.to_s, v.to_s] }])
348
349
  end
349
350
 
@@ -403,7 +404,7 @@ module AlgoliaSearch
403
404
  algolia_configurations.each do |o, s|
404
405
  return algolia_ensure_init(o, s) if o[:index_name].to_s == name.to_s
405
406
  end
406
- raise ArgumentError.new("Invalid index name: #{name}")
407
+ raise ArgumentError.new("Invalid index/slave name: #{name}")
407
408
  end
408
409
  algolia_ensure_init
409
410
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-25 00:00:00.000000000 Z
11
+ date: 2014-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json