algoliasearch-client-go
algoliasearch-client-go copied to clipboard
CreateIfNotExist should not be the default
- Algolia Client Version: v3.31.0
- Language Version: 1.21
Description
Right now index.PartialUpdateObjects()
creates an object if it does not exist. That object is very likely to be invalid from the point of view of clients, since it does not have all fields. I believe that a more sensible default when no option is supplied should be opt.CreateIfNotExists(false)
.
Note that this behavior is inconsistent with other SDKs such as the PHP sdk: https://github.com/algolia/algoliasearch-client-php/blob/0bc527d95150319d6e8fca6dae398e4ad376d4b6/src/SearchIndex.php#L207
Steps To Reproduce
Call index.PartialUpdateObjects()
with an object that does not already exist in the index.