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 #422

Merged
merged 4 commits into from
Mar 28, 2023
Merged

Add multiple searches #422

merged 4 commits into from
Mar 28, 2023

Conversation

alallema
Copy link
Contributor

@alallema alallema commented Mar 22, 2023

Now Meilisearch can perform multiple searches in one single HTTP request.
A new method has been added to the specifications:
MultiSearch(queries MultiSearchRequest) (*MultiSearchResponse, error)

The method takes []SearchRequest as argument:

	m := []meilisearch.SearchRequest{}
	m = append(m, meilisearch.SearchRequest{
		IndexUid: "movies",
		Query: "wonder",
	})
	client.MultiSearch(m)

SDK requirements: meilisearch/integration-guides#251

client.go Outdated Show resolved Hide resolved
types.go Outdated Show resolved Hide resolved
index_search.go Outdated Show resolved Hide resolved
@alallema alallema added the enhancement New feature or request label Mar 27, 2023
Copy link
Contributor

@bidoubiwa bidoubiwa left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

@bidoubiwa bidoubiwa self-requested a review March 27, 2023 15:49
@alallema alallema merged commit dac3428 into bump-meilisearch-v1.1.0 Mar 28, 2023
@alallema alallema deleted the multi-search branch March 28, 2023 08:04
bors bot added a commit that referenced this pull request Apr 3, 2023
427: Update version for the next release (v0.24.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.

## 🐛 Bug Fixes

- Fills the client field for each index entry returned by GetIndexes (#426) `@candiduslynx`

## ⚠️ Breaking changes

- Add the ability to provide a specific `csv-delimiter` when adding and updating documents in CSV format (#424) `@alallema`
    - New type `CsvDocumentsQuery{}`
    -  Changed `AddDocumentsCsv()` which takes `CsvDocumentsQuery` as a parameter instead of a `...string`
    -  Changed `AddDocumentsCsvInBatches()` which takes  `CsvDocumentsQuery` as a parameter instead of a `...string`
    -  Changed `UpdateDocumentsCsv()` which takes  `CsvDocumentsQuery` as a parameter instead of a `...string`
    -  Changed `UpdateDocumentsCsvInBatches()` which takes  `CsvDocumentsQuery` as a parameter instead of a `...string`

## 🚀 Enhancements

- Add FacetStats field in SearchResponse (#423) `@alallema`
- New method `client.MultiSearch()` provides the possibility to make multiple requests at once (#422) `@alallema`

Example:
```go
  client.MultiSearch(&MultiSearchRequest{
    Queries: []SearchRequest{
      {
        IndexUID: "movies",
        Query:    "pooh",
        Limit:    5,
      },
      {
        IndexUID: "movies",
        Query:    "nemo",
        Limit:    5,
      },
      {
        IndexUID: "movie_ratings",
        Query:    "us",
      },
    },
  })
```

Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
bors bot added a commit that referenced this pull request Apr 3, 2023
418: 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:
- #422 
- #423
- #424

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.

2 participants