diff options
author | Alan Pearce | 2024-06-09 17:54:57 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-09 17:54:57 +0200 |
commit | 63599c719d8e4e09548546bb366a849ef40c602b (patch) | |
tree | 549336370f77a8a1a3c626fe6bf0118f32baef59 /searchix.go | |
parent | 789d0079f84017ddafad763ffba9aadbcd6aa6da (diff) | |
download | searchix-63599c719d8e4e09548546bb366a849ef40c602b.tar.lz searchix-63599c719d8e4e09548546bb366a849ef40c602b.tar.zst searchix-63599c719d8e4e09548546bb366a849ef40c602b.zip |
feat: add low-memory mode
Diffstat (limited to 'searchix.go')
-rw-r--r-- | searchix.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/searchix.go b/searchix.go index 9ea7b9a..8257dbc 100644 --- a/searchix.go +++ b/searchix.go @@ -39,8 +39,9 @@ func nextOccurrenceOfLocalTime(t toml.LocalTime) time.Time { } type IndexOptions struct { - Update bool - Replace bool + Update bool + Replace bool + LowMemory bool } func (s *Server) SetupIndex(options *IndexOptions) error { @@ -55,6 +56,9 @@ func (s *Server) SetupIndex(options *IndexOptions) error { read, write, exists, err := index.OpenOrCreate( s.cfg.DataPath, options.Replace, + &index.Options{ + LowMemory: options.LowMemory, + }, ) if err != nil { return errors.Wrap(err, "Failed to open or create index") |