Skip to content

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'));

@linear
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.

3 participants