Skip to content

Incorrect Method Call in .code-samples.meilisearch #867

@zebra-f

Description

@zebra-f

The code sample that describes the use of the delete_documents method (meilisearch/index.py):

...
    @version_error_hint_message
    def delete_documents(
        self,
        ids: Optional[List[Union[str, int]]] = None,
        *,
        filter: Optional[  # pylint: disable=redefined-builtin
            Union[str, List[Union[str, List[str]]]]
        ] = None,
    ) -> TaskInfo:
...

'contains an error' in the delete_documents method call.
The code should use the filter argument directly as shown below:

client.index('movies').delete_documents(filter='genres=action OR genres=adventure')

instead of a dictionary:

client.index('movies').delete_documents({filter='genres=action OR genres=adventure'})

Expected Behavior:

The code sample should delete documents from the 'movies' index based on the provided filter.

Actual Behavior:

The code sample contains syntax errors and does not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions