Skip to content

Commit

Permalink
fix(all): SEARCH error in MS AZURE (again).
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Oct 12, 2021
1 parent 88a908a commit fb53be5
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/kb.gbapp/services/KBService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,17 @@ export class KBService implements IGBKBService {

if (instance.searchKey !== null && GBConfigService.get('STORAGE_DIALECT') === 'mssql') {
const client = new SearchService(instance.searchHost.split('.')[0], instance.searchKey);
const results = await client.indexes
.use(instance.searchIndex)
.buildQuery()
.filter(f => f.eq('instanceId', instance.instanceId))
.filter(f => f.eq('skipIndex', false))
.search(query)
.top(1)
.executeQuery();

const results = await client.indexes.use('azuresql-index').search({
count: true,
filter: `instanceId eq ${instance.instanceId} and skipIndex eq false`,
search: query,
searchFields: 'content, subject1, subject2, subject3, subject4',
select: 'instanceId, questionId, answerId',
skip: 0,
top: 1,
});


const values = results.result.value;

Expand Down

0 comments on commit fb53be5

Please sign in to comment.