fix(all): SEARCH error in MS AZURE (again).
This commit is contained in:
parent
88a908a124
commit
fb53be5b64
1 changed files with 11 additions and 8 deletions
|
@ -276,14 +276,17 @@ export class KBService implements IGBKBService {
|
||||||
|
|
||||||
if (instance.searchKey !== null && GBConfigService.get('STORAGE_DIALECT') === 'mssql') {
|
if (instance.searchKey !== null && GBConfigService.get('STORAGE_DIALECT') === 'mssql') {
|
||||||
const client = new SearchService(instance.searchHost.split('.')[0], instance.searchKey);
|
const client = new SearchService(instance.searchHost.split('.')[0], instance.searchKey);
|
||||||
const results = await client.indexes
|
|
||||||
.use(instance.searchIndex)
|
const results = await client.indexes.use('azuresql-index').search({
|
||||||
.buildQuery()
|
count: true,
|
||||||
.filter(f => f.eq('instanceId', instance.instanceId))
|
filter: `instanceId eq ${instance.instanceId} and skipIndex eq false`,
|
||||||
.filter(f => f.eq('skipIndex', false))
|
search: query,
|
||||||
.search(query)
|
searchFields: 'content, subject1, subject2, subject3, subject4',
|
||||||
.top(1)
|
select: 'instanceId, questionId, answerId',
|
||||||
.executeQuery();
|
skip: 0,
|
||||||
|
top: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
const values = results.result.value;
|
const values = results.result.value;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue