|
|
|
@ -52,7 +52,7 @@ def main():
|
|
|
|
|
print("1. 文本分词和向量化处理中...")
|
|
|
|
|
query_embedding = es_search_util.text_to_embedding(query)
|
|
|
|
|
print(f"2. 生成的查询向量维度: {len(query_embedding)}")
|
|
|
|
|
print(f"3. 前5维向量值: {query_embedding[:5]}")
|
|
|
|
|
print(f"3. 前3维向量值: {query_embedding[:3]}")
|
|
|
|
|
|
|
|
|
|
print("4. 正在执行Elasticsearch向量搜索...")
|
|
|
|
|
vector_results = es_conn.search(
|
|
|
|
@ -105,7 +105,7 @@ def main():
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"size": 5
|
|
|
|
|
"size": 3
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
print(f"2. 文本搜索结果数量: {len(text_results['hits']['hits'])}")
|
|
|
|
|