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