Class: MeiliSearch::Index
Constant Summary
Constants inherited
from HTTPRequest
HTTPRequest::DEFAULT_OPTIONS
Instance Attribute Summary collapse
Attributes inherited from HTTPRequest
#headers, #options
Instance Method Summary
collapse
-
#add_documents(documents, primary_key = nil) ⇒ Object
(also: #replace_documents, #add_or_replace_documents)
-
#add_documents!(documents, primary_key = nil) ⇒ Object
(also: #replace_documents!, #add_or_replace_documents!)
-
#add_documents_csv(documents, primary_key = nil) ⇒ Object
(also: #replace_documents_csv, #add_or_replace_documents_csv)
-
#add_documents_in_batches(documents, batch_size = 1000, primary_key = nil) ⇒ Object
-
#add_documents_in_batches!(documents, batch_size = 1000, primary_key = nil) ⇒ Object
-
#add_documents_json(documents, primary_key = nil) ⇒ Object
(also: #replace_documents_json, #add_or_replace_documents_json)
-
#add_documents_ndjson(documents, primary_key = nil) ⇒ Object
(also: #replace_documents_ndjson, #add_or_replace_documents_ndjson)
-
#delete ⇒ Object
(also: #delete_index)
-
#delete_all_documents ⇒ Object
-
#delete_all_documents! ⇒ Object
-
#delete_document(document_id) ⇒ Object
(also: #delete_one_document)
-
#delete_document!(document_id) ⇒ Object
(also: #delete_one_document!)
-
#delete_documents(documents_ids) ⇒ Object
(also: #delete_multiple_documents)
-
#delete_documents!(documents_ids) ⇒ Object
(also: #delete_multiple_documents!)
-
#displayed_attributes ⇒ Object
(also: #get_displayed_attributes)
SETTINGS - DISPLAYED ATTRIBUTES.
-
#distinct_attribute ⇒ Object
(also: #get_distinct_attribute)
SETTINGS - DINSTINCT ATTRIBUTE.
-
#document(document_id, fields: nil) ⇒ Object
(also: #get_document, #get_one_document)
-
#documents(options = {}) ⇒ Object
(also: #get_documents)
-
#faceting ⇒ Object
(also: #get_faceting)
-
#fetch_info ⇒ Object
-
#fetch_primary_key ⇒ Object
(also: #get_primary_key)
-
#fetch_raw_info ⇒ Object
-
#field_distribution ⇒ Object
-
#filterable_attributes ⇒ Object
(also: #get_filterable_attributes)
SETTINGS - FILTERABLE ATTRIBUTES.
-
#indexing? ⇒ Boolean
-
#initialize(index_uid, url, api_key = nil, primary_key = nil, options = {}) ⇒ Index
constructor
-
#number_of_documents ⇒ Object
-
#pagination ⇒ Object
(also: #get_pagination)
-
#ranking_rules ⇒ Object
(also: #get_ranking_rules)
SETTINGS - RANKING RULES.
-
#reset_displayed_attributes ⇒ Object
-
#reset_distinct_attribute ⇒ Object
-
#reset_faceting ⇒ Object
-
#reset_filterable_attributes ⇒ Object
-
#reset_pagination ⇒ Object
-
#reset_ranking_rules ⇒ Object
-
#reset_searchable_attributes ⇒ Object
-
#reset_settings ⇒ Object
-
#reset_sortable_attributes ⇒ Object
-
#reset_stop_words ⇒ Object
-
#reset_synonyms ⇒ Object
-
#reset_typo_tolerance ⇒ Object
-
#search(query, options = {}) ⇒ Object
-
#searchable_attributes ⇒ Object
(also: #get_searchable_attributes)
SETTINGS - SEARCHABLE ATTRIBUTES.
-
#settings ⇒ Object
(also: #get_settings)
-
#sortable_attributes ⇒ Object
(also: #get_sortable_attributes)
SETTINGS - SORTABLE ATTRIBUTES.
-
#stats ⇒ Object
-
#stop_words ⇒ Object
(also: #get_stop_words)
-
#synonyms ⇒ Object
(also: #get_synonyms)
-
#task(task_uid) ⇒ Object
-
#tasks ⇒ Object
-
#typo_tolerance ⇒ Object
(also: #get_typo_tolerance)
-
#update(body) ⇒ Object
(also: #update_index)
-
#update_displayed_attributes(displayed_attributes) ⇒ Object
(also: #displayed_attributes=)
-
#update_distinct_attribute(distinct_attribute) ⇒ Object
(also: #distinct_attribute=)
-
#update_documents(documents, primary_key = nil) ⇒ Object
(also: #add_or_update_documents)
-
#update_documents!(documents, primary_key = nil) ⇒ Object
(also: #add_or_update_documents!)
-
#update_documents_in_batches(documents, batch_size = 1000, primary_key = nil) ⇒ Object
-
#update_documents_in_batches!(documents, batch_size = 1000, primary_key = nil) ⇒ Object
-
#update_faceting(faceting_attributes) ⇒ Object
(also: #faceting=)
-
#update_filterable_attributes(filterable_attributes) ⇒ Object
(also: #filterable_attributes=)
-
#update_pagination(pagination) ⇒ Object
-
#update_ranking_rules(ranking_rules) ⇒ Object
(also: #ranking_rules=)
-
#update_searchable_attributes(searchable_attributes) ⇒ Object
(also: #searchable_attributes=)
-
#update_settings(settings) ⇒ Object
(also: #settings=)
-
#update_sortable_attributes(sortable_attributes) ⇒ Object
(also: #sortable_attributes=, #pagination=)
-
#update_stop_words(stop_words) ⇒ Object
(also: #stop_words=)
-
#update_synonyms(synonyms) ⇒ Object
(also: #synonyms=)
-
#update_typo_tolerance(typo_tolerance_attributes) ⇒ Object
(also: #typo_tolerance=)
-
#wait_for_task(task_uid, timeout_in_ms = 5000, interval_in_ms = 50) ⇒ Object
Methods inherited from HTTPRequest
#http_delete, #http_get, #http_patch, #http_post, #http_put
Constructor Details
#initialize(index_uid, url, api_key = nil, primary_key = nil, options = {}) ⇒ Index
Returns a new instance of Index.
9
10
11
12
13
|
# File 'lib/meilisearch/index.rb', line 9
def initialize(index_uid, url, api_key = nil, primary_key = nil, options = {})
@uid = index_uid
@primary_key = primary_key
super(url, api_key, options)
end
|
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
7
8
9
|
# File 'lib/meilisearch/index.rb', line 7
def created_at
@created_at
end
|
#primary_key ⇒ Object
Returns the value of attribute primary_key.
7
8
9
|
# File 'lib/meilisearch/index.rb', line 7
def primary_key
@primary_key
end
|
#uid ⇒ Object
Returns the value of attribute uid.
7
8
9
|
# File 'lib/meilisearch/index.rb', line 7
def uid
@uid
end
|
#updated_at ⇒ Object
Returns the value of attribute updated_at.
7
8
9
|
# File 'lib/meilisearch/index.rb', line 7
def updated_at
@updated_at
end
|
Instance Method Details
#add_documents(documents, primary_key = nil) ⇒ Object
Also known as:
replace_documents, add_or_replace_documents
74
75
76
77
|
# File 'lib/meilisearch/index.rb', line 74
def add_documents(documents, primary_key = nil)
documents = [documents] if documents.is_a?(Hash)
http_post "/indexes/#{@uid}/documents", documents, { primaryKey: primary_key }.compact
end
|
#add_documents!(documents, primary_key = nil) ⇒ Object
Also known as:
replace_documents!, add_or_replace_documents!
81
82
83
84
|
# File 'lib/meilisearch/index.rb', line 81
def add_documents!(documents, primary_key = nil)
task = add_documents(documents, primary_key)
wait_for_task(task['taskUid'])
end
|
#add_documents_csv(documents, primary_key = nil) ⇒ Object
Also known as:
replace_documents_csv, add_or_replace_documents_csv
102
103
104
105
|
# File 'lib/meilisearch/index.rb', line 102
def add_documents_csv(documents, primary_key = nil)
options = { headers: { 'Content-Type' => 'text/csv' }, convert_body?: false }
http_post "/indexes/#{@uid}/documents", documents, { primaryKey: primary_key }.compact, options
end
|
#add_documents_in_batches(documents, batch_size = 1000, primary_key = nil) ⇒ Object
121
122
123
124
125
126
127
|
# File 'lib/meilisearch/index.rb', line 121
def add_documents_in_batches(documents, batch_size = 1000, primary_key = nil)
tasks = []
documents.each_slice(batch_size) do |batch|
tasks.append(add_documents(batch, primary_key))
end
tasks
end
|
#add_documents_in_batches!(documents, batch_size = 1000, primary_key = nil) ⇒ Object
129
130
131
132
133
134
135
136
|
# File 'lib/meilisearch/index.rb', line 129
def add_documents_in_batches!(documents, batch_size = 1000, primary_key = nil)
tasks = add_documents_in_batches(documents, batch_size, primary_key)
responses = []
tasks.each do |task_obj|
responses.append(wait_for_task(task_obj['taskUid']))
end
responses
end
|
#add_documents_json(documents, primary_key = nil) ⇒ Object
Also known as:
replace_documents_json, add_or_replace_documents_json
88
89
90
91
|
# File 'lib/meilisearch/index.rb', line 88
def add_documents_json(documents, primary_key = nil)
options = { convert_body?: false }
http_post "/indexes/#{@uid}/documents", documents, { primaryKey: primary_key }.compact, options
end
|
#add_documents_ndjson(documents, primary_key = nil) ⇒ Object
Also known as:
replace_documents_ndjson, add_or_replace_documents_ndjson
95
96
97
98
|
# File 'lib/meilisearch/index.rb', line 95
def add_documents_ndjson(documents, primary_key = nil)
options = { headers: { 'Content-Type' => 'application/x-ndjson' }, convert_body?: false }
http_post "/indexes/#{@uid}/documents", documents, { primaryKey: primary_key }.compact, options
end
|
#delete ⇒ Object
Also known as:
delete_index
38
39
40
|
# File 'lib/meilisearch/index.rb', line 38
def delete
http_delete indexes_path(id: @uid)
end
|
#delete_all_documents ⇒ Object
182
183
184
|
# File 'lib/meilisearch/index.rb', line 182
def delete_all_documents
http_delete "/indexes/#{@uid}/documents"
end
|
#delete_all_documents! ⇒ Object
186
187
188
189
|
# File 'lib/meilisearch/index.rb', line 186
def delete_all_documents!
task = delete_all_documents
wait_for_task(task['taskUid'])
end
|
#delete_document(document_id) ⇒ Object
Also known as:
delete_one_document
170
171
172
173
|
# File 'lib/meilisearch/index.rb', line 170
def delete_document(document_id)
encode_document = URI.encode_www_form_component(document_id)
http_delete "/indexes/#{@uid}/documents/#{encode_document}"
end
|
#delete_document!(document_id) ⇒ Object
Also known as:
delete_one_document!
176
177
178
179
|
# File 'lib/meilisearch/index.rb', line 176
def delete_document!(document_id)
task = delete_document(document_id)
wait_for_task(task['taskUid'])
end
|
#delete_documents(documents_ids) ⇒ Object
Also known as:
delete_multiple_documents
155
156
157
158
159
160
161
|
# File 'lib/meilisearch/index.rb', line 155
def delete_documents(documents_ids)
if documents_ids.is_a?(Array)
http_post "/indexes/#{@uid}/documents/delete-batch", documents_ids
else
delete_document(documents_ids)
end
end
|
#delete_documents!(documents_ids) ⇒ Object
Also known as:
delete_multiple_documents!
164
165
166
167
|
# File 'lib/meilisearch/index.rb', line 164
def delete_documents!(documents_ids)
task = delete_documents(documents_ids)
wait_for_task(task['taskUid'])
end
|
#displayed_attributes ⇒ Object
Also known as:
get_displayed_attributes
SETTINGS - DISPLAYED ATTRIBUTES
338
339
340
|
# File 'lib/meilisearch/index.rb', line 338
def displayed_attributes
http_get "/indexes/#{@uid}/settings/displayed-attributes"
end
|
#distinct_attribute ⇒ Object
Also known as:
get_distinct_attribute
SETTINGS - DINSTINCT ATTRIBUTE
306
307
308
|
# File 'lib/meilisearch/index.rb', line 306
def distinct_attribute
http_get "/indexes/#{@uid}/settings/distinct-attribute"
end
|
#document(document_id, fields: nil) ⇒ Object
Also known as:
get_document, get_one_document
57
58
59
60
61
62
|
# File 'lib/meilisearch/index.rb', line 57
def document(document_id, fields: nil)
encode_document = URI.encode_www_form_component(document_id)
body = { fields: fields&.join(',') }.compact
http_get("/indexes/#{@uid}/documents/#{encode_document}", body)
end
|
#documents(options = {}) ⇒ Object
Also known as:
get_documents
66
67
68
69
70
71
|
# File 'lib/meilisearch/index.rb', line 66
def documents(options = {})
body = Utils.transform_attributes(options.transform_keys(&:to_sym).slice(:limit, :offset, :fields))
body = body.transform_values { |v| v.respond_to?(:join) ? v.join(',') : v }
http_get "/indexes/#{@uid}/documents", body
end
|
#faceting ⇒ Object
Also known as:
get_faceting
415
416
417
|
# File 'lib/meilisearch/index.rb', line 415
def faceting
http_get("/indexes/#{@uid}/settings/faceting")
end
|
#fetch_info ⇒ Object
15
16
17
18
19
|
# File 'lib/meilisearch/index.rb', line 15
def fetch_info
index_hash = http_get indexes_path(id: @uid)
set_base_properties index_hash
self
end
|
#fetch_primary_key ⇒ Object
Also known as:
get_primary_key
21
22
23
|
# File 'lib/meilisearch/index.rb', line 21
def fetch_primary_key
fetch_info.primary_key
end
|
#fetch_raw_info ⇒ Object
26
27
28
29
30
|
# File 'lib/meilisearch/index.rb', line 26
def fetch_raw_info
index_hash = http_get indexes_path(id: @uid)
set_base_properties index_hash
index_hash
end
|
#field_distribution ⇒ Object
235
236
237
|
# File 'lib/meilisearch/index.rb', line 235
def field_distribution
stats['fieldDistribution']
end
|
#filterable_attributes ⇒ Object
Also known as:
get_filterable_attributes
SETTINGS - FILTERABLE ATTRIBUTES
354
355
356
|
# File 'lib/meilisearch/index.rb', line 354
def filterable_attributes
http_get "/indexes/#{@uid}/settings/filterable-attributes"
end
|
#indexing? ⇒ Boolean
231
232
233
|
# File 'lib/meilisearch/index.rb', line 231
def indexing?
stats['isIndexing']
end
|
#number_of_documents ⇒ Object
227
228
229
|
# File 'lib/meilisearch/index.rb', line 227
def number_of_documents
stats['numberOfDocuments']
end
|
386
387
388
|
# File 'lib/meilisearch/index.rb', line 386
def
http_get("/indexes/#{@uid}/settings/pagination")
end
|
#ranking_rules ⇒ Object
Also known as:
get_ranking_rules
257
258
259
|
# File 'lib/meilisearch/index.rb', line 257
def ranking_rules
http_get "/indexes/#{@uid}/settings/ranking-rules"
end
|
#reset_displayed_attributes ⇒ Object
348
349
350
|
# File 'lib/meilisearch/index.rb', line 348
def reset_displayed_attributes
http_delete "/indexes/#{@uid}/settings/displayed-attributes"
end
|
#reset_distinct_attribute ⇒ Object
316
317
318
|
# File 'lib/meilisearch/index.rb', line 316
def reset_distinct_attribute
http_delete "/indexes/#{@uid}/settings/distinct-attribute"
end
|
#reset_faceting ⇒ Object
426
427
428
|
# File 'lib/meilisearch/index.rb', line 426
def reset_faceting
http_delete("/indexes/#{@uid}/settings/faceting")
end
|
#reset_filterable_attributes ⇒ Object
364
365
366
|
# File 'lib/meilisearch/index.rb', line 364
def reset_filterable_attributes
http_delete "/indexes/#{@uid}/settings/filterable-attributes"
end
|
396
397
398
|
# File 'lib/meilisearch/index.rb', line 396
def
http_delete "/indexes/#{@uid}/settings/pagination"
end
|
#reset_ranking_rules ⇒ Object
267
268
269
|
# File 'lib/meilisearch/index.rb', line 267
def reset_ranking_rules
http_delete "/indexes/#{@uid}/settings/ranking-rules"
end
|
#reset_searchable_attributes ⇒ Object
332
333
334
|
# File 'lib/meilisearch/index.rb', line 332
def reset_searchable_attributes
http_delete "/indexes/#{@uid}/settings/searchable-attributes"
end
|
#reset_settings ⇒ Object
251
252
253
|
# File 'lib/meilisearch/index.rb', line 251
def reset_settings
http_delete "/indexes/#{@uid}/settings"
end
|
#reset_sortable_attributes ⇒ Object
380
381
382
|
# File 'lib/meilisearch/index.rb', line 380
def reset_sortable_attributes
http_delete "/indexes/#{@uid}/settings/sortable-attributes"
end
|
#reset_stop_words ⇒ Object
300
301
302
|
# File 'lib/meilisearch/index.rb', line 300
def reset_stop_words
http_delete "/indexes/#{@uid}/settings/stop-words"
end
|
#reset_synonyms ⇒ Object
283
284
285
|
# File 'lib/meilisearch/index.rb', line 283
def reset_synonyms
http_delete "/indexes/#{@uid}/settings/synonyms"
end
|
#reset_typo_tolerance ⇒ Object
411
412
413
|
# File 'lib/meilisearch/index.rb', line 411
def reset_typo_tolerance
http_delete("/indexes/#{@uid}/settings/typo-tolerance")
end
|
#search(query, options = {}) ⇒ Object
193
194
195
196
197
198
199
200
|
# File 'lib/meilisearch/index.rb', line 193
def search(query, options = {})
parsed_options = Utils.transform_attributes({ q: query.to_s }.merge(options.compact))
response = http_post "/indexes/#{@uid}/search", parsed_options
response['nbHits'] ||= response['estimatedTotalHits']
response
end
|
#searchable_attributes ⇒ Object
Also known as:
get_searchable_attributes
SETTINGS - SEARCHABLE ATTRIBUTES
322
323
324
|
# File 'lib/meilisearch/index.rb', line 322
def searchable_attributes
http_get "/indexes/#{@uid}/settings/searchable-attributes"
end
|
#settings ⇒ Object
Also known as:
get_settings
241
242
243
|
# File 'lib/meilisearch/index.rb', line 241
def settings
http_get "/indexes/#{@uid}/settings"
end
|
#sortable_attributes ⇒ Object
Also known as:
get_sortable_attributes
SETTINGS - SORTABLE ATTRIBUTES
370
371
372
|
# File 'lib/meilisearch/index.rb', line 370
def sortable_attributes
http_get "/indexes/#{@uid}/settings/sortable-attributes"
end
|
#stats ⇒ Object
223
224
225
|
# File 'lib/meilisearch/index.rb', line 223
def stats
http_get "/indexes/#{@uid}/stats"
end
|
#stop_words ⇒ Object
Also known as:
get_stop_words
289
290
291
|
# File 'lib/meilisearch/index.rb', line 289
def stop_words
http_get "/indexes/#{@uid}/settings/stop-words"
end
|
#synonyms ⇒ Object
Also known as:
get_synonyms
273
274
275
|
# File 'lib/meilisearch/index.rb', line 273
def synonyms
http_get "/indexes/#{@uid}/settings/synonyms"
end
|
#task(task_uid) ⇒ Object
209
210
211
|
# File 'lib/meilisearch/index.rb', line 209
def task(task_uid)
task_endpoint.index_task(task_uid)
end
|
#tasks ⇒ Object
213
214
215
|
# File 'lib/meilisearch/index.rb', line 213
def tasks
task_endpoint.index_tasks(@uid)
end
|
#typo_tolerance ⇒ Object
Also known as:
get_typo_tolerance
400
401
402
|
# File 'lib/meilisearch/index.rb', line 400
def typo_tolerance
http_get("/indexes/#{@uid}/settings/typo-tolerance")
end
|
#update(body) ⇒ Object
Also known as:
update_index
32
33
34
|
# File 'lib/meilisearch/index.rb', line 32
def update(body)
http_patch indexes_path(id: @uid), Utils.transform_attributes(body)
end
|
#update_displayed_attributes(displayed_attributes) ⇒ Object
Also known as:
displayed_attributes=
343
344
345
|
# File 'lib/meilisearch/index.rb', line 343
def update_displayed_attributes(displayed_attributes)
http_put "/indexes/#{@uid}/settings/displayed-attributes", displayed_attributes
end
|
#update_distinct_attribute(distinct_attribute) ⇒ Object
Also known as:
distinct_attribute=
311
312
313
|
# File 'lib/meilisearch/index.rb', line 311
def update_distinct_attribute(distinct_attribute)
http_put "/indexes/#{@uid}/settings/distinct-attribute", distinct_attribute
end
|
#update_documents(documents, primary_key = nil) ⇒ Object
Also known as:
add_or_update_documents
109
110
111
112
|
# File 'lib/meilisearch/index.rb', line 109
def update_documents(documents, primary_key = nil)
documents = [documents] if documents.is_a?(Hash)
http_put "/indexes/#{@uid}/documents", documents, { primaryKey: primary_key }.compact
end
|
#update_documents!(documents, primary_key = nil) ⇒ Object
Also known as:
add_or_update_documents!
115
116
117
118
|
# File 'lib/meilisearch/index.rb', line 115
def update_documents!(documents, primary_key = nil)
task = update_documents(documents, primary_key)
wait_for_task(task['taskUid'])
end
|
#update_documents_in_batches(documents, batch_size = 1000, primary_key = nil) ⇒ Object
138
139
140
141
142
143
144
|
# File 'lib/meilisearch/index.rb', line 138
def update_documents_in_batches(documents, batch_size = 1000, primary_key = nil)
tasks = []
documents.each_slice(batch_size) do |batch|
tasks.append(update_documents(batch, primary_key))
end
tasks
end
|
#update_documents_in_batches!(documents, batch_size = 1000, primary_key = nil) ⇒ Object
146
147
148
149
150
151
152
153
|
# File 'lib/meilisearch/index.rb', line 146
def update_documents_in_batches!(documents, batch_size = 1000, primary_key = nil)
tasks = update_documents_in_batches(documents, batch_size, primary_key)
responses = []
tasks.each do |task_obj|
responses.append(wait_for_task(task_obj['taskUid']))
end
responses
end
|
#update_faceting(faceting_attributes) ⇒ Object
Also known as:
faceting=
420
421
422
423
|
# File 'lib/meilisearch/index.rb', line 420
def update_faceting(faceting_attributes)
attributes = Utils.transform_attributes(faceting_attributes)
http_patch("/indexes/#{@uid}/settings/faceting", attributes)
end
|
#update_filterable_attributes(filterable_attributes) ⇒ Object
Also known as:
filterable_attributes=
359
360
361
|
# File 'lib/meilisearch/index.rb', line 359
def update_filterable_attributes(filterable_attributes)
http_put "/indexes/#{@uid}/settings/filterable-attributes", filterable_attributes
end
|
391
392
393
|
# File 'lib/meilisearch/index.rb', line 391
def ()
http_patch "/indexes/#{@uid}/settings/pagination",
end
|
#update_ranking_rules(ranking_rules) ⇒ Object
Also known as:
ranking_rules=
262
263
264
|
# File 'lib/meilisearch/index.rb', line 262
def update_ranking_rules(ranking_rules)
http_put "/indexes/#{@uid}/settings/ranking-rules", ranking_rules
end
|
#update_searchable_attributes(searchable_attributes) ⇒ Object
Also known as:
searchable_attributes=
327
328
329
|
# File 'lib/meilisearch/index.rb', line 327
def update_searchable_attributes(searchable_attributes)
http_put "/indexes/#{@uid}/settings/searchable-attributes", searchable_attributes
end
|
#update_settings(settings) ⇒ Object
Also known as:
settings=
246
247
248
|
# File 'lib/meilisearch/index.rb', line 246
def update_settings(settings)
http_patch "/indexes/#{@uid}/settings", Utils.transform_attributes(settings)
end
|
#update_sortable_attributes(sortable_attributes) ⇒ Object
Also known as:
sortable_attributes=,
375
376
377
|
# File 'lib/meilisearch/index.rb', line 375
def update_sortable_attributes(sortable_attributes)
http_put "/indexes/#{@uid}/settings/sortable-attributes", sortable_attributes
end
|
#update_stop_words(stop_words) ⇒ Object
Also known as:
stop_words=
294
295
296
297
|
# File 'lib/meilisearch/index.rb', line 294
def update_stop_words(stop_words)
body = stop_words.nil? || stop_words.is_a?(Array) ? stop_words : [stop_words]
http_put "/indexes/#{@uid}/settings/stop-words", body
end
|
#update_synonyms(synonyms) ⇒ Object
Also known as:
synonyms=
278
279
280
|
# File 'lib/meilisearch/index.rb', line 278
def update_synonyms(synonyms)
http_put "/indexes/#{@uid}/settings/synonyms", synonyms
end
|
#update_typo_tolerance(typo_tolerance_attributes) ⇒ Object
Also known as:
typo_tolerance=
405
406
407
408
|
# File 'lib/meilisearch/index.rb', line 405
def update_typo_tolerance(typo_tolerance_attributes)
attributes = Utils.transform_attributes(typo_tolerance_attributes)
http_patch("/indexes/#{@uid}/settings/typo-tolerance", attributes)
end
|
#wait_for_task(task_uid, timeout_in_ms = 5000, interval_in_ms = 50) ⇒ Object
217
218
219
|
# File 'lib/meilisearch/index.rb', line 217
def wait_for_task(task_uid, timeout_in_ms = 5000, interval_in_ms = 50)
task_endpoint.wait_for_task(task_uid, timeout_in_ms, interval_in_ms)
end
|