mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
create question missing cache fix
This commit is contained in:
parent
c167dcf5b2
commit
b700bfba77
3 changed files with 7 additions and 4 deletions
|
@ -1061,8 +1061,7 @@ function GetApp(): ModuleType {
|
||||||
|
|
||||||
if (!req.body.questions) {
|
if (!req.body.questions) {
|
||||||
res.json({
|
res.json({
|
||||||
message:
|
message: `ask something! { question:'' ,subject:'', location:'' }`,
|
||||||
'ask something! ?q=[question]&subj=[subject]&data=[question data]. "subj" is optimal for faster result',
|
|
||||||
result: [],
|
result: [],
|
||||||
recievedData: JSON.stringify(req.body),
|
recievedData: JSON.stringify(req.body),
|
||||||
success: false,
|
success: false,
|
||||||
|
@ -1135,7 +1134,7 @@ function GetApp(): ModuleType {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function getDbIndexesToSearchIn(testUrl, trueIfAlways?) {
|
function getDbIndexesToSearchIn(testUrl: string, trueIfAlways?: boolean) {
|
||||||
return testUrl
|
return testUrl
|
||||||
? questionDbs.reduce((acc, qdb, i) => {
|
? questionDbs.reduce((acc, qdb, i) => {
|
||||||
if (shouldSearchDataFile(qdb, testUrl, trueIfAlways)) {
|
if (shouldSearchDataFile(qdb, testUrl, trueIfAlways)) {
|
||||||
|
|
|
@ -217,6 +217,10 @@ function createQuestion(
|
||||||
Q: simplifyQuestion(question),
|
Q: simplifyQuestion(question),
|
||||||
A: answer ? simplifyAnswer(answer) : undefined,
|
A: answer ? simplifyAnswer(answer) : undefined,
|
||||||
data: data,
|
data: data,
|
||||||
|
cache: {
|
||||||
|
Q: question ? simplifyString(question).split(' ') : [],
|
||||||
|
A: answer ? simplifyString(answer).split(' ') : [],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 7f4163736cc0bfed3259f39f7bc0063ca191da21
|
Subproject commit 6a2c22f24a005ea677e895a51a9f583ffa00265d
|
Loading…
Add table
Add a link
Reference in a new issue