Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Get and delete documents by filter #236

Merged
merged 22 commits into from
Jun 5, 2023
Merged

Conversation

irevoire
Copy link
Member

@irevoire irevoire commented May 4, 2023

🤖 API Diff


Attention to reviewers

Associated issue: meilisearch/meilisearch#3477

We decided to merge both feature inside a single PR.
But some you can still see the initial review of the get/fetch documents by filter here: #234

Summary

Specify the new fetch and delete by filter route.

Changes

  • The GET /indexes/:uid/documents route has been updated with a new query parameter filter
  • A new POST /indexes/:uid/documents/fetch route has been created with all the parameters of the GET version above (limit, offset, fields, and filter)
  • A new error code has been introduced in case an error happens on the new filter fields: invalid_document_filter
  • Introduce a new POST /indexes/:index_uid/documents/delete route that lets you delete documents by filter
  • The payload must be an object only containing a filter field, i.e.: { "filter": "doggo = bernese" }
  • A new error has been introduced in case the specified filter is wrong or empty: invalid_document_delete_filter

Misc

  • Update OpenAPI specification file
  • Update telemetry datapoints

@irevoire irevoire requested a review from macraig May 4, 2023 14:11
@irevoire irevoire marked this pull request as draft May 4, 2023 14:12
@github-actions
Copy link

github-actions bot commented May 4, 2023

🚨 Breaking API change detected:

Added (1)

  • POST /indexes/{indexUid}/documents/fetch

Modified (2)

  • GET /indexes/{indexUid}/documents
    • Query parameter added: filter
  • [Breaking] POST /indexes/{indexUid}/documents/delete
    • [Breaking] Header added: Content-Type
    • [Breaking] Body added

Powered by Bump

@irevoire irevoire added Implemented Feature specification has been implemented. OpenAPI Update OpenAPI specification. labels May 4, 2023
@macraig macraig requested a review from gmourier May 8, 2023 19:11
@gmourier
Copy link
Member

@irevoire is that one ready for review? I see it in draft state

@irevoire
Copy link
Member Author

Hey, not really. I'm waiting for #234 to be merged before rebasing this one

@gmourier
Copy link
Member

gmourier commented May 10, 2023

We merge branches on the release day (https://github.com/meilisearch/specifications#release-worfklow) to avoid spanning multiple PRs for the same specification scope if changes need to occur until the release.

What I've done in the past for that type of case is I rebase the last one to the parent one or mix changes relating to the same product scope under the same PR to avoid multiple rebase over-time 🥲

@gmourier gmourier mentioned this pull request May 15, 2023
1 task
@gmourier
Copy link
Member

gmourier commented May 15, 2023

@irevoire can you rebase that one on #234? 🙇‍♂️

@gmourier gmourier added v1.2.0 Telemetry Update the telemetry collect. labels May 15, 2023
text/0124-documents-api.md Outdated Show resolved Hide resolved
text/0124-documents-api.md Outdated Show resolved Hide resolved
open-api.yaml Outdated Show resolved Hide resolved
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
text/0034-telemetry-policies.md Outdated Show resolved Hide resolved
text/0060-tasks-api.md Outdated Show resolved Hide resolved
text/0061-error-format-and-definitions.md Show resolved Hide resolved
text/0061-error-format-and-definitions.md Outdated Show resolved Hide resolved
text/0061-error-format-and-definitions.md Outdated Show resolved Hide resolved
text/0085-api-keys.md Outdated Show resolved Hide resolved
text/0124-documents-api.md Outdated Show resolved Hide resolved
Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>
Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>
meili-bors bot added a commit to meilisearch/meilisearch that referenced this pull request May 24, 2023
3775: Last error code changes on the new get/delete documents routes r=dureuill a=irevoire

# Pull Request

## Related issue
Fixes #3774

## What does this PR do?
Following the specification: meilisearch/specifications#236

1. Get rid of the `invalid_document_delete_filter` and always use the `invalid_document_filter`
2. Introduce a new `missing_document_filter` instead of returning `invalid_document_delete_filter` (that’s consistent with all the other routes that have a mandatory parameter)
3. Always return the `original_filter` in the details (potentially set to `null`) instead of hiding it if it wasn’t used


Co-authored-by: Tamo <tamo@meilisearch.com>
Copy link
Member

@gmourier gmourier left a comment

Choose a reason for hiding this comment

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

Thank you @irevoire 🚂

@gmourier gmourier removed the Ready For Review Feature specification must be reviewed. label May 29, 2023
open-api.yaml Outdated Show resolved Hide resolved
open-api.yaml Outdated Show resolved Hide resolved
meili-bors bot added a commit to meilisearch/meilisearch-rust that referenced this pull request May 31, 2023
472: Add delete_documents_with method for Meilisearch v1.2 r=bidoubiwa a=bidoubiwa

following this spec: meilisearch/specifications#236

- Add a method `index.delete_documents_with`  that lets you select a range of documents to delete based on the provided filters.


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: Charlotte Vermandel <charlottevermandel@gmail.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
meili-bors bot added a commit to meilisearch/meilisearch-rust that referenced this pull request May 31, 2023
472: Add delete_documents_with method for Meilisearch v1.2 r=bidoubiwa a=bidoubiwa

following this spec: meilisearch/specifications#236

- Add a method `index.delete_documents_with`  that lets you select a range of documents to delete based on the provided filters.


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: Charlotte Vermandel <charlottevermandel@gmail.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
@macraig macraig merged commit 8b23eb8 into release-v1.2.0 Jun 5, 2023
2 checks passed
@macraig macraig deleted the delete-documents branch June 5, 2023 15:44
macraig pushed a commit that referenced this pull request Jun 5, 2023
* Bump OpenAPI version

* CSV Content-Type — Add support for the boolean type in CSV (#228)

* add support for the boolean type in csv

* fix a typo

* Update text/0028-indexing-csv.md

---------

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Filter operators - `IS NULL` and `IS EMPTY` filter operators (#232)

* Introduce the spec of the IS EMPTY filter

* Introduce the spec of the IS NULL filter

* Fix suggestions

* Uppercase the IN operator

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Fix a title number issue

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

---------

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Search Algorithms Refactor: Relevancy Changes (#233)

* Remove old exactness-criterion specification

* Remove old asc-desc-criterion specification

* Get and delete documents by filter (#236)

* specify the new fetch documents route

* update open-api

* try to be nice with bumpsh

* specify the new analytics of the get/fetch documents route

* group the analytics behind already used groups

* fix a placeholder text

* group the get and fetch route under a common section

* rename the section to contain the name of both routes

* clarify how to send the parameter to both routes

* fix the type of the parameters

* add the new fetch route to the api keys actions

* capitalize json

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* update open-api

* Specify the new route to delete documents by filter

* add the new analytics event

* improve a comment

* add the post - delete route to the api key actions

* Fix the json payload

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Update the details

Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* delete the invalid_document_delete_filter error code and introduce the missing_document_filter

* fix the open-api thingy

---------

Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
Co-authored-by: Guillaume Mourier <guillaume@meilisearch.com>

* Auto deletion of tasks (#238)

* auto deletion of tasks

* Update text/0060-tasks-api.md

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>

* Update text/0060-tasks-api.md

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>

---------

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>

* Experimental reduce indexing memory usage (#239)

* Add the experimental-reduce-indexing-memory-usage option in the telemetry policies

* Add the experimental-reduce-indexing-memory-usage option in the instance options

* Update 0055-sort.md (#240)

related to meilisearch/meilisearch#3749

* Update `payload_too_large` error `message` (#241)

* Update 0061-error-format-and-definitions.md

Update error message in the specification

* Update open-api.yaml

---------

Co-authored-by: Tamo <tamo@meilisearch.com>
Co-authored-by: Clément Renault <renault.cle@gmail.com>
Co-authored-by: cvermand <33010418+bidoubiwa@users.noreply.github.com>
Co-authored-by: gui machiavelli <hey@guimachiavelli.com>
Co-authored-by: Many the fish <legendre.maxime.isn@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Implemented Feature specification has been implemented. OpenAPI Update OpenAPI specification. Q2:2023 Telemetry Update the telemetry collect. v1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants