File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
docSite/content/zh-cn/docs/development/upgrading
packages/service/common/vectorStore/pg Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ weight: 793
1212
1313## ⚙️ 优化
1414
15- 1 . Doc2x 文档解析,增加报错信息捕获,增加超时时长
15+ 1 . Doc2x 文档解析,增加报错信息捕获,增加超时时长。
16+ 2 . 调整 PG vector 查询语句,强制使用向量索引。
1617
1718## 🐛 修复
1819
Original file line number Diff line number Diff line change @@ -192,8 +192,7 @@ export class PgVectorCtrl {
192192 WITH relaxed_results AS MATERIALIZED (
193193 select id, collection_id, vector <#> '[${ vector } ]' AS score
194194 from ${ DatasetVectorTableName }
195- where team_id='${ teamId } '
196- AND dataset_id IN (${ datasetIds . map ( ( id ) => `'${ String ( id ) } '` ) . join ( ',' ) } )
195+ where dataset_id IN (${ datasetIds . map ( ( id ) => `'${ String ( id ) } '` ) . join ( ',' ) } )
197196 ${ filterCollectionIdSql }
198197 ${ forbidCollectionSql }
199198 order by score limit ${ limit }
@@ -202,6 +201,12 @@ export class PgVectorCtrl {
202201 ) ;
203202 const rows = results ?. [ 3 ] ?. rows as PgSearchRawType [ ] ;
204203
204+ if ( ! Array . isArray ( rows ) ) {
205+ return {
206+ results : [ ]
207+ } ;
208+ }
209+
205210 return {
206211 results : rows . map ( ( item ) => ( {
207212 id : String ( item . id ) ,
You can’t perform that action at this time.
0 commit comments