refactor(ipc): 移除搜索结果中的vector字段以提高性能
删除hybridSearch返回结果中的vector字段,减少数据传输量
This commit is contained in:
1 parent
5f5ffa948c
commit
a9eb08985f
1 file changed
+9
-2
@@ -65,8 +65,15 @@ export function registerHandlers(services: {
|
||||
|
||||
const results = await unifiedStore.hybridSearch(queryVector, query)
|
||||
|
||||
console.log('🔎 [SEARCH] RESULTS:', results)
|
||||
return results
|
||||
const noVectorResults = results.map((item) => {
|
||||
const newItem = {
|
||||
...item
|
||||
}
|
||||
delete newItem.vector
|
||||
return newItem
|
||||
})
|
||||
console.log('🔎 [SEARCH] RESULTS:', noVectorResults)
|
||||
return noVectorResults
|
||||
} catch (error: any) {
|
||||
console.error('❌ [SEARCH] ERROR:', error)
|
||||
return []
|
||||
|
||||
Reference in new issue
Block a user