jekyll-meilisearch 0.1.0 → 0.1.1
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/lib/jekyll/meilisearch_indexer.rb +14 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 899303fffa3aed8db3e27dd8122db316a88510cf78ac6d244ab07ff8040f2f99
|
4
|
+
data.tar.gz: 410dd2dee4fd53a3c52a6e6fe39eea87addb19afc9f1c5d3b2ce27231ee85470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ecf6bc9818ebd761f63180d8be9756da0c0c5cefac700da4bcf8c55dd1489d270ffb6400343254143eb1818874af6b1b37e334038c6dc3b5938a7681cd6da0e
|
7
|
+
data.tar.gz: 439cc75ea35e137f24fecf473e803f1ff5e443d6f262c1dfddc8ac2af9b1c80c33d9eab7cb9d09fd7a070631f93f70d712f885cba39ac9311b65c85861ae37ad
|
@@ -47,7 +47,6 @@ module Jekyll
|
|
47
47
|
|
48
48
|
def build_documents(site, config)
|
49
49
|
documents = []
|
50
|
-
index_name = config['index_name'] || 'jekyll_documents'
|
51
50
|
collections_config = config['collections'] || { 'posts' => { 'fields' => ['title', 'content', 'url', 'date'] } }
|
52
51
|
|
53
52
|
collections_config.each do |collection_name, collection_settings|
|
@@ -155,9 +154,15 @@ module Jekyll
|
|
155
154
|
"indexing documents"
|
156
155
|
)
|
157
156
|
if response&.code == 202
|
158
|
-
|
159
|
-
|
160
|
-
|
157
|
+
if response.body
|
158
|
+
task = JSON.parse(response.body)
|
159
|
+
log_info("Task queued: UID #{task['taskUid']}. Check status at #{url}/tasks/#{task['taskUid']}")
|
160
|
+
else
|
161
|
+
log_info("Task queued (202), but no response body received.")
|
162
|
+
end
|
163
|
+
elsif response.nil?
|
164
|
+
log_info("Failed to queue indexing task: No response received from Meilisearch.")
|
165
|
+
else
|
161
166
|
log_info("Failed to queue indexing task: #{response.code} - #{response.body}")
|
162
167
|
end
|
163
168
|
end
|
@@ -191,7 +196,11 @@ module Jekyll
|
|
191
196
|
"resetting index"
|
192
197
|
)
|
193
198
|
unless response&.success? || response&.code == 404
|
194
|
-
|
199
|
+
if response.nil?
|
200
|
+
log_info("Failed to reset index: No response received from Meilisearch.")
|
201
|
+
else
|
202
|
+
log_info("Failed to reset index: #{response.code} - #{response.body}")
|
203
|
+
end
|
195
204
|
return
|
196
205
|
end
|
197
206
|
|