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:
@@ -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 {
|
||||||
|
Submodule submodules/qmining-page updated: 7f4163736c...6a2c22f24a
Reference in New Issue
Block a user