summaryrefslogtreecommitdiff
path: root/core/engine.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/engine.go')
-rw-r--r--core/engine.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/engine.go b/core/engine.go
index 4b6b150..6e929e2 100644
--- a/core/engine.go
+++ b/core/engine.go
@@ -19,6 +19,11 @@ func NewEngine() *Engine {
}
}
+func NewEngineWithIndex(idx *index.InvertedIndex) *Engine {
+ return &Engine{
+ idx: idx,
+ }
+}
func (e *Engine) Index() *index.InvertedIndex {
return e.idx
}
@@ -39,8 +44,13 @@ func (e *Engine) IndexDump(filePath string, numWorkers int) error {
}
})
}
-
- err := ingest.IngestWikiDump(filePath, jobQueue)
+ var processedCount int
+ err := ingest.WikiDump(filePath, jobQueue, func() {
+ processedCount++
+ if processedCount%1000 == 0 {
+ fmt.Printf("\rProcessed %d articles...", processedCount)
+ }
+ })
close(jobQueue)
wg.Wait()