fix(kb.gbapp): Simple search ignoring now ponctuation.
This commit is contained in:
parent
b120cf6674
commit
657dd0b849
1 changed files with 8 additions and 7 deletions
|
@ -225,13 +225,6 @@ export class KBService implements IGBKBService {
|
||||||
subjects: GuaribasSubject[]
|
subjects: GuaribasSubject[]
|
||||||
): Promise<KBServiceSearchResults> {
|
): 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.
|
// Builds search query.
|
||||||
|
|
||||||
|
@ -243,6 +236,14 @@ export class KBService implements IGBKBService {
|
||||||
query = query.replace('\\', ' ');
|
query = query.replace('\\', ' ');
|
||||||
query = query.replace('\r\n', ' ');
|
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) {
|
if (subjects !== null) {
|
||||||
const text = KBService.getSubjectItemsSeparatedBySpaces(subjects);
|
const text = KBService.getSubjectItemsSeparatedBySpaces(subjects);
|
||||||
if (text !== null) {
|
if (text !== null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue