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

Get documents by filter #439

Merged
merged 5 commits into from May 22, 2023

Conversation

brunoocasali
Copy link
Member

@brunoocasali brunoocasali commented May 20, 2023

A similar concept from #438 was applied here.

Add the ability to receive a filter key from the get_documents/documents methods. When a filter is sent, the requested route is the new route POST /indexes/#{@uid}/documents/fetch, only available from Meilisearch v1.2 and newer.

The filter field works precisely like the filter field used on the search method. See the docs on how to use filters.

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 🔥 Tests are failing though

@brunoocasali
Copy link
Member Author

Tests are failing though

branch in branch thing!

Base automatically changed from delete-documents-by-filter to bump-meilisearch-v1.2.0 May 22, 2023 19:43
@brunoocasali brunoocasali merged commit d11ce6a into bump-meilisearch-v1.2.0 May 22, 2023
5 checks passed
@brunoocasali brunoocasali deleted the get-documents-by-filter branch May 22, 2023 19:46
meili-bors bot added a commit that referenced this pull request Jun 5, 2023
440: Update version for the next release (v0.24.0) r=brunoocasali a=meili-bot

Release CHANGELOG:

This version introduces features released on Meilisearch v1.2.0 🎉
Check out the changelog of [Meilisearch v1.2.0](https://github.com/meilisearch/meilisearch/releases/tag/v1.2.0) for more information on the changes. 
⚠️ If you want to adopt new features of this release, **update the Meilisearch server** to the according version.

### 🚀 Enhancements

- The method `delete_documents()` now supports a different behavior. This method could take an `options` hash containing a `filter:` key/value object to filter the documents or a simple array or single value as usual.
⚠️ Still, even being supported, the ability to receive other types than a hash is deprecated and should be changed to a filter. Please use `filter` instead.
#438 `@brunoocasali` 

- When a query with a `filter` key is sent to `get_documents(options = {})` it will filter the documents like the `search` method. This feature requires a Meilisearch server version greater than v1.2. See [the docs on how to use filters](https://www.meilisearch.com/docs/learn/advanced/filtering#filter-basics). #439 `@brunoocasali` 

Thanks again to `@brunoocasali!` 🎉

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.

None yet

2 participants