fixed searching in workspace

This commit is contained in:
Alexandru Stefan committed 2021-11-03 18:44:59 +02:00
1 parent 09e9b27b4d
commit a3daa13011
3 files changed
+8 -13

No files matched your search

+3 -7
View File
@@ -1,4 +1,4 @@
/* Root object*/
/* Root objects*/
let UI = {
projects: {},
@@ -7,14 +7,10 @@ let UI = {
running: {}
}
let SA = {
projects: {} ,
nodeModules: {
flexSearch: require("flexsearch")
}
}
let SA = { projects: {} }
/*
We will use this to load functions originally intended for Nodejs
*/
let exports = {}
@@ -14,7 +14,7 @@ function newFoundationsDocsSearchEngine() {
thisObject.documentIndex = new FlexSearch.Document({
preset: "performance",
worker: true,
encoder: "extra",
encoder: "advanced",
tokenize: "full",
document: {
index: [
@@ -225,7 +225,7 @@ function newFoundationsDocsSearchEngine() {
}
if (docsSchemaDocument.definition !== undefined) {
let paragraph = {
text: docsSchemaDocument.definition,
text: docsSchemaDocument.definition.text,
translations: docsSchemaDocument.definition.translations
}
appendToTextField(paragraph.text)
@@ -262,7 +262,6 @@ function newFoundationsDocsSearchEngine() {
}
}
function setUpWorkspaceSchemas() {
@@ -17,17 +17,17 @@ function newFoundationsDocsSearchResultsPage() {
function render() {
let index = UI.projects.education.spaces.docsSpace.searchEngine.documentIndex
let docIndex = UI.projects.education.spaces.docsSpace.searchEngine.documentIndex
let resultsArray = []
let initialTime = new Date()
let searchByType = index.search(UI.projects.education.spaces.docsSpace.commandInterface.command.toLowerCase(), {
let searchByType = docIndex.search(UI.projects.education.spaces.docsSpace.commandInterface.command.toLowerCase(), {
pluck: 'docsSchemaDocument:type',
enrich: true,
limit: 10000
})
let searchByText = index.search(UI.projects.education.spaces.docsSpace.commandInterface.command.toLowerCase(), {
let searchByText = docIndex.search(UI.projects.education.spaces.docsSpace.commandInterface.command.toLowerCase(), {
pluck: 'text',
enrich: true,
limit: 10000