-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Current Behavior
Coveo has a feature to delete documents that are older than a given date. When doing a full refresh, that endpoint can be called to delete documents that don't exist anymore.
The endpoint documentation: https://docs.coveo.com/en/131/index-content/deleting-old-items-in-a-push-source
The current SDK implementation does not expose this method.
Expected Behavior
The SDK should expose this method.
Steps To Reproduce
- Install the SDK
- Look for methods available on a Source
- The method is not there
Environment
Python Version -> Latest
OS Version -> Latest macOS
...Debug logs
No response
Anything else?
Here is a bad piece of code I ended up using:
url = (
f"https://api.cloud.coveo.com/push/v1/organizations/{self.organization_id}/sources/{self.source_id}/"
f"documents/olderthan"
)
response = self.source.client.session.delete(
url,
params={"orderingId": self.clear_items_older_than},
headers={"Authorization": f"Bearer {self.coveo_api_key}"},
)
if response.status_code == 202:
logger.info("Old documents deleted successfully.")
else:
logger.error(f"Failed to delete old documents: {response.json()}")Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed