summaryrefslogtreecommitdiff
path: root/setup.go
diff options
context:
space:
mode:
Diffstat (limited to 'setup.go')
-rw-r--r--setup.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/setup.go b/setup.go
index 49aedd4..6366921 100644
--- a/setup.go
+++ b/setup.go
@@ -87,7 +87,7 @@ func readDictionary(db *sql.DB) error {
var wordsAdded int
scanner := bufio.NewScanner(file)
- maxCapacity := 1_000_000
+ maxCapacity := 2_000_000
buf := make([]byte, maxCapacity)
scanner.Buffer(buf, maxCapacity)
@@ -151,6 +151,11 @@ func readDictionary(db *sql.DB) error {
return fmt.Errorf("committing: %w", err)
}
+ _, err = db.Exec("create index wordindex on words(word);")
+ if err != nil {
+ return fmt.Errorf("creating index: %s", err)
+ }
+
log.Printf("prepared %d dictionary entries", wordsAdded)
return nil