I’m currently doing the following for my index
I want to be able to embed and use it externally, so I’m using the
Configure.Vectorizer.none()
indexing
wv_client.collections.create(
name=class_name,
description="건강 식품 컬렉션",
replication_config=Configure.replication(
factor=1
),
vectorizer_config=Configure.Vectorizer.none(),
vector_index_config=Configure.VectorIndex.hnsw(
distance_metric=VectorDistances.COSINE
),
properties=[
Property(name="product_no", description="상품 번호", data_type=DataType.NUMBER),
Property(name="original_review", description="원본 리뷰", data_type=DataType.TEXT,
tokenization=Tokenization.WORD),
Property(name="original_title", description="원본 상품명", data_type=DataType.TEXT,
tokenization=Tokenization.WORD),
Property(name="original_detail", description="원본 OCR", data_type=DataType.TEXT,
tokenization=Tokenization.WORD),
Property(name="title", description="상품명", data_type=DataType.TEXT),
Property(name="review", description="리뷰", data_type=DataType.TEXT),
Property(name="detail", description="OCR", data_type=DataType.TEXT)
]
)
......
with coll.batch.dynamic() as batch:
for i, item in enumerate(dumps):
product_no = item['product_no']
product_name = item['prd_nm']
review_text = item['review_text']
ocr_text = item['ocr_text']
title_embedding, review_embedding, detail_embedding = embeddings[i * 3:i * 3 + 3]
title_embeddings.append(title_embedding)
review_embeddings.append(review_embedding)
detail_embeddings.append(detail_embedding)
uuid = generate_uuid5(product_no)
batch.add_object(
properties={
"product_no": product_no,
"original_title": product_name,
"original_review": review_text,
"original_detail": ocr_text
},
vector={
"title": title_embedding,
"review": review_embedding,
"detail": detail_embedding
},
uuid=uuid
)
The problem is that I get this error when searching, how do I fix it?
search
def search_weaviate(client, query_vector, class_name, feature, limit):
col = client.collections.get(class_name)
results = col.query.near_vector(near_vector=query_vector, limit=limit,
return_properties=["product_no", "original_review"],
include_vector="True",
return_metadata=MetadataQuery(distance=True,
creation_time=True),
target_vector="detail")
....
client.close()
Query call with protocol GRPC search failed with message extract target vectors: class Health_food does not have named vector detail configured. Available named vectors map[].