Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes related to the next MeiliSearch release (v0.21.0) #169

Merged
merged 20 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 29 additions & 32 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ get_settings_1: |-
update_settings_1: |-
client.index('movies').update_settings({
rankingRules: [
'typo',
'words',
'typo',
'proximity',
'attribute',
'wordsPosition',
'exactness',
'desc(release_date)',
'desc(rank)'
Expand Down Expand Up @@ -107,11 +106,10 @@ get_ranking_rules_1: |-
client.index('movies').ranking_rules
update_ranking_rules_1: |-
client.index('movies').update_ranking_rules([
'typo',
'words',
'typo',
'proximity',
'attribute',
'wordsPosition',
'exactness',
'asc(release_date)',
'desc(rank)'
Expand All @@ -134,15 +132,15 @@ update_searchable_attributes_1: |-
])
reset_searchable_attributes_1: |-
client.index('movies').reset_searchable_attributes
get_attributes_for_faceting_1: |-
client.index('movies').attributes_for_faceting
update_attributes_for_faceting_1: |-
client.index('movies').update_attributes_for_faceting([
get_filterable_attributes_1: |-
client.index('movies').filterable_attributes
update_filterable_attributes_1: |-
client.index('movies').update_filterable_attributes([
'genres',
'director'
])
reset_attributes_for_faceting_1: |-
client.index('movies').reset_attributes_for_faceting
reset_filterable_attributes_1: |-
client.index('movies').reset_filterable_attributes
get_displayed_attributes_1: |-
client.index('movies').get_displayed_attributes
update_displayed_attributes_1: |-
Expand Down Expand Up @@ -180,16 +178,16 @@ field_properties_guide_displayed_1: |-
]
})
filtering_guide_1: |-
client.index('movies').search('Avengers', { filters: 'release_date > 795484800' })
client.index('movies').search('Avengers', { filter: 'release_date > 795484800' })
filtering_guide_2: |-
client.index('movies').search('Batman', {
filters: 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")'
filter: 'release_date > 795484800 AND (director = "Tim Burton" OR director = "Christopher Nolan")'
})
filtering_guide_3: |-
client.index('movies').search('horror', { filters: 'director = "Jordan Peele"' })
client.index('movies').search('horror', { filter: 'director = "Jordan Peele"' })
filtering_guide_4: |-
client.index('movies').search('Planet of the Apes', {
filters: 'rating >= 3 AND (NOT director = "Tim Burton")'
filter: 'rating >= 3 AND (NOT director = "Tim Burton")'
})
search_parameter_guide_query_1: |-
client.index('movies').search('shifu')
Expand All @@ -211,25 +209,23 @@ search_parameter_guide_crop_1: |-
cropLength: 10
})
search_parameter_guide_highlight_1: |-
client.index('movies').search('shifu', {
client.index('movies').search('winter feast', {
attributesToHighlight: ['overview']
})
search_parameter_guide_matches_1: |-
client.index('movies').search('n', {
filters: 'title="Kung Fu Panda"',
attributesToHighlight: ['overview'],
client.index('movies').search('winter feast', {
matches: true
})
search_parameter_guide_filter_1: |-
client.index('movies').search('n', {
filters: 'title = Nightshift'
filter: 'title = Nightshift'
})
search_parameter_guide_filter_2: |-
client.index('movies').search('n', {
filters: 'title="Kung Fu Panda"'
client.index('movies').search('shifu', {
filter: 'title="Kung Fu Panda"'
})
settings_guide_synonyms_1: |-
client.index('movies').update_settings({
client.index('tops').update_settings({
synonyms: {
sweater: ['jumper'],
jumper: ['sweater']
Expand All @@ -246,11 +242,10 @@ settings_guide_stop_words_1: |-
settings_guide_ranking_rules_1: |-
client.index('movies').update_settings({
rankingRules: [
'typo',
'words',
'typo',
'proximity',
'attribute',
'wordsPosition',
'exactness',
'asc(release_date)',
'desc(rank)'
Expand Down Expand Up @@ -293,7 +288,7 @@ search_guide_1: |-
})
search_guide_2: |-
client.index('movies').search('Avengers', {
filters: 'release_date > 795484800'
filter: 'release_date > 795484800'
})
getting_started_add_documents_md: |-
```bash
Expand All @@ -320,28 +315,28 @@ getting_started_search_md: |-

[About this SDK](https://www.github.com/meilisearch/meilisearch-ruby)
faceted_search_update_settings_1: |-
client.index('movies').update_attributes_for_faceting([
client.index('movies').update_filterable_attributes([
'director',
'genres'
])
faceted_search_facet_filters_1: |-
faceted_search_filter_1: |-
client.index('movies').search('thriller', {
facetFilters: [['genres:Horror', 'genres:Mystery'], 'director:Jordan Peele']
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
})
faceted_search_facets_distribution_1: |-
client.index('movies').search('Batman', {
facetsDistribution: ['genres']
})
faceted_search_walkthrough_attributes_for_faceting_1: |-
client.index('movies').update_attributes_for_faceting([
faceted_search_walkthrough_filterable_attributes_1: |-
client.index('movies').update_filterable_attributes([
'director',
'producer',
'genres',
'production_companies'
])
faceted_search_walkthrough_facet_filters_1: |-
faceted_search_walkthrough_filter_1: |-
client.index('movies').search('thriller', {
facetFilters: [['genres:Horror', 'genres:Mystery'], 'director:Jordan Peele']
filter: [['genres = Horror', 'genres = Mystery'], 'director = "Jordan Peele"']
})
faceted_search_walkthrough_facets_distribution_1: |-
client.index('movies').search('Batman', {
Expand All @@ -351,3 +346,5 @@ post_dump_1: |-
client.create_dump
get_dump_status_1: |-
client.get_dump_status(20201006-053243949)
phrase_search_1: |-
client.index('movies').search('"african american" horror')
8 changes: 4 additions & 4 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-05-05 07:48:22 UTC using RuboCop version 1.13.0.
# on 2021-06-23 16:19:20 UTC using RuboCop version 1.16.1.
# 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
Expand All @@ -14,16 +14,16 @@ Gemspec/DateAssignment:
Exclude:
- 'meilisearch.gemspec'

# Offense count: 34
# Offense count: 32
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
Metrics/BlockLength:
Max: 445
Max: 460

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 212
Max: 215

# Offense count: 1
Naming/AccessorMethodName:
Expand Down
27 changes: 13 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing
# Contributing <!-- omit in toc -->

First of all, thank you for contributing to MeiliSearch! The goal of this document is to provide everything you need to know in order to contribute to MeiliSearch and its different integrations.

Expand All @@ -8,7 +8,6 @@ First of all, thank you for contributing to MeiliSearch! The goal of this docume
- [How to Contribute](#how-to-contribute)
- [Development Workflow](#development-workflow)
- [Git Guidelines](#git-guidelines)
- [Release Process (for internal team only)](#release-process-for-internal-team-only)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this wanted? Just to be sure. I don't know if it is written somewhere in which case my bad


<!-- /MarkdownTOC -->

Expand All @@ -23,20 +22,20 @@ First of all, thank you for contributing to MeiliSearch! The goal of this docume
1. Make sure that the contribution you want to make is explained or detailed in a GitHub issue! Find an [existing issue](https://github.com/meilisearch/meilisearch-ruby/issues/) or [open a new one](https://github.com/meilisearch/meilisearch-ruby/issues/new).
2. Once done, [fork the meilisearch-ruby repository](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) in your own GitHub account. Ask a maintainer if you want your issue to be checked before making a PR.
3. [Create a new Git branch](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-and-deleting-branches-within-your-repository).
4. Review the [Development Workflow](#workflow) section that describes the steps to maintain the repository.
4. Review the [Development Workflow](#development-workflow) section that describes the steps to maintain the repository.
5. Make the changes on your branch.
6. [Submit the branch as a PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) pointing to the `main` branch of the main meilisearch-ruby repository. A maintainer should comment and/or review your Pull Request within a few days. Although depending on the circumstances, it may take longer.<br>
We do not enforce a naming convention for the PRs, but **please use something descriptive of your changes**, having in mind that the title of your PR will be automatically added to the next [release changelog](https://github.com/meilisearch/meilisearch-ruby/releases/).

## Development Workflow

### Setup
### Setup <!-- omit in toc -->

```bash
bundle install
```

### Tests
### Tests <!-- omit in toc -->

Each PR should pass the tests to be accepted.

Expand All @@ -59,7 +58,7 @@ To launch a single test in a specific file:
bundle exec rspec spec/meilisearch/index/search_spec.rb -e 'does a basic search in index'
```

### Linter
### Linter <!-- omit in toc -->

Each PR should pass the linter to be accepted.

Expand All @@ -78,7 +77,7 @@ To update it, run the following command:
bundle exec rubocop --auto-gen-config
```

### Want to debug?
### Want to debug? <!-- omit in toc -->

You can use the [`byebug` gem](https://github.com/deivid-rodriguez/byebug).

Expand All @@ -99,12 +98,12 @@ require 'byebug'

## Git Guidelines

### Git Branches
### Git Branches <!-- omit in toc -->

All changes must be made in a branch and submitted as PR.
We do not enforce any branch naming style, but please use something descriptive of your changes.

### Git Commits
### Git Commits <!-- omit in toc -->

As minimal requirements, your commit message should:
- be capitalized
Expand All @@ -114,7 +113,7 @@ As minimal requirements, your commit message should:

We don't follow any other convention, but if you want to use one, we recommend [this one](https://chris.beams.io/posts/git-commit/).

### GitHub Pull Requests
### GitHub Pull Requests <!-- omit in toc -->

Some notes on GitHub PRs:

Expand All @@ -124,21 +123,21 @@ Some notes on GitHub PRs:
- All PRs must be reviewed and approved by at least one maintainer.
- The PR title should be accurate and descriptive of the changes. The title of the PR will be indeed automatically added to the next [release changelogs](https://github.com/meilisearch/meilisearch-ruby/releases/).

## Release Process (for internal team only)
## Release Process (for internal team only) <!-- omit in toc -->

MeiliSearch tools follow the [Semantic Versioning Convention](https://semver.org/).

### Automation to Rebase and Merge the PRs
### Automation to Rebase and Merge the PRs <!-- omit in toc -->

This project integrates a bot that helps us manage pull requests merging.<br>
_[Read more about this](https://github.com/meilisearch/integration-guides/blob/main/guides/bors.md)._

### Automated Changelogs
### Automated Changelogs <!-- omit in toc -->

This project integrates a tool to create automated changelogs.<br>
_[Read more about this](https://github.com/meilisearch/integration-guides/blob/main/guides/release-drafter.md)._

### How to Publish the Release
### How to Publish the Release <!-- omit in toc -->

⚠️ Before doing anything, make sure you got through the guide about [Releasing an Integration](https://github.com/meilisearch/integration-guides/blob/main/guides/integration-release.md).

Expand Down
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ documents = [
index.add_documents(documents) # => { "updateId": 0 }
```

With the `updateId`, you can check the status (`enqueued`, `processed` or `failed`) of your documents addition using the [update endpoint](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status).
With the `updateId`, you can check the status (`enqueued`, `processing`, `processed` or `failed`) of your documents addition using the [update endpoint](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status).

💡 To customize the `Client`, for example, increasing the default timeout, please check out [this section](https://github.com/meilisearch/meilisearch-ruby/wiki/Client-Options) of the Wiki.

Expand Down Expand Up @@ -122,11 +122,9 @@ Output:
All the supported options are described in the [search parameters](https://docs.meilisearch.com/reference/features/search_parameters.html) section of the documentation.

```ruby
index.search('prince',
{
filters: 'book_id > 10',
attributesToHighlight: ['*']
}
index.search(
'hob',
attributesToHighlight: ['*']
)
```

Expand All @@ -136,24 +134,24 @@ JSON output:
{
"hits": [
{
"book_id": 456,
"title": "Le Petit Prince",
"book_id": 1344,
"title": "The Hobbit",
"_formatted": {
"book_id": 456,
"title": "Le Petit <em>Prince</em>"
"book_id": 1344,
"title": "The <em>Hob</em>bit"
}
}
],
"offset": 0,
"limit": 20,
"processingTimeMs": 0,
"query": "prince"
"query": "hob"
}
```

## 🤖 Compatibility with MeiliSearch

This package only guarantees the compatibility with the [version v0.20.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.20.0).
This package only guarantees the compatibility with the [version v0.21.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.21.0).

## 💡 Learn More

Expand Down
Loading