meilisearch 0.15.0 → 0.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e60c9c4ac5631947edf24d990c37fd06e09bbbb59b6eabd554fcacc7d8f231ed
4
- data.tar.gz: 5373d86aacf0791fa30f068d97ba9f5b857fa75930c3580ddd20449cd2db8e7b
3
+ metadata.gz: 9782242369c3ad58f78c3acb55a0e78440c8a83e27018b2a3f0b425bccbbb3ae
4
+ data.tar.gz: 8b9ba817a3fb87ea17058a25550f38758d355df2f6c3c83b4e8f30273f2390c0
5
5
  SHA512:
6
- metadata.gz: d7496a3f2ea08ed35ff277c0176c52fe8120290678a1594bd49637e96b03e825aad11bfd55370040fd3563577fea9fbc6a3a7df335bb400a78d2a46707072ff2
7
- data.tar.gz: db46abc6f60ec202641480eb0ac2232b2892ea966590d955735f4ab7a5ce98cc52493c87da7bb1ccc5d4399f95b0b4c7639619ad0a30ed4caa4f21e3af7aabf3
6
+ metadata.gz: 76e831c930ab8b01943972fee81df852d811bd2ca1f35be0f953dac1319bd59476799d5ad0d41c72f4a39b2737001a0b1c3f06780c86ace4f32d73eb4dcf424b
7
+ data.tar.gz: fbcdef31995193bcf885e8a8ff837031b1882e329be90ab205c3a3d97b2d4d5f22cdf9e0af6dcc0694fc9ae56b2be5a2717a98aeaae568604dd16d7182fb8abe
@@ -57,12 +57,25 @@ module MeiliSearch
57
57
  alias replace_documents add_documents
58
58
  alias add_or_replace_documents add_documents
59
59
 
60
+ def add_documents!(documents, primary_key = nil)
61
+ update = add_documents(documents, primary_key)
62
+ wait_for_pending_update(update['updateId'])
63
+ end
64
+ alias replace_documents! add_documents!
65
+ alias add_or_replace_documents! add_documents!
66
+
60
67
  def update_documents(documents, primary_key = nil)
61
68
  documents = [documents] if documents.is_a?(Hash)
62
69
  http_put "/indexes/#{@uid}/documents", documents, { primaryKey: primary_key }.compact
63
70
  end
64
71
  alias add_or_update_documents update_documents
65
72
 
73
+ def update_documents!(documents, primary_key = nil)
74
+ update = update_documents(documents, primary_key)
75
+ wait_for_pending_update(update['updateId'])
76
+ end
77
+ alias add_or_update_documents! update_documents!
78
+
66
79
  def delete_documents(documents_ids)
67
80
  if documents_ids.is_a?(Array)
68
81
  http_post "/indexes/#{@uid}/documents/delete-batch", documents_ids
@@ -72,16 +85,33 @@ module MeiliSearch
72
85
  end
73
86
  alias delete_multiple_documents delete_documents
74
87
 
88
+ def delete_documents!(documents_ids)
89
+ update = delete_documents(documents_ids)
90
+ wait_for_pending_update(update['updateId'])
91
+ end
92
+ alias delete_multiple_documents! delete_documents!
93
+
75
94
  def delete_document(document_id)
76
95
  encode_document = URI.encode_www_form_component(document_id)
77
96
  http_delete "/indexes/#{@uid}/documents/#{encode_document}"
78
97
  end
79
98
  alias delete_one_document delete_document
80
99
 
100
+ def delete_document!(document_id)
101
+ update = delete_document(document_id)
102
+ wait_for_pending_update(update['updateId'])
103
+ end
104
+ alias delete_one_document! delete_document!
105
+
81
106
  def delete_all_documents
82
107
  http_delete "/indexes/#{@uid}/documents"
83
108
  end
84
109
 
110
+ def delete_all_documents!
111
+ update = delete_all_documents
112
+ wait_for_pending_update(update['updateId'])
113
+ end
114
+
85
115
  ### SEARCH
86
116
 
87
117
  def search(query, options = {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MeiliSearch
4
- VERSION = '0.15.0'
4
+ VERSION = '0.15.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meilisearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meili
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-26 00:00:00.000000000 Z
11
+ date: 2021-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -54,14 +54,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
- version: '0'
57
+ version: 2.6.0
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.1.4
64
+ rubygems_version: 3.0.3.1
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: An easy-to-use ruby client for Meilisearch API