mirror of
https://github.com/alexankitty/Myrient-Search-Engine.git
synced 2026-01-15 16:33:15 -03:00
add indexing message
This commit is contained in:
@@ -4,6 +4,7 @@ export default class Searcher{
|
||||
constructor(fileArr, fields){
|
||||
this.distance = parseFloat(process.env.FUZZY_DISTANCE)
|
||||
this.minMatch = parseFloat(process.env.MIN_MATCH)
|
||||
this.indexing = false
|
||||
this.createIndex(fileArr, fields)
|
||||
}
|
||||
|
||||
@@ -36,10 +37,12 @@ export default class Searcher{
|
||||
else{
|
||||
this.miniSearch.removeAll()
|
||||
}
|
||||
this.indexing = true
|
||||
this.miniSearch.addAllAsync(fileArr)
|
||||
.then( result => {
|
||||
console.log('File list indexing completed.')
|
||||
console.log(`Total terms in index: ${this.miniSearch.termCount}`)
|
||||
this.indexing = false
|
||||
})
|
||||
}
|
||||
parseHrtimeToSeconds(hrtime){
|
||||
|
||||
@@ -107,7 +107,8 @@ app.get("/settings", function(req, res) {
|
||||
res.render('pages/index', {
|
||||
page: 'settings',
|
||||
crawlTime: crawlTime,
|
||||
defaultSettings: defaultSettings
|
||||
defaultSettings: defaultSettings,
|
||||
indexing: search.indexing
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ _ / / / _ /_/ /_ / _ / / __/ / / / /_
|
||||
<button type="submit" class="btn btn-secondary ml-2">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
<p class="m-2">Found <%= results.items.length %> result<%= results.items.length != 1 ? 's': '' %> in <%= results.elapsed %> seconds. <%= results.elapsed > 10 ? ' Lucky you, you caught the indexer while it was running.' : '' %></p>
|
||||
<p class="m-2">Found <%= results.items.length %> result<%= results.items.length != 1 ? 's': '' %> in <%= results.elapsed %> seconds. <%= indexing ? "Indexing in progress, if the list is missing something please try reloading in a few minutes" : "" %></p>
|
||||
</form>
|
||||
|
||||
<div class="col-sm-12 w-100 mt-3">
|
||||
|
||||
Reference in New Issue
Block a user