-
Notifications
You must be signed in to change notification settings - Fork 64
Adds replace_all_rules and replace_all_synonyms #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds replace_all_rules and replace_all_synonyms #390
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR 👍
I commented on Synonyms, but the same apply to rules
algoliasearch/index.py
Outdated
@param synonyms the synonyms to upload as a list of python dictionary. | ||
the dictionary must contain an objectID key. | ||
""" | ||
for synonym in synonyms: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we really add this verification in v1's 🤔
This makes replacesAllSynonyms and batchSynonyms
behave differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@julienbourdeau I believe new methods should follow the specs. The specs defines that synonyms must contain a valid ObjectID
. I think it's fine.
'replaceExistingSynonyms': True | ||
} | ||
|
||
return self._req(False, '/synonyms/batch', 'POST', request_options, params, data=synonyms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you not use batch_synonyms
on purpose because of the requestOptions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@julienbourdeau Because all the extra works of setting the params of the batch_synonyms
. Is just more simple call one line.
81d04e0
to
4d471da
Compare
* chore(ci): use different branch to test release * chore: process release on main_test branch * chore: revert release.config.json
Describe your change
Adds methods
replace_all_rules
andreplace_all_synonims
.