create question missing cache fix

This commit is contained in:
mrfry 2021-03-17 17:24:38 +01:00
parent c167dcf5b2
commit b700bfba77
3 changed files with 7 additions and 4 deletions

View file

@ -1061,8 +1061,7 @@ function GetApp(): ModuleType {
if (!req.body.questions) {
res.json({
message:
'ask something! ?q=[question]&subj=[subject]&data=[question data]. "subj" is optimal for faster result',
message: `ask something! { question:'' ,subject:'', location:'' }`,
result: [],
recievedData: JSON.stringify(req.body),
success: false,
@ -1135,7 +1134,7 @@ function GetApp(): ModuleType {
}
})
function getDbIndexesToSearchIn(testUrl, trueIfAlways?) {
function getDbIndexesToSearchIn(testUrl: string, trueIfAlways?: boolean) {
return testUrl
? questionDbs.reduce((acc, qdb, i) => {
if (shouldSearchDataFile(qdb, testUrl, trueIfAlways)) {

View file

@ -217,6 +217,10 @@ function createQuestion(
Q: simplifyQuestion(question),
A: answer ? simplifyAnswer(answer) : undefined,
data: data,
cache: {
Q: question ? simplifyString(question).split(' ') : [],
A: answer ? simplifyString(answer).split(' ') : [],
},
}
} else {
return {

@ -1 +1 @@
Subproject commit 7f4163736cc0bfed3259f39f7bc0063ca191da21
Subproject commit 6a2c22f24a005ea677e895a51a9f583ffa00265d