fix(kb.gbapp): Quotes to prevent question indexing.
This commit is contained in:
parent
f2e0d76343
commit
e9a9a478db
4 changed files with 24 additions and 3 deletions
|
@ -90,3 +90,10 @@ GO
|
|||
ALTER TABLE dbo.GuaribasUser ADD
|
||||
agentSystemId nvarchar(255) NULL,
|
||||
GO
|
||||
|
||||
# 2.0.115
|
||||
|
||||
ALTER TABLE dbo.GuaribasQuestion ADD
|
||||
skipIndex bit NULL
|
||||
GO
|
||||
|
||||
|
|
|
@ -202,6 +202,16 @@ export class AzureDeployerService implements IGBInstallationDeployer {
|
|||
facetable: false,
|
||||
key: false
|
||||
},
|
||||
{
|
||||
name: 'skipIndex',
|
||||
type: 'Edm.Boolean',
|
||||
searchable: false,
|
||||
filterable: true,
|
||||
retrievable: true,
|
||||
sortable: false,
|
||||
facetable: false,
|
||||
key: false
|
||||
},
|
||||
{
|
||||
name: 'packageId',
|
||||
type: 'Edm.Int32',
|
||||
|
|
|
@ -144,6 +144,9 @@ export class GuaribasQuestion extends Model<GuaribasQuestion> {
|
|||
@Column
|
||||
public keywords: string;
|
||||
|
||||
@Column
|
||||
public skipIndex: boolean;
|
||||
|
||||
@Column(DataType.STRING(512))
|
||||
public from: string;
|
||||
|
||||
|
|
|
@ -258,6 +258,7 @@ export class KBService implements IGBKBService {
|
|||
.use(instance.searchIndex)
|
||||
.buildQuery()
|
||||
.filter(f => f.eq('instanceId', instance.instanceId))
|
||||
.filter(f => f.eq('skipIndex', false))
|
||||
.search(query)
|
||||
.top(1)
|
||||
.executeQuery();
|
||||
|
@ -276,7 +277,7 @@ export class KBService implements IGBKBService {
|
|||
GBLog.info(
|
||||
`SEARCH WILL BE USED with score: ${returnedScore} > required (searchScore): ${searchScore}`
|
||||
);
|
||||
|
||||
|
||||
|
||||
return { answer: value, questionId: values[0].questionId };
|
||||
} else {
|
||||
|
@ -467,9 +468,9 @@ export class KBService implements IGBKBService {
|
|||
subject2: subject2,
|
||||
subject3: subject3,
|
||||
subject4: subject4,
|
||||
content: question,
|
||||
content: question.replace(/['"]+/g, ''),
|
||||
instanceId: instanceId,
|
||||
|
||||
skipIndex: (question.charAt(0) === "\""),
|
||||
packageId: packageId
|
||||
};
|
||||
questions.push(question1);
|
||||
|
|
Loading…
Add table
Reference in a new issue