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 multiSearch #481

Merged
merged 6 commits into from
Mar 28, 2023
Merged

Add multiSearch #481

merged 6 commits into from
Mar 28, 2023

Conversation

brunoocasali
Copy link
Member

  • Add a new class SearchQuery which will handle future search requests
  • Add a new method in $client called multiSearch() which will take an array of SearchQuery.

@brunoocasali brunoocasali added the enhancement New feature or request label Mar 21, 2023
@brunoocasali brunoocasali changed the base branch from main to add-csv-delimiter March 21, 2023 21:19
@@ -30,6 +31,7 @@ class Client
use HandlesTasks;
use HandlesKeys;
use HandlesSystem;
use HandlesMultiSearch;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just interesting - what's the decision to use so many traits that are used only once here and that just hides the code?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm following the adopted pattern, but in fact, I agree because the Client class would be humongous if all those methods were defined directly there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @norkunas,
@brunoocasali left on holliday so I'll be releasing this PR. I agree with you as well, nonetheless I suggest we open an issue on this subject for a possible refacto of that section and merge this one as it is. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

hi @bidoubiwa, i don't mind :)

@brunoocasali brunoocasali force-pushed the add-csv-delimiter branch 3 times, most recently from 649abf4 to 4956257 Compare March 22, 2023 17:47
Base automatically changed from add-csv-delimiter to bump-meilisearch-v1.1.0 March 22, 2023 17:54
brunoocasali and others added 5 commits March 22, 2023 16:12
Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>
Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>
Updates the requirements on [phpstan/phpstan](https://github.com/phpstan/phpstan) to permit the latest version.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](phpstan/phpstan@1.10.3...1.10.6)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
@brunoocasali brunoocasali marked this pull request as ready for review March 22, 2023 19:12
@bidoubiwa bidoubiwa merged commit 25a5e5d into bump-meilisearch-v1.1.0 Mar 28, 2023
@bidoubiwa bidoubiwa deleted the add-multi-search branch March 28, 2023 12:48
bors bot added a commit that referenced this pull request Apr 3, 2023
489: Update version for the next release (v1.1.0) r=bidoubiwa a=meili-bot

This version introduces features released on Meilisearch v1.1.0 🎉
Check out the changelog of [Meilisearch v1.1.0](https://github.com/meilisearch/meilisearch/releases/tag/v1.1.0) for more information on the changes.

### 🚀 Enhancements

- Add a new optional argument to `addDocumentsCsv`, `addDocumentsCsvInBatches`, and `updateDocumentsCsvInBatches`. This argument allows you to customize the separator character in your `csv` file. (#480) `@brunoocasali`
- Add a new getter, the `facetStats` on `SearchResult` (#487) `@brunoocasali.`
- Add `$client->multiSearch()` method to execute multiple search requests simultaneously with different configurations. (#481) `@brunoocasali`
  - Introduce `SearchQuery` builder class to build the search requests used in the `multiSearch`. 
    Usage example:

    ```php
    $this->client->multiSearch([
      (new SearchQuery())->setIndexUid('books')
          ->setQuery('princ')
          ->setSort(['author:desc']),
      (new SearchQuery())->setIndexUid('movies')
          ->setQuery('be')
          ->setHitsPerPage(4)
          ->setFilter(['duration-float > 3']),
    ]);
    ```
  ⚠️ The `SearchQuery` was not meant to be used if the regular `$index->search()` requests (yet).

Co-authored-by: meili-bot <74670311+meili-bot@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.

5 participants