fix(all): Fix search on others bots than boot.
This commit is contained in:
parent
32601d2460
commit
741b40c77b
2 changed files with 13 additions and 5 deletions
|
@ -720,13 +720,21 @@ export class GBDeployer implements IGBDeployer {
|
||||||
GBLogEx.info(instance.instanceId, `Acquiring rebuildIndex mutex...`);
|
GBLogEx.info(instance.instanceId, `Acquiring rebuildIndex mutex...`);
|
||||||
release = await GBServer.globals.indexSemaphore.acquire();
|
release = await GBServer.globals.indexSemaphore.acquire();
|
||||||
GBLogEx.info(instance.instanceId, `Acquire rebuildIndex done.`);
|
GBLogEx.info(instance.instanceId, `Acquire rebuildIndex done.`);
|
||||||
|
|
||||||
|
const key = instance.searchKey ? instance.searchKey : GBServer.globals.minBoot.instance.searchKey;
|
||||||
|
const searchIndex = instance.searchIndex ? instance.searchIndex : GBServer.globals.minBoot.instance.searchIndex;
|
||||||
|
const searchIndexer = instance.searchIndexer
|
||||||
|
? instance.searchIndexer
|
||||||
|
: GBServer.globals.minBoot.instance.searchIndexer;
|
||||||
|
const host = instance.searchHost ? instance.searchHost : GBServer.globals.minBoot.instance.searchHost;
|
||||||
|
|
||||||
// Prepares search.
|
// Prepares search.
|
||||||
|
|
||||||
const search = new AzureSearch(
|
const search = new AzureSearch(
|
||||||
instance.searchKey,
|
key,
|
||||||
instance.searchHost,
|
host,
|
||||||
instance.searchIndex,
|
searchIndex,
|
||||||
instance.searchIndexer
|
searchIndexer
|
||||||
);
|
);
|
||||||
const connectionString = GBDeployer.getConnectionStringFromInstance(instance);
|
const connectionString = GBDeployer.getConnectionStringFromInstance(instance);
|
||||||
const dsName = 'gb';
|
const dsName = 'gb';
|
||||||
|
|
|
@ -312,7 +312,7 @@ export class KBService implements IGBKBService {
|
||||||
key: key
|
key: key
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
const results = await client.search(query, {
|
const results = await client.search(query.substring(0,499), {
|
||||||
filter: `instanceId eq ${instance.instanceId} and skipIndex eq false`,
|
filter: `instanceId eq ${instance.instanceId} and skipIndex eq false`,
|
||||||
searchFields: ['content', 'subject1', 'subject2', 'subject3', 'subject4'],
|
searchFields: ['content', 'subject1', 'subject2', 'subject3', 'subject4'],
|
||||||
select: ['instanceId', 'questionId', 'answerId'],
|
select: ['instanceId', 'questionId', 'answerId'],
|
||||||
|
|
Loading…
Add table
Reference in a new issue