algolia 2.0.0.pre.beta.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +7 -0
- data/README.md +18 -10
- data/SECURITY.md +3 -0
- data/algolia.gemspec +5 -5
- data/lib/algolia/config/base_config.rb +0 -2
- data/lib/algolia/helpers.rb +1 -3
- data/lib/algolia/search_index.rb +1 -1
- data/lib/algolia/version.rb +1 -1
- data/test/algolia/unit/helpers_test.rb +2 -13
- data/upgrade_guide.md +1 -1
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 555e432d41a84d3031f58dc7c74acf5297df48fe693fadf977c6b15547a82d6b
|
4
|
+
data.tar.gz: a3fbbc9ba6552b0b432a20e34cd5cf7a311f339c2df7f7a3c549ced84f409ba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 757d57c2723f3f036bfb7faa38615fd751311e99b0a3f5e1b3c13087c53a9010af88c99a5412e31bb3e6d3cdb9201478d7100c71080b3fe948004170a870f875
|
7
|
+
data.tar.gz: ede51228b6bc2498b65434102f8b25b17d7db74ae74cd2b50a1ec7184f42692e4b24d94de8c621ec91a8192c924e71ac1067bfdde038a03936407f12147b6175
|
data/.gitignore
CHANGED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
<h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your Ruby project</h4>
|
7
7
|
|
8
8
|
<p align="center">
|
9
|
-
<a href="https://circleci.com/gh/algolia/algoliasearch-client-ruby
|
10
|
-
<a href="https://rubygems.org/gems/
|
11
|
-
<a href="https://rubygems.org/gems/
|
9
|
+
<a href="https://circleci.com/gh/algolia/algoliasearch-client-ruby"><img src="https://circleci.com/gh/algolia/algoliasearch-client-ruby/tree/release%2Fv2.svg?style=shield" alt="CircleCI" /></a>
|
10
|
+
<a href="https://rubygems.org/gems/algolia"><img src="https://badge.fury.io/rb/algoliasearch.svg" alt="Gem Version"></a>
|
11
|
+
<a href="https://rubygems.org/gems/algolia"><img src="https://img.shields.io/badge/licence-MIT-blue.svg" alt="License"></a>
|
12
12
|
</p>
|
13
13
|
</p>
|
14
14
|
|
@@ -18,39 +18,47 @@
|
|
18
18
|
<a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
|
19
19
|
<a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
|
20
20
|
<a href="https://github.com/algolia/algoliasearch-client-ruby/issues" target="_blank">Report a bug</a> •
|
21
|
+
<a href="https://www.algolia.com/doc/api-client/troubleshooting/faq/ruby/" target="_blank">FAQ</a> •
|
21
22
|
<a href="https://www.algolia.com/support" target="_blank">Support</a>
|
22
23
|
</p>
|
23
24
|
|
24
25
|
## ✨ Features
|
25
26
|
|
26
27
|
- Thin & minimal low-level HTTP client to interact with Algolia's API
|
27
|
-
- Supports Ruby `^
|
28
|
+
- Supports Ruby `^2.2`.
|
28
29
|
|
29
30
|
## 💡 Getting Started
|
30
31
|
|
31
32
|
First, install Algolia Ruby API Client via the [RubyGems](https://rubygems.org/) package manager:
|
32
33
|
```bash
|
33
|
-
gem install
|
34
|
+
gem install algolia
|
34
35
|
```
|
35
36
|
|
36
37
|
Then, create objects on your index:
|
37
38
|
|
38
39
|
|
39
40
|
```ruby
|
40
|
-
Algolia.
|
41
|
-
|
42
|
-
index = Algolia::Index.new('your_index_name')
|
41
|
+
client = Algolia::Search::Client.create('YourApplicationID', 'YourAPIKey')
|
42
|
+
index = client.init_index('your_index_name')
|
43
43
|
|
44
|
-
index.save_objects([objectID:
|
44
|
+
index.save_objects([objectID: 1, name: 'Foo'])
|
45
45
|
```
|
46
46
|
|
47
47
|
Finally, you may begin searching a object using the `search` method:
|
48
48
|
```ruby
|
49
|
-
objects = index.search('
|
49
|
+
objects = index.search('Foo')
|
50
50
|
```
|
51
51
|
|
52
52
|
For full documentation, visit the **[Algolia Ruby API Client](https://www.algolia.com/doc/api-client/getting-started/install/ruby/)**.
|
53
53
|
|
54
|
+
## ❓ Troubleshooting
|
55
|
+
|
56
|
+
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/ruby/) where you will find answers for the most common issues and gotchas with the client.
|
57
|
+
|
58
|
+
## Upgrade from V1 to V2
|
59
|
+
|
60
|
+
If you were using the v1 and wish to update to v2, please follow our [Upgrade Guide](upgrade_guide.md)
|
61
|
+
|
54
62
|
## 📄 License
|
55
63
|
|
56
64
|
Algolia Ruby API Client is an open-sourced software licensed under the [MIT license](LICENSE.md).
|
data/SECURITY.md
ADDED
data/algolia.gemspec
CHANGED
@@ -12,14 +12,14 @@ Gem::Specification.new do |spec|
|
|
12
12
|
|
13
13
|
spec.date = Date.today
|
14
14
|
spec.licenses = ['MIT']
|
15
|
-
spec.summary = 'A simple Ruby client for the algolia.com REST API
|
16
|
-
spec.description = '
|
17
|
-
spec.homepage = 'https://github.com/algolia/algoliasearch-client-ruby
|
15
|
+
spec.summary = 'A simple Ruby client for the algolia.com REST API'
|
16
|
+
spec.description = 'A simple Ruby client for the algolia.com REST API'
|
17
|
+
spec.homepage = 'https://github.com/algolia/algoliasearch-client-ruby'
|
18
18
|
|
19
19
|
spec.metadata = {
|
20
20
|
'bug_tracker_uri' => 'https://github.com/algolia/algoliasearch-client-ruby/issues',
|
21
|
-
'documentation_uri' => '
|
22
|
-
'source_code_uri' => 'https://github.com/algolia/algoliasearch-client-ruby
|
21
|
+
'documentation_uri' => 'https://www.algolia.com/doc/api-client/getting-started/install/ruby',
|
22
|
+
'source_code_uri' => 'https://github.com/algolia/algoliasearch-client-ruby'
|
23
23
|
}
|
24
24
|
|
25
25
|
# Specify which files should be added to the gem when it is released.
|
@@ -34,8 +34,6 @@ module Algolia
|
|
34
34
|
@connect_timeout = opts[:connect_timeout] || Defaults::CONNECT_TIMEOUT
|
35
35
|
@compression_type = opts[:compression_type] || Defaults::NONE_ENCODING
|
36
36
|
@symbolize_keys = opts.has_key?(:symbolize_keys) ? opts[:symbolize_keys] : true
|
37
|
-
# used to avoid BC break on Rails integration, should not be documented
|
38
|
-
@use_latest_settings = opts.has_key?(:use_latest_settings) ? opts[:use_latest_settings] : true
|
39
37
|
end
|
40
38
|
|
41
39
|
def set_extra_header(key, value)
|
data/lib/algolia/helpers.rb
CHANGED
@@ -52,9 +52,7 @@ module Helpers
|
|
52
52
|
|
53
53
|
# Support to convert old settings to their new names
|
54
54
|
#
|
55
|
-
def deserialize_settings(data,
|
56
|
-
return data unless use_latest_settings
|
57
|
-
|
55
|
+
def deserialize_settings(data, symbolize_keys)
|
58
56
|
settings = symbolize_hash(data)
|
59
57
|
keys = {
|
60
58
|
attributesToIndex: 'searchableAttributes',
|
data/lib/algolia/search_index.rb
CHANGED
@@ -976,7 +976,7 @@ module Algolia
|
|
976
976
|
def get_settings(opts = {})
|
977
977
|
response = @transporter.read(:GET, path_encode('/1/indexes/%s/settings', @name) + handle_params({ getVersion: 2 }), {}, opts)
|
978
978
|
|
979
|
-
deserialize_settings(response, @config.
|
979
|
+
deserialize_settings(response, @config.symbolize_keys)
|
980
980
|
end
|
981
981
|
|
982
982
|
# Update some index settings. Only specified settings are overridden
|
data/lib/algolia/version.rb
CHANGED
@@ -18,21 +18,10 @@ class HelpersTest
|
|
18
18
|
replicas: %w(index1 index2)
|
19
19
|
}
|
20
20
|
|
21
|
-
deserialized_settings = deserialize_settings(old_settings, true
|
21
|
+
deserialized_settings = deserialize_settings(old_settings, true)
|
22
22
|
assert_equal new_settings, deserialized_settings
|
23
23
|
end
|
24
24
|
|
25
|
-
def test_deserialize_settings_with_old_settings
|
26
|
-
old_settings = {
|
27
|
-
attributesToIndex: %w(attr1 attr2),
|
28
|
-
numericAttributesToIndex: %w(attr1 attr2),
|
29
|
-
slaves: %w(index1 index2)
|
30
|
-
}
|
31
|
-
|
32
|
-
deserialized_settings = deserialize_settings(old_settings, false, true)
|
33
|
-
assert_equal old_settings, deserialized_settings
|
34
|
-
end
|
35
|
-
|
36
25
|
def test_deserialize_settings_with_string
|
37
26
|
old_settings = {
|
38
27
|
'attributesToIndex' => %w(attr1 attr2),
|
@@ -46,7 +35,7 @@ class HelpersTest
|
|
46
35
|
'replicas' => %w(index1 index2)
|
47
36
|
}
|
48
37
|
|
49
|
-
deserialized_settings = deserialize_settings(old_settings,
|
38
|
+
deserialized_settings = deserialize_settings(old_settings, false)
|
50
39
|
assert_equal new_settings, deserialized_settings
|
51
40
|
end
|
52
41
|
end
|
data/upgrade_guide.md
CHANGED
@@ -229,7 +229,7 @@ client.search_user_ids('query', {clusterName: 'my-cluster', hitPerPage: 12, page
|
|
229
229
|
#### `pending_mappings`
|
230
230
|
New method to check the status of your clusters' migration or user creation.
|
231
231
|
```ruby
|
232
|
-
client.
|
232
|
+
client.pending_mappings?({ retrieveMappings: true })
|
233
233
|
```
|
234
234
|
|
235
235
|
#### `get_logs`
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: algolia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Algolia
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -178,8 +178,7 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
-
description:
|
182
|
-
Please keep on using the algoliasearch gem in the meantime.
|
181
|
+
description: A simple Ruby client for the algolia.com REST API
|
183
182
|
email:
|
184
183
|
- support@algolia.com
|
185
184
|
executables: []
|
@@ -192,11 +191,13 @@ files:
|
|
192
191
|
- ".gitignore"
|
193
192
|
- ".rubocop.yml"
|
194
193
|
- ".rubocop_todo.yml"
|
194
|
+
- CHANGELOG.md
|
195
195
|
- CODE_OF_CONDUCT.md
|
196
196
|
- Gemfile
|
197
197
|
- LICENSE
|
198
198
|
- README.md
|
199
199
|
- Rakefile
|
200
|
+
- SECURITY.md
|
200
201
|
- Steepfile
|
201
202
|
- algolia.gemspec
|
202
203
|
- bin/console
|
@@ -271,13 +272,13 @@ files:
|
|
271
272
|
- test/algolia/unit/user_agent_test.rb
|
272
273
|
- test/test_helper.rb
|
273
274
|
- upgrade_guide.md
|
274
|
-
homepage: https://github.com/algolia/algoliasearch-client-ruby
|
275
|
+
homepage: https://github.com/algolia/algoliasearch-client-ruby
|
275
276
|
licenses:
|
276
277
|
- MIT
|
277
278
|
metadata:
|
278
279
|
bug_tracker_uri: https://github.com/algolia/algoliasearch-client-ruby/issues
|
279
|
-
documentation_uri:
|
280
|
-
source_code_uri: https://github.com/algolia/algoliasearch-client-ruby
|
280
|
+
documentation_uri: https://www.algolia.com/doc/api-client/getting-started/install/ruby
|
281
|
+
source_code_uri: https://github.com/algolia/algoliasearch-client-ruby
|
281
282
|
post_install_message:
|
282
283
|
rdoc_options: []
|
283
284
|
require_paths:
|
@@ -289,14 +290,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
289
290
|
version: '0'
|
290
291
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
291
292
|
requirements:
|
292
|
-
- - "
|
293
|
+
- - ">="
|
293
294
|
- !ruby/object:Gem::Version
|
294
|
-
version:
|
295
|
+
version: '0'
|
295
296
|
requirements: []
|
296
297
|
rubygems_version: 3.0.3
|
297
298
|
signing_key:
|
298
299
|
specification_version: 4
|
299
|
-
summary: A simple Ruby client for the algolia.com REST API
|
300
|
+
summary: A simple Ruby client for the algolia.com REST API
|
300
301
|
test_files:
|
301
302
|
- test/algolia/integration/account_client_test.rb
|
302
303
|
- test/algolia/integration/analytics_client_test.rb
|