algoliasearch 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -7
- data/Gemfile.lock +52 -19
- data/README.md +4 -4
- data/VERSION +1 -1
- data/algoliasearch.gemspec +5 -4
- data/lib/algolia/index.rb +14 -0
- metadata +118 -76
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MDg3MGEyNjMwMzgwMWE4YTFlNDNiOWM1NjI3NTE3MDBiYjczNWQ5YQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NmM2ZTA5Y2U2Y2RhZjNkOWZjY2ExMGZmODVhYzk5OTJiMGE0NTUzMg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YzU1M2ZmMzlkYzRmM2I2NWZmMGI5MGVkZGM2ZGRmYjlhOGEwNjA0YmU4M2Fj
|
10
|
+
Yzc4OTdlODc4ODZjOWI2ZDI1MWQzNjI3YzY1ZGI3NGQwZDhlMGQwYjYwYTc2
|
11
|
+
OTM1MjE1OThhNjg4OWM1MTk2OGY4YzZlYTYzNzU3NWZmODlmOTg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MmNiNWI5OTZjOTU2MzIxM2VjZDI4MTM0N2Y5Mjg1Y2I2OWY5NzcwZTUzOGY3
|
14
|
+
NDY2ZTFlN2M5Y2IxMTM0NWFlM2U5ZGM5ZDhhOTBjYTViMjBjYjQ3Y2UxYWYy
|
15
|
+
ZWNhNjIxZjUyZjM0OWUyNmNjZjk0OTE5ZmUyMzFlOTQ3NzE0N2I=
|
data/Gemfile.lock
CHANGED
@@ -1,34 +1,67 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.3.
|
5
|
-
|
4
|
+
addressable (2.3.5)
|
5
|
+
builder (3.2.2)
|
6
|
+
crack (0.4.1)
|
7
|
+
safe_yaml (~> 0.9.0)
|
6
8
|
curb (0.8.4)
|
7
|
-
diff-lcs (1.
|
8
|
-
|
9
|
-
|
9
|
+
diff-lcs (1.2.4)
|
10
|
+
faraday (0.8.8)
|
11
|
+
multipart-post (~> 1.2.0)
|
12
|
+
git (1.2.6)
|
13
|
+
github_api (0.10.1)
|
14
|
+
addressable
|
15
|
+
faraday (~> 0.8.1)
|
16
|
+
hashie (>= 1.2)
|
17
|
+
multi_json (~> 1.4)
|
18
|
+
nokogiri (~> 1.5.2)
|
19
|
+
oauth2
|
20
|
+
hashie (2.0.5)
|
21
|
+
highline (1.6.19)
|
22
|
+
httpauth (0.2.0)
|
23
|
+
jeweler (1.8.7)
|
24
|
+
builder
|
10
25
|
bundler (~> 1.0)
|
11
26
|
git (>= 1.2.5)
|
27
|
+
github_api (= 0.10.1)
|
28
|
+
highline (>= 1.6.15)
|
29
|
+
nokogiri (= 1.5.10)
|
12
30
|
rake
|
13
31
|
rdoc
|
14
32
|
json (1.8.0)
|
15
|
-
|
16
|
-
|
33
|
+
jwt (0.1.8)
|
34
|
+
multi_json (>= 1.5)
|
35
|
+
multi_json (1.8.0)
|
36
|
+
multi_xml (0.5.5)
|
37
|
+
multipart-post (1.2.0)
|
38
|
+
nokogiri (1.5.10)
|
39
|
+
oauth2 (0.9.2)
|
40
|
+
faraday (~> 0.8)
|
41
|
+
httpauth (~> 0.2)
|
42
|
+
jwt (~> 0.1.4)
|
43
|
+
multi_json (~> 1.0)
|
44
|
+
multi_xml (~> 0.5)
|
45
|
+
rack (~> 1.2)
|
46
|
+
rack (1.5.2)
|
47
|
+
rake (10.1.0)
|
48
|
+
rdoc (4.0.1)
|
17
49
|
json (~> 1.4)
|
18
50
|
redgreen (1.2.2)
|
19
|
-
rspec (2.
|
20
|
-
rspec-core (~> 2.
|
21
|
-
rspec-expectations (~> 2.
|
22
|
-
rspec-mocks (~> 2.
|
23
|
-
rspec-core (2.
|
24
|
-
rspec-expectations (2.
|
25
|
-
diff-lcs (
|
26
|
-
rspec-mocks (2.
|
27
|
-
|
28
|
-
|
29
|
-
|
51
|
+
rspec (2.14.1)
|
52
|
+
rspec-core (~> 2.14.0)
|
53
|
+
rspec-expectations (~> 2.14.0)
|
54
|
+
rspec-mocks (~> 2.14.0)
|
55
|
+
rspec-core (2.14.5)
|
56
|
+
rspec-expectations (2.14.2)
|
57
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
58
|
+
rspec-mocks (2.14.3)
|
59
|
+
safe_yaml (0.9.7)
|
60
|
+
shoulda-context (1.1.5)
|
61
|
+
test-unit (2.5.5)
|
62
|
+
webmock (1.13.0)
|
30
63
|
addressable (>= 2.2.7)
|
31
|
-
crack (>= 0.
|
64
|
+
crack (>= 0.3.2)
|
32
65
|
|
33
66
|
PLATFORMS
|
34
67
|
ruby
|
data/README.md
CHANGED
@@ -29,8 +29,8 @@ Setup
|
|
29
29
|
-------------
|
30
30
|
To setup your project, follow these steps:
|
31
31
|
|
32
|
-
|
33
|
-
2. Initialize the client with your ApplicationID and API-Key
|
32
|
+
1. Install AlgoliaSearch using <code>gem install algoliasearch</code>.
|
33
|
+
2. Initialize the client with your ApplicationID and API-Key. You can find all of them on [your Algolia account](http://www.algolia.com/users/edit).
|
34
34
|
|
35
35
|
```ruby
|
36
36
|
require 'rubygems'
|
@@ -254,7 +254,7 @@ You can retrieve all settings using the `getSettings` function. The result will
|
|
254
254
|
* **attributesToIndex**: (array of strings) the list of fields you want to index.<br/>By default all textual attributes of your objects are indexed, but you should update it to get optimal results.<br/>This parameter has two important uses:
|
255
255
|
* *Limits the attributes to index*.<br/>For example if you store a binary image in base64, you want to store it and be able to retrieve it but you don't want to search in the base64 string.
|
256
256
|
* *Controls part of the ranking*.<br/>Matches in attributes at the beginning of the list will be considered more important than matches in attributes further down the list.
|
257
|
-
* **ranking**: (array of strings) controls the way hits are sorted.<br/>We have
|
257
|
+
* **ranking**: (array of strings) controls the way hits are sorted.<br/>We have six available criteria:
|
258
258
|
* **typo**: sort according to number of typos,
|
259
259
|
* **geo**: sort according to decreasing distance when performing a geo-location based search,
|
260
260
|
* **proximity**: sort according to the proximity of query words in hits,
|
@@ -308,7 +308,7 @@ res = index.add_object!({"firstname" => "Jimmie",
|
|
308
308
|
"lastname" => "Barninger"})
|
309
309
|
```
|
310
310
|
|
311
|
-
If you want to ensure multiple objects have been indexed, you can only check the biggest taskID
|
311
|
+
If you want to ensure multiple objects have been indexed, you can only check the biggest taskID with `wait_task`.
|
312
312
|
|
313
313
|
Batch writes
|
314
314
|
-------------
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/algoliasearch.gemspec
CHANGED
@@ -2,14 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: algoliasearch 1.0.2 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "algoliasearch"
|
8
|
-
s.version = "1.0.
|
9
|
+
s.version = "1.0.2"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
12
|
s.authors = ["Algolia"]
|
12
|
-
s.date = "2013-
|
13
|
+
s.date = "2013-09-17"
|
13
14
|
s.description = "A simple Ruby client for the algolia.com REST API"
|
14
15
|
s.email = "contact@algolia.com"
|
15
16
|
s.extra_rdoc_files = [
|
@@ -17,7 +18,6 @@ Gem::Specification.new do |s|
|
|
17
18
|
"README.md"
|
18
19
|
]
|
19
20
|
s.files = [
|
20
|
-
"contacts.json",
|
21
21
|
"Gemfile",
|
22
22
|
"Gemfile.lock",
|
23
23
|
"LICENSE.txt",
|
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
27
|
"algoliasearch.gemspec",
|
28
|
+
"contacts.json",
|
28
29
|
"lib/algolia/client.rb",
|
29
30
|
"lib/algolia/error.rb",
|
30
31
|
"lib/algolia/index.rb",
|
@@ -34,7 +35,7 @@ Gem::Specification.new do |s|
|
|
34
35
|
s.homepage = "http://github.com/algolia/algoliasearch-client-ruby"
|
35
36
|
s.licenses = ["MIT"]
|
36
37
|
s.require_paths = ["lib"]
|
37
|
-
s.rubygems_version = "2.
|
38
|
+
s.rubygems_version = "2.1.3"
|
38
39
|
s.summary = "A simple Ruby client for the algolia.com REST API"
|
39
40
|
|
40
41
|
if s.respond_to? :specification_version then
|
data/lib/algolia/index.rb
CHANGED
@@ -208,9 +208,23 @@ module Algolia
|
|
208
208
|
# @param objectID the unique identifier of object to delete
|
209
209
|
#
|
210
210
|
def delete_object(objectID)
|
211
|
+
if (objectID == nil || objectID.length == 0) then
|
212
|
+
raise AlgoliaProtocolError.new(0, "objectID is required")
|
213
|
+
end
|
211
214
|
Algolia.client.delete(Protocol.object_uri(name, objectID))
|
212
215
|
end
|
213
216
|
|
217
|
+
#
|
218
|
+
# Delete an object from the index and wait end of indexing
|
219
|
+
#
|
220
|
+
# @param objectID the unique identifier of object to delete
|
221
|
+
#
|
222
|
+
def delete_object!(objectID)
|
223
|
+
res = delete_object(objectID)
|
224
|
+
wait_task(res["taskID"])
|
225
|
+
return res
|
226
|
+
end
|
227
|
+
|
214
228
|
#
|
215
229
|
# Set settings for this index
|
216
230
|
#
|
metadata
CHANGED
@@ -1,94 +1,135 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: algoliasearch
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Algolia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-09-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
15
14
|
name: curb
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: "0"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
23
20
|
type: :runtime
|
24
|
-
version_requirements: *id001
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: bundler
|
27
21
|
prerelease: false
|
28
|
-
|
29
|
-
requirements:
|
30
|
-
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
31
34
|
type: :development
|
32
|
-
version_requirements: *id003
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: jeweler
|
35
35
|
prerelease: false
|
36
|
-
|
37
|
-
requirements:
|
38
|
-
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: jeweler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
39
48
|
type: :development
|
40
|
-
version_requirements: *id004
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: test-unit
|
43
49
|
prerelease: false
|
44
|
-
|
45
|
-
requirements:
|
46
|
-
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: test-unit
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
type: :development
|
48
|
-
version_requirements: *id005
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: rspec
|
51
63
|
prerelease: false
|
52
|
-
|
53
|
-
requirements:
|
54
|
-
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
55
76
|
type: :development
|
56
|
-
version_requirements: *id006
|
57
|
-
- !ruby/object:Gem::Dependency
|
58
|
-
name: shoulda-context
|
59
77
|
prerelease: false
|
60
|
-
|
61
|
-
requirements:
|
62
|
-
-
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: shoulda-context
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
63
90
|
type: :development
|
64
|
-
version_requirements: *id007
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: webmock
|
67
91
|
prerelease: false
|
68
|
-
|
69
|
-
requirements:
|
70
|
-
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webmock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
71
104
|
type: :development
|
72
|
-
version_requirements: *id008
|
73
|
-
- !ruby/object:Gem::Dependency
|
74
|
-
name: redgreen
|
75
105
|
prerelease: false
|
76
|
-
|
77
|
-
requirements:
|
78
|
-
-
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: redgreen
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
79
118
|
type: :development
|
80
|
-
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
81
125
|
description: A simple Ruby client for the algolia.com REST API
|
82
126
|
email: contact@algolia.com
|
83
127
|
executables: []
|
84
|
-
|
85
128
|
extensions: []
|
86
|
-
|
87
|
-
extra_rdoc_files:
|
129
|
+
extra_rdoc_files:
|
88
130
|
- LICENSE.txt
|
89
131
|
- README.md
|
90
|
-
files:
|
91
|
-
- contacts.json
|
132
|
+
files:
|
92
133
|
- Gemfile
|
93
134
|
- Gemfile.lock
|
94
135
|
- LICENSE.txt
|
@@ -96,33 +137,34 @@ files:
|
|
96
137
|
- Rakefile
|
97
138
|
- VERSION
|
98
139
|
- algoliasearch.gemspec
|
140
|
+
- contacts.json
|
99
141
|
- lib/algolia/client.rb
|
100
142
|
- lib/algolia/error.rb
|
101
143
|
- lib/algolia/index.rb
|
102
144
|
- lib/algolia/protocol.rb
|
103
145
|
- lib/algoliasearch.rb
|
104
146
|
homepage: http://github.com/algolia/algoliasearch-client-ruby
|
105
|
-
licenses:
|
147
|
+
licenses:
|
106
148
|
- MIT
|
107
149
|
metadata: {}
|
108
|
-
|
109
150
|
post_install_message:
|
110
151
|
rdoc_options: []
|
111
|
-
|
112
|
-
require_paths:
|
152
|
+
require_paths:
|
113
153
|
- lib
|
114
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
-
requirements:
|
116
|
-
-
|
117
|
-
|
118
|
-
|
119
|
-
|
154
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ! '>='
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
120
164
|
requirements: []
|
121
|
-
|
122
165
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
166
|
+
rubygems_version: 2.1.3
|
124
167
|
signing_key:
|
125
168
|
specification_version: 4
|
126
169
|
summary: A simple Ruby client for the algolia.com REST API
|
127
170
|
test_files: []
|
128
|
-
|