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 +4 -4
- data/lib/meilisearch/index.rb +30 -0
- data/lib/meilisearch/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9782242369c3ad58f78c3acb55a0e78440c8a83e27018b2a3f0b425bccbbb3ae
|
4
|
+
data.tar.gz: 8b9ba817a3fb87ea17058a25550f38758d355df2f6c3c83b4e8f30273f2390c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76e831c930ab8b01943972fee81df852d811bd2ca1f35be0f953dac1319bd59476799d5ad0d41c72f4a39b2737001a0b1c3f06780c86ace4f32d73eb4dcf424b
|
7
|
+
data.tar.gz: fbcdef31995193bcf885e8a8ff837031b1882e329be90ab205c3a3d97b2d4d5f22cdf9e0af6dcc0694fc9ae56b2be5a2717a98aeaae568604dd16d7182fb8abe
|
data/lib/meilisearch/index.rb
CHANGED
@@ -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 = {})
|
data/lib/meilisearch/version.rb
CHANGED
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.
|
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:
|
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:
|
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
|
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
|