fix(all): Fix search on others bots than boot.
This commit is contained in:
parent
77920f640d
commit
73a9ffefdb
2 changed files with 9 additions and 3 deletions
|
@ -105,7 +105,10 @@ export class GBDeployer implements IGBDeployer {
|
||||||
*/
|
*/
|
||||||
public static async internalGetDriveClient(min: GBMinInstance) {
|
public static async internalGetDriveClient(min: GBMinInstance) {
|
||||||
let token;
|
let token;
|
||||||
if (min['cacheToken']) {
|
|
||||||
|
// TODO: Add expiration logic.
|
||||||
|
|
||||||
|
if (min['cacheToken'] && null) {
|
||||||
return min['cacheToken'];
|
return min['cacheToken'];
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
|
@ -289,9 +289,12 @@ export class KBService implements IGBKBService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let key = instance.searchKey ? instance.searchKey:
|
||||||
|
GBServer.globals.minBoot.instance.searchKey;
|
||||||
|
|
||||||
// No direct match found, so Search is used.
|
// No direct match found, so Search is used.
|
||||||
|
|
||||||
if (instance.searchKey !== null && GBConfigService.get('STORAGE_DIALECT') === 'mssql') {
|
if (key !== null && GBConfigService.get('STORAGE_DIALECT') === 'mssql') {
|
||||||
interface SearchResults {
|
interface SearchResults {
|
||||||
instanceId: number;
|
instanceId: number;
|
||||||
questionId: number;
|
questionId: number;
|
||||||
|
@ -304,7 +307,7 @@ export class KBService implements IGBKBService {
|
||||||
}
|
}
|
||||||
|
|
||||||
const client = new SearchClient<any>('https://' + instance.searchHost, 'azuresql-index', {
|
const client = new SearchClient<any>('https://' + instance.searchHost, 'azuresql-index', {
|
||||||
key: instance.searchKey
|
key: key
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
const results = await client.search(query, {
|
const results = await client.search(query, {
|
||||||
|
|
Loading…
Add table
Reference in a new issue