ac00206e77
添加FAQ搜索支持两级优先级标签过滤功能,新增first_priority_tag_ids和second_priority_tag_ids字段,更新各检索器实现以支持按标签ID过滤,优化搜索结果排序确保优先级标签结果优先展示。
32 lines
808 B
Go
32 lines
808 B
Go
package qdrant
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/qdrant/go-client/qdrant"
|
|
)
|
|
|
|
type qdrantRepository struct {
|
|
client *qdrant.Client
|
|
collectionBaseName string
|
|
// Cache for initialized collections (dimension -> true)
|
|
initializedCollections sync.Map
|
|
}
|
|
|
|
type QdrantVectorEmbedding struct {
|
|
Content string `json:"content"`
|
|
SourceID string `json:"source_id"`
|
|
SourceType int `json:"source_type"`
|
|
ChunkID string `json:"chunk_id"`
|
|
KnowledgeID string `json:"knowledge_id"`
|
|
KnowledgeBaseID string `json:"knowledge_base_id"`
|
|
TagID string `json:"tag_id"`
|
|
Embedding []float32 `json:"embedding"`
|
|
IsEnabled bool `json:"is_enabled"`
|
|
}
|
|
|
|
type QdrantVectorEmbeddingWithScore struct {
|
|
QdrantVectorEmbedding
|
|
Score float64
|
|
}
|