Data Management¶
Since Build5Nines.SharpVector
is a database, it also has data management methods available. These methods enable you to add, remove, and update the text documents that are vectorized and indexed within the semantic database.
Get Text Item ID¶
Every text item within a Build5Nines.SharpVector
database is assigned a unique identifier (ID). There are a few ways to get access to the ID of the text items.
When adding an individual text item to the vector database, the ID value will be returned:
C# | |
---|---|
1 2 3 |
|
When you perform a semantic search, the search results will contain the list of texts; each have an ID property.
C# | |
---|---|
1 2 3 4 5 6 7 8 |
|
The IVectorDatabase
classes implement IEnumerable
so you can easily loop through all the text items that have been added to the database.
C# | |
---|---|
1 2 3 4 5 6 7 8 |
|
Get¶
If you know the id
of a Text item in the database, you can retrieve it directly.
Get By Id¶
The .GetText
method can be used to retrieve a text item from the vector database directly.
C# | |
---|---|
1 |
|
Update¶
Once text items have been added to the database "Update" methods can be used to modify them.
Update Text¶
The .UpdateText
method can be used to update the Text
value, and associated vectors will be updated.
C# | |
---|---|
1 |
|
When the Text
is updated, new vector embeddings are generated for the new text.
Update Metadata¶
The .UpdateTextMetadata
method can be used to update the Metadata
for a given text item by Id
.
C# | |
---|---|
1 |
|
When Metadata
is updated, the vector embeddings are not updated.
Update Text and Metadata¶
The .UpdateTextAndMetadata
method can be used to update the Text
and Metadata
for a text item in the database for the given text item Id
.
C# | |
---|---|
1 |
|
Delete¶
The vector database supports the ability to delete text items.
Delete Text¶
The .DeleteText
method can be used to delete a text item form the database for the given `Id'.
C# | |
---|---|
1 |
|