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...`);
|
||||
release = await GBServer.globals.indexSemaphore.acquire();
|
||||
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.
|
||||
|
||||
const search = new AzureSearch(
|
||||
instance.searchKey,
|
||||
instance.searchHost,
|
||||
instance.searchIndex,
|
||||
instance.searchIndexer
|
||||
key,
|
||||
host,
|
||||
searchIndex,
|
||||
searchIndexer
|
||||
);
|
||||
const connectionString = GBDeployer.getConnectionStringFromInstance(instance);
|
||||
const dsName = 'gb';
|
||||
|
|
|
@ -312,7 +312,7 @@ export class KBService implements IGBKBService {
|
|||
key: key
|
||||
} 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`,
|
||||
searchFields: ['content', 'subject1', 'subject2', 'subject3', 'subject4'],
|
||||
select: ['instanceId', 'questionId', 'answerId'],
|
||||
|
|
Loading…
Add table
Reference in a new issue