fix(all): Fix search on others bots than boot.

This commit is contained in:
Rodrigo Rodriguez 2023-09-10 22:42:32 -03:00
parent f86f711774
commit 6a7c49f827
2 changed files with 4 additions and 2 deletions

View file

@ -178,9 +178,10 @@ export class GBAdminService implements IGBAdminService {
}
public static async rebuildIndexPackageCommand(min: GBMinInstance, deployer: GBDeployer) {
const service = await AzureDeployerService.createInstance(deployer);
const searchIndex = min.instance.searchIndex ? min.instance.searchIndex : GBServer.globals.minBoot.instance.searchIndex;
await deployer.rebuildIndex(
min.instance,
service.getKBSearchSchema(min.instance.searchIndex)
service.getKBSearchSchema(searchIndex)
);
}

View file

@ -1031,7 +1031,8 @@ export class KBService implements IGBKBService {
await this.importKbPackage(min, localPath, p, instance);
GBDeployer.mountGBKBAssets(packageName, min.botId, localPath);
const service = await AzureDeployerService.createInstance(deployer);
await deployer.rebuildIndex(instance, service.getKBSearchSchema(instance.searchIndex));
const searchIndex = instance.searchIndex ? instance.searchIndex : GBServer.globals.minBoot.instance.searchIndex;
await deployer.rebuildIndex(instance, service.getKBSearchSchema(searchIndex));
min['groupCache'] = await KBService.getGroupReplies(instance.instanceId);
await KBService.RefreshNER(min);