@@ -127,7 +127,7 @@ export class DocManager {
127127 if ( ( error as Error ) . message === `Index \`${ uid } \` not found.` ) {
128128 console . info ( `Index ${ uid } not found, creating it...` ) ;
129129 const task = await this . #client. createIndex ( uid , { primaryKey } ) ;
130- await this . #client. waitForTask ( task . taskUid ) ;
130+ await this . #client. tasks . waitForTask ( task . taskUid ) ;
131131 console . info ( `Index ${ uid } created successfully` ) ;
132132 } else {
133133 console . error ( `Error retrieving or creating index ${ uid } :` , error ) ;
@@ -192,7 +192,7 @@ export class DocManager {
192192
193193 // 获取已有的可筛选属性
194194 const docIndexFilterableAttributes =
195- await this . #docIndex. getFilterableAttributes ( ) ;
195+ ( await this . #docIndex. getFilterableAttributes ( ) ) ?? [ ] ;
196196
197197 // 需要设置的可筛选的属性
198198 const docIndexFilterableAttributesNeedCreate = difference (
@@ -211,7 +211,7 @@ export class DocManager {
211211 ...docIndexFilterableAttributesNeedCreate ,
212212 ] ,
213213 } ) ;
214- await this . #docIndex. waitForTask ( task . taskUid ) ;
214+ await this . #docIndex. tasks . waitForTask ( task . taskUid ) ;
215215 }
216216 } ) ( ) ,
217217 // 确保 docChunkIndex 存在
@@ -234,7 +234,7 @@ export class DocManager {
234234 resetEmbedders = async ( wait = false ) => {
235235 const task = await this . #docChunkIndex. resetEmbedders ( ) ;
236236 if ( wait ) {
237- const task1 = await this . #docChunkIndex. waitForTask ( task . taskUid ) ;
237+ const task1 = await this . #docChunkIndex. tasks . waitForTask ( task . taskUid ) ;
238238 return task1 . status ;
239239 } else {
240240 return task . status ;
@@ -245,7 +245,7 @@ export class DocManager {
245245 updateEmbedders = async ( embedders : Embedders , wait = false ) => {
246246 const task = await this . #docChunkIndex. updateEmbedders ( embedders ) ;
247247 if ( wait ) {
248- const task1 = await this . #docChunkIndex. waitForTask ( task . taskUid ) ;
248+ const task1 = await this . #docChunkIndex. tasks . waitForTask ( task . taskUid ) ;
249249 return task1 . status ;
250250 } else {
251251 return task . status ;
@@ -568,11 +568,11 @@ export class DocManager {
568568 await Promise . all ( [
569569 ( async ( ) => {
570570 const task = await this . #docIndex. delete ( ) ;
571- await this . #client. waitForTask ( task . taskUid ) ;
571+ await this . #client. tasks . waitForTask ( task . taskUid ) ;
572572 } ) ( ) ,
573573 ( async ( ) => {
574574 const task = await this . #docChunkIndex. delete ( ) ;
575- await this . #client. waitForTask ( task . taskUid ) ;
575+ await this . #client. tasks . waitForTask ( task . taskUid ) ;
576576 } ) ( ) ,
577577 ] ) ;
578578 } ;
0 commit comments