Skip to content

Commit

Permalink
fix(kb.gbapp): Simple search ignoring now ponctuation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Apr 20, 2021
1 parent b120cf6 commit 657dd0b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/kb.gbapp/services/KBService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,6 @@ export class KBService implements IGBKBService {
subjects: GuaribasSubject[]
): Promise<KBServiceSearchResults> {

// Try simple search first.

const data = await this.getAnswerByText(instance.instanceId, query);
if (data) {
GBLog.info(`Simple SEARCH called.`);
return { answer: data.answer, questionId: data.question.questionId };
}

// Builds search query.

Expand All @@ -243,6 +236,14 @@ export class KBService implements IGBKBService {
query = query.replace('\\', ' ');
query = query.replace('\r\n', ' ');

// Try simple search first.

const data = await this.getAnswerByText(instance.instanceId, query.trim());
if (data) {
GBLog.info(`Simple SEARCH called.`);
return { answer: data.answer, questionId: data.question.questionId };
}

if (subjects !== null) {
const text = KBService.getSubjectItemsSeparatedBySpaces(subjects);
if (text !== null) {
Expand Down

0 comments on commit 657dd0b

Please sign in to comment.