blob: c2de95e4ba5e185f4cf4115bacb364edf98fceef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package main
import (
"fmt"
"searchEngine/core"
)
func main() {
engine := core.NewEngine()
dumpPath := "C:/Users/bambi15/Documents/wikipedia/simplewiki-2026-07-01-p1p1273731/simplewiki-2026-07-01-p1p1273731.xml"
fmt.Println("Ingesting and indexing wiki dump...")
err := engine.IndexDump(dumpPath, 4)
if err != nil {
panic(err)
}
fmt.Println("Indexing complete! Running a test search...")
results := engine.Search("league of legends")
fmt.Printf("Found %d articles matching your query:\n", len(results))
for i, title := range results {
if i >= 10 {
fmt.Println("... and more.")
break
}
fmt.Printf("- %s\n", title)
}
}
|