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

Add multiple searches #714

Merged
merged 8 commits into from
Mar 27, 2023
Merged

Add multiple searches #714

merged 8 commits into from
Mar 27, 2023

Conversation

alallema
Copy link
Contributor

@alallema alallema commented Mar 20, 2023

Now Meilisearch can perform multiple searches in one single HTTP request.
A new method has been added as specifications:
multi_search(self, queries: Dict[str, Any]) -> Dict[str, Any]

It's take a List as:
[{"indexUid": "indexA", "q": ""}, {"indexUid": "indexB", "q": ""}]

SDK requirements: meilisearch/integration-guides#251

meilisearch/client.py Outdated Show resolved Hide resolved
meilisearch/client.py Outdated Show resolved Hide resolved
alallema and others added 2 commits March 20, 2023 15:49
Co-authored-by: Paul Sanders <psanders1@gmail.com>
Co-authored-by: Paul Sanders <psanders1@gmail.com>
@alallema alallema marked this pull request as ready for review March 20, 2023 14:50
@@ -0,0 +1,33 @@
import pytest

from meilisearch.errors import MeiliSearchApiError
Copy link
Collaborator

@sanders41 sanders41 Mar 20, 2023

Choose a reason for hiding this comment

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

FYI, the black error is because there should be 2 line breaks here, the isort error is unrelated to this PR. I'm going to do a separate PR now to fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you so much!

Copy link
Collaborator

@sanders41 sanders41 left a comment

Choose a reason for hiding this comment

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

LGTM!

meilisearch/client.py Outdated Show resolved Hide resolved
meilisearch/client.py Outdated Show resolved Hide resolved
meilisearch/client.py Outdated Show resolved Hide resolved
alallema and others added 2 commits March 23, 2023 14:58
Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
@alallema alallema requested a review from brunoocasali March 23, 2023 14:04
@alallema alallema added the enhancement New feature or request label Mar 27, 2023
@alallema alallema merged commit 5adb861 into bump-meilisearch-v1.1.0 Mar 27, 2023
@alallema alallema deleted the multi-search branch March 27, 2023 12:08
bors bot added a commit that referenced this pull request Apr 3, 2023
709: Changes related to the next Meilisearch release (v1.1.0) r=bidoubiwa a=meili-bot

Related to this issue: meilisearch/integration-guides#251

This PR:
- gathers the changes related to the next Meilisearch release (v1.1.0) so that this package is ready when the official release is out.
- should pass the tests against the [latest pre-release of Meilisearch](https://github.com/meilisearch/meilisearch/releases).
- might eventually contain test failures until the Meilisearch v1.1.0 is out.

⚠️ This PR should NOT be merged until the next release of Meilisearch (v1.1.0) is out.

_This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/main/resources/pre-release-week.md) purpose._

Done:
- #714 
- #716

726: Update version for the next release (v0.26.0) r=bidoubiwa a=meili-bot

This version makes this package compatible with Meilisearch v1.1 🎉
Check out the changelog of [Meilisearch v1.1](https://github.com/meilisearch/meilisearch/releases/tag/v1.1.0) for more information on the changes.

## ⚠️ Breaking changes

* Change error names from MeiliSerach to Meilisearch (#720) `@sanders41`

## 🚀 Enhancements

- Add the ability to provide a specific `csv-delimiter` when adding and updating documents in CSV format (#716) `@alallema`
- New method `client.multi_search()` provides the possibility to make multiple requests at once (#714) `@alallema`

Example:
```python
  client.multi_search(
    [
      {'indexUid': 'movies', 'q': 'pooh', 'limit': 5},
      {'indexUid': 'movies', 'q': 'nemo', 'limit': 5},
      {'indexUid': 'movie_ratings', 'q': 'us'}
    ]
  )
```


Thanks again to `@alallema` and `@sanders41!` 🎉

Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: alallema <amelie@meilisearch.com>
Co-authored-by: Amélie <alallema@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants