typesensual 0.3.1 → 0.5.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/Gemfile.lock +4 -4
- data/lib/typesensual/collection.rb +2 -2
- data/lib/typesensual/search.rb +1 -1
- data/lib/typesensual/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: dc8cd0a5b5f24e00ac86366e5f12f3e717314791ed421a1864b94204e42445af
|
4
|
+
data.tar.gz: 226590b10f36c0bb4f4ea583d9080b153629e5359189f4cd2f360da1891cb9b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cc692009e32572a18a8506abd5125ce3841f6c444ba15b36ed7a5b07afb095ffb03199aece5f755a8c2b72d1df135429daccf956474df9f92f5be51dc99dab0
|
7
|
+
data.tar.gz: 3c7f8c3081de258e431b9135cc671a6bda03113804e6e48693616f0f492502fb4594ec81e913d708a1af8b6c2c1135b5527dd88f4e8b8541ba7d162b76e882b6
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
typesensual (0.
|
4
|
+
typesensual (0.5.0)
|
5
5
|
activesupport (>= 6.1.5)
|
6
6
|
paint (>= 2.0.0)
|
7
7
|
typesense (>= 0.13.0)
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (7.0.
|
12
|
+
activesupport (7.0.8)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 1.6, < 2)
|
15
15
|
minitest (>= 5.1)
|
@@ -25,8 +25,8 @@ GEM
|
|
25
25
|
i18n (1.14.1)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
27
|
json (2.6.3)
|
28
|
-
minitest (5.
|
29
|
-
oj (3.16.
|
28
|
+
minitest (5.20.0)
|
29
|
+
oj (3.16.1)
|
30
30
|
paint (2.3.0)
|
31
31
|
parallel (1.23.0)
|
32
32
|
parser (3.2.2.1)
|
@@ -157,7 +157,7 @@ class Typesensual
|
|
157
157
|
# @param doc [Hash] the document to insert
|
158
158
|
# @return [Boolean] if the document was inserted successfully
|
159
159
|
def insert_one!(doc)
|
160
|
-
typesense_collection.documents.
|
160
|
+
typesense_collection.documents.upsert(doc)
|
161
161
|
end
|
162
162
|
|
163
163
|
# Insert many documents into typesense. Notably, the input can be an enumerable
|
@@ -168,7 +168,7 @@ class Typesensual
|
|
168
168
|
# @return [Array<Hash>] any failed insertions
|
169
169
|
def insert_many!(docs, batch_size: 100)
|
170
170
|
docs.lazy.each_slice(batch_size).with_object([]) do |slice, failures|
|
171
|
-
results = typesense_collection.documents.import(slice, return_id: true)
|
171
|
+
results = typesense_collection.documents.import(slice, return_id: true, action: 'upsert')
|
172
172
|
failures.push(*results.reject { |result| result['success'] })
|
173
173
|
end
|
174
174
|
end
|
data/lib/typesensual/search.rb
CHANGED
@@ -137,7 +137,7 @@ class Typesensual
|
|
137
137
|
include_fields: @include_fields&.join(','),
|
138
138
|
exclude_fields: @exclude_fields&.join(','),
|
139
139
|
group_by: @group_by&.join(',')
|
140
|
-
}.merge(@params).
|
140
|
+
}.merge(@params).compact
|
141
141
|
end
|
142
142
|
|
143
143
|
# Load the results from the search query
|
data/lib/typesensual/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typesensual
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emma Lejeck
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|