Skip to content

Commit

Permalink
Merge branch 'main' into bump-meilisearch-v1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
curquiza committed Mar 11, 2024
2 parents e447799 + d422a55 commit c560365
Show file tree
Hide file tree
Showing 31 changed files with 1,834 additions and 1,241 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
with:
config-name: release-draft-template.yml
env:
Expand Down
10 changes: 5 additions & 5 deletions .rubocop_todo.yml
@@ -1,21 +1,21 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-01-16 21:52:52 UTC using RuboCop version 1.50.2.
# on 2024-02-16 18:01:53 UTC using RuboCop version 1.50.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 55
# Offense count: 63
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 694
Max: 581

# Offense count: 2
# Offense count: 4
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 373
Max: 421

# Offense count: 1
# Configuration parameters: Max, CountKeywordArgs.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -18,5 +18,5 @@ group :development, :test do
end

group :development do
gem 'rubocop', '~> 1.50.1', require: false
gem 'rubocop', '~> 1.61.0', require: false
end
1 change: 1 addition & 0 deletions lib/meilisearch.rb
Expand Up @@ -2,6 +2,7 @@

require 'meilisearch/version'
require 'meilisearch/utils'
require 'meilisearch/models/task'
require 'meilisearch/http_request'
require 'meilisearch/multi_search'
require 'meilisearch/tenant_token'
Expand Down
18 changes: 13 additions & 5 deletions lib/meilisearch/client.rb
Expand Up @@ -16,7 +16,8 @@ def raw_indexes(options = {})
def swap_indexes(*options)
mapped_array = options.map { |arr| { indexes: arr } }

http_post '/swap-indexes', mapped_array
response = http_post '/swap-indexes', mapped_array
Models::Task.new(response, task_endpoint)
end

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

http_post '/indexes', body
response = http_post '/indexes', body

Models::Task.new(response, task_endpoint)
end

# Synchronous version of create_index.
# Waits for the task to be achieved, be careful when using it.
def create_index!(index_uid, options = {})
task = create_index(index_uid, options)
wait_for_task(task['taskUid'])
Utils.soft_deprecate(
'Client#create_index!',
"client.create_index('#{index_uid}').await"
)

create_index(index_uid, options).await
end

def delete_index(index_uid)
Expand Down Expand Up @@ -118,7 +125,8 @@ def stats
### DUMPS

def create_dump
http_post '/dumps'
response = http_post '/dumps'
Models::Task.new(response, task_endpoint)
end

### SNAPSHOTS
Expand Down

0 comments on commit c560365

Please sign in to comment.