Quantcast
Channel: Weaviate Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 3588

Metadata properties

$
0
0

Description

What is behavior of creation time and last_update time in metadata.
Why creation_time is always updating.


import weaviate.classes.config as wcc
import weaviate.classes as wvc

client.collections.create(
    name="Test_time",
    vectorizer_config=wcc.Configure.Vectorizer.text2vec_transformers(),
    inverted_index_config=wcc.Configure.inverted_index(
        index_timestamps = True
    ),
    properties=[
        wcc.Property(
            name="question",
            data_type=wcc.DataType.TEXT,
            tokenization=wcc.Tokenization.WORD,
        ),
        wcc.Property(
            name="answer",
            data_type=wcc.DataType.TEXT,
            tokenization=wcc.Tokenization.FIELD,
        )
    ],
)
dddd = [
    
    {"question": "What is 2 + 2?", "answer": "41"},
    {"question": "What is the largest ocean?", "answer": "Pacific Ocea1n"},
   ]
from weaviate.util import generate_uuid5
import numpy as np
count=0
with client.batch.dynamic() as batch:
    for idd in dddd:
        count+=1
        batch.add_object(
            properties=idd,
            vector=np.random.rand(1536),
            collection="Test_time",
            uuid=generate_uuid5(f"test_time-id-{count}")
        )
if client.batch.failed_objects:
    print("Failed Objects: ", client.batch.failed_objects)

If I again use add_object with update data like
dddd = [

{"question": "What is 2 + 2?", "answer": "4"},
{"question": "What is the largest ocean?", "answer": "Pacific Ocean"},

]
Why creation time gets updated ?

Server Setup Information

  • Weaviate Server Version:
  • Deployment Method:
  • Multi Node? Number of Running Nodes:
  • Client Language and Version:
  • Multitenancy?:

Any additional Information


Viewing all articles
Browse latest Browse all 3588

Trending Articles