Skip to content

Commit 42c644f

Browse files
authored
Merge branch 'main' into patch-1
2 parents 52812bf + c4b5834 commit 42c644f

29 files changed

+484
-227
lines changed

.code-samples.meilisearch.yaml

Lines changed: 96 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,56 @@
33
# the documentation on build
44
# You can read more on https://github.com/meilisearch/documentation/tree/master/.vuepress/code-samples
55
---
6+
getting_started_faceting: |-
7+
client.index('movies').update_faceting(max_values_per_facet: 2)
8+
getting_started_pagination: |-
9+
client.index('movies').update_pagination(max_total_hits: 500)
10+
synonyms_guide_1: |-
11+
client.index('movies').update_synonyms({
12+
great: ['fantastic'],
13+
fantastic: ['great']
14+
})
15+
date_guide_index_1: |-
16+
require 'json'
17+
18+
games = JSON.parse(File.read('games.json'))
19+
client.index('games').add_documents(games)
20+
date_guide_filterable_attributes_1: |-
21+
client.index('games').update_filterable_attributes(['release_timestamp'])
22+
date_guide_filter_1: |-
23+
client.index('games').search('', {
24+
filter: 'release_timestamp >= 1514761200 AND release_timestamp < 1672527600'
25+
})
26+
date_guide_sortable_attributes_1: |-
27+
client.index('games').update_sortable_attributes(['release_timestamp'])
28+
date_guide_sort_1: |-
29+
client.index('games').search('', sort: ['release_timestamp:desc'])
30+
async_guide_filter_by_date_1: |-
31+
client.get_tasks(after_enqueued_at: DateTime.new(2020, 10, 11, 11, 49, 53))
32+
async_guide_multiple_filters_1: |-
33+
client.get_tasks(index_uids: ['movies'], types: ['documentAdditionOrUpdate', 'documentDeletion'], statuses: ['processing'])
34+
async_guide_filter_by_ids_1: |-
35+
client.get_tasks(uids: [5, 10, 13])
36+
async_guide_filter_by_statuses_1: |-
37+
client.get_tasks(statuses: ['failed', 'canceled'])
38+
async_guide_filter_by_types_1: |-
39+
client.get_tasks(types: ['dumpCreation', 'indexSwap'])
40+
async_guide_filter_by_index_uids_1: |-
41+
client.get_tasks(index_uids: ['movies'])
42+
delete_tasks_1: |-
43+
client.delete_tasks(uids: [1, 2])
44+
cancel_tasks_1: |-
45+
client.cancel_tasks(uids: [1, 2])
46+
async_guide_canceled_by_1: |-
47+
client.get_tasks(canceled_by: [9, 15])
48+
swap_indexes_1: |-
49+
client.swap_indexes(['indexA', 'indexB'], ['indexX', 'indexY'])
50+
search_parameter_guide_hitsperpage_1: |-
51+
client.index('movies').search('', hits_per_page: 15)
52+
search_parameter_guide_page_1: |-
53+
client.index('movies').search('', page: 2)
654
getting_started_typo_tolerance: |-
755
client.index('movies').update_typo_tolerance({ min_word_size_for_typos: { one_typo: 4 } })
8-
9-
get_all_tasks_filtering_1: |-
10-
client.index('movies').tasks
11-
get_all_tasks_filtering_2: |-
12-
client.tasks(status: ['succeeded', 'failed'], type: ['documentAdditionOrUpdate'])
1356
get_all_tasks_paginating_1: |-
1457
client.tasks(limit: 2, from: 10)
1558
get_all_tasks_paginating_2: |-
@@ -26,10 +69,6 @@ update_faceting_settings_1: |-
2669
index('books').update_faceting({ max_values_per_facet: 2 })
2770
reset_faceting_settings_1: |-
2871
index('books').reset_faceting
29-
settings_guide_faceting_1: |-
30-
index('books').update_faceting({ max_values_per_facet: 5 })
31-
settings_guide_pagination_1: |-
32-
index('books').update_pagination({ max_total_hits: 50 })
3372
get_one_index_1: |-
3473
client.fetch_index('movies')
3574
list_all_indexes_1: |-
@@ -238,6 +277,10 @@ filtering_guide_3: |-
238277
client.index('movies').search('Planet of the Apes', {
239278
filter: 'rating >= 3 AND (NOT director = "Tim Burton")'
240279
})
280+
filtering_guide_nested_1: |-
281+
client.index('movies_ratings').search('thriller', {
282+
filter: 'rating.users >= 90'
283+
})
241284
search_parameter_guide_query_1: |-
242285
client.index('movies').search('shifu')
243286
search_parameter_guide_offset_1: |-
@@ -276,59 +319,13 @@ search_parameter_guide_show_matches_position_1: |-
276319
client.index('movies').search('winter feast', {
277320
show_matches_position: true
278321
})
279-
settings_guide_synonyms_1: |-
280-
client.index('tops').update_settings({
281-
synonyms: {
282-
sweater: ['jumper'],
283-
jumper: ['sweater']
284-
}
322+
search_parameter_guide_matching_strategy_1: |-
323+
client.index('movies').search('big fat liar', {
324+
matching_strategy: 'last'
285325
})
286-
settings_guide_stop_words_1: |-
287-
client.index('movies').update_settings({
288-
stop_words: [
289-
'the',
290-
'a',
291-
'an'
292-
]
293-
})
294-
settings_guide_ranking_rules_1: |-
295-
client.index('movies').update_settings({
296-
ranking_rules: [
297-
'words',
298-
'typo',
299-
'proximity',
300-
'attribute',
301-
'sort',
302-
'exactness',
303-
'release_date:asc',
304-
'rank:desc'
305-
]
306-
})
307-
settings_guide_distinct_1: |-
308-
client.index('jackets').update_distinct_attribute('product_id')
309-
settings_guide_searchable_1: |-
310-
client.index('movies').update_settings({
311-
searchable_attributes: [
312-
'title',
313-
'overview',
314-
'genres'
315-
]
316-
})
317-
settings_guide_displayed_1: |-
318-
client.index('movies').update_settings({
319-
displayed_attributes: [
320-
'title',
321-
'overview',
322-
'genres',
323-
'release_date'
324-
]
325-
})
326-
settings_guide_sortable_1: |-
327-
client.index('books').update_settings({
328-
sortable_attributes: [
329-
'price',
330-
'author'
331-
]
326+
search_parameter_guide_matching_strategy_2: |-
327+
client.index('movies').search('big fat liar', {
328+
matching_strategy: 'all'
332329
})
333330
add_movies_json_1: |-
334331
require 'json'
@@ -338,8 +335,8 @@ add_movies_json_1: |-
338335
client.index('movies').add_documents(movies)
339336
documents_guide_add_movie_1: |-
340337
client.index('movies').add_documents([{
341-
"movie_id": "123sq178",
342-
"title": "Amelie Poulain"
338+
movie_id: '123sq178',
339+
title: 'Amelie Poulain'
343340
}])
344341
getting_started_add_documents_md: |-
345342
```bash
@@ -365,11 +362,33 @@ getting_started_search_md: |-
365362
```
366363
367364
[About this SDK](https://www.github.com/meilisearch/meilisearch-ruby)
368-
faceted_search_update_settings_1: |-
365+
filtering_update_settings_1: |-
369366
client.index('movies').update_filterable_attributes([
370367
'director',
371368
'genres'
372369
])
370+
faceted_search_1: |-
371+
client.index('books').search('classic', {
372+
facets: ['genres', 'rating', 'language']
373+
})
374+
faceted_search_2: |-
375+
client.multi_search([
376+
{
377+
indexUid: 'books',
378+
facets: ['language', 'genres', 'author', 'format'],
379+
filter: [['language = English', 'language = French'], ['genres = Fiction']]
380+
},
381+
{
382+
indexUid: 'books',
383+
facets: ['language'],
384+
filter: [['genres = Fiction']]
385+
},
386+
{
387+
indexUid: 'books',
388+
facets: ['genres'],
389+
filter: [['language = English', 'language = French']]
390+
}
391+
])
373392
faceted_search_filter_1: |-
374393
client.index('movies').search('thriller', {
375394
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
@@ -380,6 +399,8 @@ faceted_search_walkthrough_filter_1: |-
380399
client.index('movies').search('thriller', {
381400
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
382401
})
402+
faceted_search_update_settings_1: |-
403+
client.index('books').update_filterable_attributes(['genres', 'rating', 'language'])
383404
post_dump_1: |-
384405
client.create_dump
385406
phrase_search_1: |-
@@ -406,6 +427,8 @@ update_sortable_attributes_1: |-
406427
'price',
407428
'author'
408429
])
430+
sorting_guide_sort_nested_1: |-
431+
client.index('books').search('science fiction', { sort: ['rating.users:asc'] })
409432
reset_sortable_attributes_1: |-
410433
client.index('books').reset_sortable_attributes
411434
search_parameter_guide_sort_1: |-
@@ -416,6 +439,8 @@ geosearch_guide_filter_usage_1: |-
416439
client.index('restaurants').search('', { filter: '_geoRadius(45.472735, 9.184019, 2000)' })
417440
geosearch_guide_filter_usage_2: |-
418441
client.index('restaurants').search('', { filter: '_geoRadius(45.472735, 9.184019, 2000) AND type = pizza' })
442+
geosearch_guide_filter_usage_3: |-
443+
client.index('restaurants').search('', { filter: ['_geoBoundingBox([45.494181, 9.179175], [45.449484, 9.214024])'] })
419444
geosearch_guide_sort_settings_1: |-
420445
client.index('restaurants').update_sortable_attributes(['_geo'])
421446
geosearch_guide_sort_usage_1: |-
@@ -571,10 +596,10 @@ typo_tolerance_guide_4: |-
571596
two_typos: 10
572597
}
573598
})
574-
settings_guide_typo_tolerance_1: |-
575-
index('books').update_typo_tolerance({
576-
min_word_size_for_typos: {
577-
two_typos: 12
578-
},
579-
disable_on_attributes: ['title']
580-
})
599+
multi_search_1: |-
600+
client.multi_search([
601+
{ index_uid: 'books', q: 'prince' },
602+
{ index_uid: 'movies', q: 'pooh', limit: 5 }
603+
{ index_uid: 'movies', q: 'nemo', limit: 5 }
604+
{ index_uid: 'movie_ratings', q: 'us' }
605+
])

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ updates:
55
schedule:
66
interval: "monthly"
77
labels:
8-
- 'skip changelog'
8+
- 'skip-changelog'
99
- 'dependencies'
1010
rebase-strategy: disabled
1111

.github/scripts/check-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
# Checking if current tag matches the package version
4-
current_tag=$(echo $GITHUB_REF | tr -d 'refs/tags/v')
4+
current_tag=$(echo $GITHUB_REF | cut -d '/' -f 3 | sed -r 's/^v//')
55
file_tag=$(grep 'VERSION = ' lib/meilisearch/version.rb | cut -d '=' -f 2- | tr -d ' ' | tr -d \')
66
if [ "$current_tag" != "$file_tag" ]; then
77
echo "Error: the current tag does not match the version in package file(s)."

.github/workflows/gempush.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-20.04
1212

1313
steps:
14-
- uses: actions/checkout@master
14+
- uses: actions/checkout@v3
1515
- name: Set up Ruby 2.6
1616
uses: actions/setup-ruby@v1
1717
with:

.github/workflows/pre-release-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: integration-tests-against-rc (ruby ${{ matrix.ruby-version }})
1818
runs-on: ubuntu-20.04
1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
2121
- name: Set up Ruby ${{ matrix.ruby-version }}
2222
uses: ruby/setup-ruby@v1
2323
with:

.rubocop_todo.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2022-07-27 15:08:15 UTC using RuboCop version 1.32.0.
3+
# on 2023-03-30 12:31:09 UTC using RuboCop version 1.48.1.
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

99
# Offense count: 1
1010
# This cop supports safe autocorrection (--autocorrect).
11-
# Configuration parameters: Include.
11+
# Configuration parameters: Severity, Include.
1212
# Include: **/*.gemspec
1313
Gemspec/RequireMFA:
1414
Exclude:
1515
- 'meilisearch.gemspec'
1616

17-
# Offense count: 46
18-
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
19-
# IgnoredMethods: refine
17+
# Offense count: 45
18+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
19+
# AllowedMethods: refine
2020
Metrics/BlockLength:
21-
Max: 626
21+
Max: 624
2222

2323
# Offense count: 2
2424
# Configuration parameters: CountComments, CountAsOne.
2525
Metrics/ClassLength:
26-
Max: 317
26+
Max: 318
2727

2828
# Offense count: 1
2929
# Configuration parameters: Max, CountKeywordArgs.

CONTRIBUTING.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume
44

55
<!-- MarkdownTOC autolink="true" style="ordered" indent=" " -->
66

7-
- [Hacktoberfest](#hacktoberfest-2022)
87
- [Assumptions](#assumptions)
98
- [How to Contribute](#how-to-contribute)
109
- [Development Workflow](#development-workflow)
@@ -13,18 +12,6 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume
1312

1413
<!-- /MarkdownTOC -->
1514

16-
## Hacktoberfest 2022
17-
18-
It's [Hacktoberfest month](https://hacktoberfest.com)! 🥳
19-
20-
Thanks so much for participating with Meilisearch this year!
21-
22-
1. We will follow the quality standards set by the organizers of Hacktoberfest (see detail on their [website](https://hacktoberfest.com/participation/#spam)). Our reviewers will not consider any PR that doesn’t match that standard.
23-
2. PRs reviews will take place from Monday to Thursday, during usual working hours, CEST time. If you submit outside of these hours, there’s no need to panic; we will get around to your contribution.
24-
3. There will be no issue assignment as we don’t want people to ask to be assigned specific issues and never return, discouraging the volunteer contributors from opening a PR to fix this issue. We take the liberty to choose the PR that best fixes the issue, so we encourage you to get to it as soon as possible and do your best!
25-
26-
You can check out the longer, more complete guideline documentation [here](https://github.com/meilisearch/.github/blob/main/Hacktoberfest_2022_contributors_guidelines.md).
27-
2815
## Assumptions
2916

3017
1. **You're familiar with [GitHub](https://github.com) and the [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests)(PR) workflow.**

Gemfile

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

1919
group :development do
20-
gem 'rubocop', '~> 1.37.1', require: false
20+
gem 'rubocop', '~> 1.50.1', require: false
2121
end

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<h4 align="center">
88
<a href="https://github.com/meilisearch/meilisearch">Meilisearch</a> |
99
<a href="https://docs.meilisearch.com">Documentation</a> |
10-
<a href="https://slack.meilisearch.com">Slack</a> |
10+
<a href="https://discord.meilisearch.com">Discord</a> |
1111
<a href="https://roadmap.meilisearch.com/tabs/1-under-consideration">Roadmap</a> |
1212
<a href="https://www.meilisearch.com">Website</a> |
1313
<a href="https://docs.meilisearch.com/faq">FAQ</a>
@@ -28,22 +28,13 @@
2828

2929
## Table of Contents <!-- omit in toc -->
3030

31-
- [🎃 Hacktoberfest](#-hacktoberfest)
3231
- [📖 Documentation](#-documentation)
3332
- [🔧 Installation](#-installation)
3433
- [🚀 Getting started](#-getting-started)
3534
- [🤖 Compatibility with Meilisearch](#-compatibility-with-meilisearch)
3635
- [💡 Learn more](#-learn-more)
3736
- [⚙️ Contributing](#️-contributing)
3837

39-
## 🎃 Hacktoberfest
40-
41-
It’s Hacktoberfest 2022 @Meilisearch
42-
43-
[Hacktoberfest](https://hacktoberfest.com/) is a celebration of the open-source community. This year, and for the third time in a row, Meilisearch is participating in this fantastic event.
44-
45-
You’d like to contribute? Don’t hesitate to check out our [contributing guidelines](./CONTRIBUTING.md).
46-
4738
## 📖 Documentation
4839

4940
This readme contains all the documentation you need to start using this Meilisearch SDK.
@@ -209,7 +200,7 @@ JSON output:
209200

210201
## 🤖 Compatibility with Meilisearch
211202

212-
This package only guarantees the compatibility with the [version v0.29.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.29.0).
203+
This package guarantees compatibility with [version v1.x of Meilisearch](https://github.com/meilisearch/meilisearch/releases/latest), but some features may not be present. Please check the [issues](https://github.com/meilisearch/meilisearch-ruby/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3Aenhancement) for more info.
213204

214205
## 💡 Learn more
215206

lib/meilisearch.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require 'meilisearch/version'
44
require 'meilisearch/utils'
55
require 'meilisearch/http_request'
6+
require 'meilisearch/multi_search'
67
require 'meilisearch/tenant_token'
78
require 'meilisearch/task'
89
require 'meilisearch/client'

0 commit comments

Comments
 (0)