meilisearch-rust icon indicating copy to clipboard operation
meilisearch-rust copied to clipboard

primary key in the update index method should be optionnal

Open bidoubiwa opened this issue 3 years ago • 0 comments

Description

Currently the method to update an index requires a primary key as per the method definition:

pub async fn update(&self, primary_key: impl AsRef<str>) -> Result<(), Error>

As an example:

client.index("movies").update("movie_review_id"));

Expected behavior In Meilisearch the update route accepts no primary Key field being defined, or one set to null. See spec.

Current behavior The primaryKey is required. It should not and could introduce a big breaking change if a new parameter becomes updatable on the update index route. In which case the user is going to have to define a primary key even if they only want to update the other parameter(s).

Environment (please complete the following information):

  • Meilisearch version: v0.27.1

bidoubiwa avatar Jun 06 '22 10:06 bidoubiwa