I am inserting elements with three columns:
- kicker (this is unique)
- slug (this is unique)
- vector (the computed embedding vector of the kicker)
as follows (where data is a list of json elements):
batch_size = int(os.getenv("BATCH_SIZE"))
client.batch.configure(batch_size=batch_size) # Configure batch
# Batch import all objects
with client.batch as batch:
for item in data:
properties = {
textcolname: item[textcolname],
"slug": item["slug"],
}
client.batch.add_data_object(
class_name=schema_name,
data_object=properties,
vector=item[vectcolname] # my vector embeddings go here
)
is there a way to avoid inserting an item if the kicker (which is unique) is already inserted? (in this case also the vector and the slug would be there already)