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

Make it possible to reset some specific settings via the updateSettings route

Open bidoubiwa opened this issue 3 years ago • 0 comments

Description For example, it is possible to reset the synonyms to it' default value by sending

{
   "synonyms": null
}

As the json body of the updateSettings method.

Unfortunately, looking at this code:

https://github.com/meilisearch/meilisearch-java/blob/04244faad4b653fe4cdc5eff871463ce6e8b83bc/src/main/java/com/meilisearch/sdk/Settings.java#L33-L60

It appears that if the user sets synonyms to null it will not be added to the final body send to updateSettings, and thus, it will not reset the synonyms.

As per the documentation

Passing null to an index setting will reset it to its default value.

It may not be possible to do it as we cannot know the difference between a field not present or a field set specifically to null. Nonetheless if it is possible, it should be investigated.

bidoubiwa avatar May 24 '22 16:05 bidoubiwa