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 +4 -4
- data/ChangeLog +4 -0
- data/README.md +16 -0
- data/VERSION +1 -1
- data/algoliasearch-rails.gemspec +2 -2
- data/lib/algoliasearch-rails.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e8dd1f75b435b4e192ce211b00c399417b42689
|
4
|
+
data.tar.gz: e211db3fc43bc4fa55ab38c6ec2e860a037cea10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e12c15de1151b7fc6e3fb5d69486844bbe2216769be212d60ebcd8f127d0b9b1b76416c8d1e85bf5fbd3671ba88f1e259b3801a2ec5d6f47aa2235aaa4f2ce9f
|
7
|
+
data.tar.gz: f6103d4b36d27ee3d2133280edc9e16d50e4bdbb09b6287d66f866afe47f39bf2255f7a8a08a15186b175b95ad9338d4517827d478a8721a3d4ce8251ea41fac
|
data/ChangeLog
CHANGED
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.11.2
|
data/algoliasearch-rails.gemspec
CHANGED
@@ -6,11 +6,11 @@
|
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "algoliasearch-rails"
|
9
|
-
s.version = "1.11.
|
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-
|
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 = [
|
data/lib/algoliasearch-rails.rb
CHANGED
@@ -343,7 +343,8 @@ module AlgoliaSearch
|
|
343
343
|
end
|
344
344
|
|
345
345
|
def algolia_raw_search(q, params = {})
|
346
|
-
|
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.
|
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-
|
11
|
+
date: 2014-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|