typesense 0.7.0.pre0 → 0.7.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/examples/collections_and_documents.rb +7 -7
- data/lib/typesense/api_call.rb +1 -2
- data/lib/typesense/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3803dbc3cd03bcd1fe38c1d677f69154e8e96440c5854fa0ed55ed96a391f861
|
4
|
+
data.tar.gz: 18879ab944d054d7ae1bbdfedcf12a6df1aaf6afe1ff46c4cbee3689368ebdc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bce2e1a2749cfbb67093ac42b41cd5c5c940fde602f9e7f30974396ba182fb61e3352d634be4364a02772e86a4d66b9e4c89d6a07923f0ec0b8d256b40918952
|
7
|
+
data.tar.gz: c0197e8c8f81c655b41dca0be24bfaaf05922774ca327865a46c4f9fdf4512d9e53b60bbff340e211b7c7d683e2434ff1e7a944c2219db8b8dcbeee3c96dbe0a
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ Or install it yourself as:
|
|
25
25
|
|
26
26
|
You'll find detailed documentation here: [https://typesense.org/api/](https://typesense.org/api/)
|
27
27
|
|
28
|
-
Here are some examples that
|
28
|
+
Here are some examples with inline comments that walk you through how to use the Ruby client: [examples](examples)
|
29
29
|
|
30
30
|
Tests are also a good place to know how the the library works internally: [spec](spec)
|
31
31
|
|
@@ -210,17 +210,17 @@ documents = [
|
|
210
210
|
]
|
211
211
|
ap @typesense.collections['companies'].documents.create_many(documents)
|
212
212
|
|
213
|
+
## If you already have documents in JSONL format, you can also use #import instead, to avoid the JSON parsing overhead:
|
214
|
+
# @typesense.collections['companies'].documents.import(documents_in_jsonl_format)
|
215
|
+
|
213
216
|
##
|
214
217
|
# Export all documents in a collection in JSON Lines format
|
215
|
-
# We use JSON Lines format for performance reasons. You can choose to parse selected lines
|
218
|
+
# We use JSON Lines format for performance reasons. You can choose to parse selected lines as needed, by splitting on \n.
|
216
219
|
sleep 0.5 # Give Typesense cluster a few hundred ms to create the document on all nodes, before reading it right after (eventually consistent)
|
217
|
-
|
218
|
-
ap
|
220
|
+
jsonl_data = @typesense.collections['companies'].documents.export
|
221
|
+
ap jsonl_data
|
219
222
|
|
220
|
-
#
|
221
|
-
# [0] "{\"company_name\":\"Stark Industries\",\"country\":\"USA\",\"id\":\"124\",\"num_employees\":5215}",
|
222
|
-
# [1] "{\"company_name\":\"Acme Corp\",\"country\":\"France\",\"id\":\"125\",\"num_employees\":1002}"
|
223
|
-
# ]
|
223
|
+
# "{\"company_name\":\"Stark Industries\",\"country\":\"USA\",\"id\":\"124\",\"num_employees\":5215}\n{\"company_name\":\"Acme Corp\",\"country\":\"France\",\"id\":\"125\",\"num_employees\":1002}"
|
224
224
|
|
225
225
|
##
|
226
226
|
# Cleanup
|
data/lib/typesense/api_call.rb
CHANGED
@@ -91,8 +91,7 @@ module Typesense
|
|
91
91
|
|
92
92
|
exception_message = (parsed_response && parsed_response['message']) || 'Error'
|
93
93
|
raise custom_exception_klass_for(response), exception_message
|
94
|
-
rescue
|
95
|
-
Errno::EINVAL, Errno::ENETDOWN, Errno::ENETUNREACH, Errno::ENETRESET, Errno::ECONNABORTED, Errno::ECONNRESET,
|
94
|
+
rescue Errno::EINVAL, Errno::ENETDOWN, Errno::ENETUNREACH, Errno::ENETRESET, Errno::ECONNABORTED, Errno::ECONNRESET,
|
96
95
|
Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTDOWN, Errno::EHOSTUNREACH,
|
97
96
|
Typesense::Error::TimeoutError, Typesense::Error::ServerError, Typesense::Error::HTTPStatus0Error => e
|
98
97
|
# Rescue network layer exceptions and HTTP 5xx errors, so the loop can continue.
|
data/lib/typesense/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typesense
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.0.
|
4
|
+
version: 0.7.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Typesense, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|