diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 1eba9017c..805b12230 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1145,7 +1145,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE folder = 'Docs-Topics' break } - case 'DocsBooksSchema': { + case 'DocsBookSchema': { folder = 'Docs-Books' break } @@ -1162,6 +1162,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE let schema = JSON.stringify(schemaArray) respondWithContent(schema, httpResponse) } catch (err) { + console.log('Could not send Schema:' ,filePath, schemaType) console.log(err.stack) respondWithContent("[]", httpResponse) } diff --git a/Projects/Superalgos/Schemas/Docs-Books/how-to-trade-.json b/Projects/Superalgos/Schemas/Docs-Books/how-to-trade-.json new file mode 100644 index 000000000..bb6498e3f --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Books/how-to-trade-.json @@ -0,0 +1,12 @@ +{ + "type": "How To Trade ", + "definition": { + "text": "Write here the summary / definition of this Book." + }, + "paragraphs": [ + { + "style": "Text", + "text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode." + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/SearchEngine.js b/Projects/Superalgos/UI/Spaces/Docs-Space/SearchEngine.js index d2c52eea5..d83a928f2 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/SearchEngine.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/SearchEngine.js @@ -57,6 +57,17 @@ function newSuperalgosDocsSearchEngine() { indexDocument(documentIndex) thisObject.docsIndex.push(documentIndex) } + /* Search in Books */ + for (let i = 0; i < SCHEMAS_BY_PROJECT.get(project).array.docsBookSchema.length; i++) { + documentIndex = { + phraseCount: {}, // here we have an object with properties matching it paragraph style, and each property is a map of phrases and their total count. + docsSchemaDocument: SCHEMAS_BY_PROJECT.get(project).array.docsBookSchema[i], + category: 'Book', + project: project + } + indexDocument(documentIndex) + thisObject.docsIndex.push(documentIndex) + } /* Search in Workspace */ for (let i = 0; i < SCHEMAS_BY_PROJECT.get(project).array.workspaceSchema.length; i++) { documentIndex = {