Skip to content

feat: delete vectors with metadata filter and id prefix #17

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

Merged
merged 5 commits into from
Mar 4, 2025

Conversation

heyjorgedev
Copy link
Contributor

@heyjorgedev heyjorgedev commented Feb 27, 2025

This PR introduces the ability to delete vectors from our index by using ids, id prefix and metadata filters.

Delete Vectors by Id or ids:

// delete multiple records
$index->delete(['users:1', 'users:2']);

// delete single record
$index->delete('users:1');

Delete Vectors by prefix

use Upstash\Vector\VectorDeleteByPrefix;

$index->delete(new VectorDeleteByPrefix('users:'));

Delete Vectors by metadata filter

use Upstash\Vector\VectorDeleteByMetadataFilter;

$index->delete(new VectorDeleteByMetadataFilter('salary > 1000'));

Copy link

linear bot commented Feb 27, 2025

@heyjorgedev heyjorgedev marked this pull request as ready for review February 27, 2025 11:57
@heyjorgedev heyjorgedev marked this pull request as draft February 28, 2025 11:24
@heyjorgedev heyjorgedev marked this pull request as ready for review March 4, 2025 11:04
@CahidArda CahidArda merged commit bc5b7f8 into master Mar 4, 2025
10 checks passed
@heyjorgedev heyjorgedev deleted the dx-1666-delete-with-metadata-and-prefix branch March 4, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants