typesense 0.7.0.pre0 → 0.7.0.pre1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 680a4251ea189d959a84665eb824d50efabdbe3359be1f787f23d9ea230ab16f
4
- data.tar.gz: cdbb99c7ab1d32408c7100c3d1167a1ce8d1177014b80051ad4a5e2c13fbec99
3
+ metadata.gz: 3803dbc3cd03bcd1fe38c1d677f69154e8e96440c5854fa0ed55ed96a391f861
4
+ data.tar.gz: 18879ab944d054d7ae1bbdfedcf12a6df1aaf6afe1ff46c4cbee3689368ebdc4
5
5
  SHA512:
6
- metadata.gz: b161ddf9e1d3445934c77444d0a7d4cfb2ae6efb8879dd9f15020d286f4347bcb40933c7ad201b5d9b8cc5a3848b484586984bb07d7ac584a3e325941f08ca50
7
- data.tar.gz: 04506357d9defab42a6c85d3c06b963670050944a26e6e0378cbca06b82ad2254312de2862f1fab72d8106a0dcebdc42c3c92c96bb596da9d67de4cfd1b0295c
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 show you how the Ruby client works: [examples](examples)
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 (elements in the array) as needed.
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
- array_of_json_strings = @typesense.collections['companies'].documents.export
218
- ap array_of_json_strings
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
@@ -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 SocketError, EOFError,
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Typesense
4
- VERSION = '0.7.0.pre0'
4
+ VERSION = '0.7.0.pre1'
5
5
  end
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.pre0
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-15 00:00:00.000000000 Z
11
+ date: 2020-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print