修改包名

This commit is contained in:
xgc 2024-05-23 11:17:56 +08:00
parent 466bbebb95
commit 8ba41fa758
2 changed files with 0 additions and 54 deletions

View File

@ -1,44 +0,0 @@
package io.github.javpower.milvus.demo.model;
import io.github.javpower.milvus.plus.annotation.ExtraParam;
import io.github.javpower.milvus.plus.annotation.MilvusCollection;
import io.github.javpower.milvus.plus.annotation.MilvusField;
import io.github.javpower.milvus.plus.annotation.MilvusIndex;
import io.milvus.v2.common.DataType;
import io.milvus.v2.common.IndexParam;
import lombok.Data;
import java.util.List;
@Data
@MilvusCollection(name = "qa") // 指定Milvus集合的名称
public class Qa {
@MilvusField(
name = "qa_id", // 字段名称
dataType = DataType.Int64, // 数据类型为64位整数
isPrimaryKey = true, // 标记为主键
autoID = true // 假设这个ID是自动生成的
)
private Long qa;
@MilvusField(
name = "question", // 字段名称
dataType = DataType.FloatVector, // 数据类型为浮点型向量
dimension = 128 // 向量维度假设人脸特征向量的维度是128
)
@MilvusIndex(
indexType = IndexParam.IndexType.IVF_FLAT, // 使用IVF_FLAT索引类型
metricType = IndexParam.MetricType.L2, // 使用L2距离度量类型
indexName = "q_index", // 索引名称
extraParams = { // 指定额外的索引参数
@ExtraParam(key = "nprobe", value = "10") // 例如IVF的nlist参数
}
)
private List<Double> qVector;
@MilvusField(
name = "answer", // 字段名称
dataType = DataType.VarChar // 数据类型为64位整数
)
private String answer;
}

View File

@ -1,10 +0,0 @@
package io.github.javpower.milvus.demo.test;
import io.github.javpower.milvus.demo.model.Qa;
import io.github.javpower.milvus.plus.mapper.MilvusMapper;
import org.springframework.stereotype.Component;
@Component
public class QaMilvusMapper extends MilvusMapper<Qa> {
}