Open JPLachance opened 3 months ago
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.
The SDK should expose this method.
Python Version -> Latest OS Version -> Latest macOS ...
No response
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()}")
Damn, Thats so good explanation about the issue. Love it, trying to reproduce
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
Environment
Debug logs
No response
Anything else?
Here is a bad piece of code I ended up using: