Skip to content

Commit c560365

Browse files
authored
Merge branch 'main' into bump-meilisearch-v1.7.0
2 parents e447799 + d422a55 commit c560365

31 files changed

+1834
-1241
lines changed

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
update_release_draft:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: release-drafter/release-drafter@v5
12+
- uses: release-drafter/release-drafter@v6
1313
with:
1414
config-name: release-draft-template.yml
1515
env:

.rubocop_todo.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-01-16 21:52:52 UTC using RuboCop version 1.50.2.
3+
# on 2024-02-16 18:01:53 UTC using RuboCop version 1.50.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 55
9+
# Offense count: 63
1010
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
1111
# AllowedMethods: refine
1212
Metrics/BlockLength:
13-
Max: 694
13+
Max: 581
1414

15-
# Offense count: 2
15+
# Offense count: 4
1616
# Configuration parameters: CountComments, CountAsOne.
1717
Metrics/ClassLength:
18-
Max: 373
18+
Max: 421
1919

2020
# Offense count: 1
2121
# Configuration parameters: Max, CountKeywordArgs.

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ group :development, :test do
1818
end
1919

2020
group :development do
21-
gem 'rubocop', '~> 1.50.1', require: false
21+
gem 'rubocop', '~> 1.61.0', require: false
2222
end

lib/meilisearch.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
require 'meilisearch/version'
44
require 'meilisearch/utils'
5+
require 'meilisearch/models/task'
56
require 'meilisearch/http_request'
67
require 'meilisearch/multi_search'
78
require 'meilisearch/tenant_token'

lib/meilisearch/client.rb

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ def raw_indexes(options = {})
1616
def swap_indexes(*options)
1717
mapped_array = options.map { |arr| { indexes: arr } }
1818

19-
http_post '/swap-indexes', mapped_array
19+
response = http_post '/swap-indexes', mapped_array
20+
Models::Task.new(response, task_endpoint)
2021
end
2122

2223
def indexes(options = {})
@@ -35,14 +36,20 @@ def indexes(options = {})
3536
def create_index(index_uid, options = {})
3637
body = Utils.transform_attributes(options.merge(uid: index_uid))
3738

38-
http_post '/indexes', body
39+
response = http_post '/indexes', body
40+
41+
Models::Task.new(response, task_endpoint)
3942
end
4043

4144
# Synchronous version of create_index.
4245
# Waits for the task to be achieved, be careful when using it.
4346
def create_index!(index_uid, options = {})
44-
task = create_index(index_uid, options)
45-
wait_for_task(task['taskUid'])
47+
Utils.soft_deprecate(
48+
'Client#create_index!',
49+
"client.create_index('#{index_uid}').await"
50+
)
51+
52+
create_index(index_uid, options).await
4653
end
4754

4855
def delete_index(index_uid)
@@ -118,7 +125,8 @@ def stats
118125
### DUMPS
119126

120127
def create_dump
121-
http_post '/dumps'
128+
response = http_post '/dumps'
129+
Models::Task.new(response, task_endpoint)
122130
end
123131

124132
### SNAPSHOTS

0 commit comments

Comments
 (0)