From 63599c719d8e4e09548546bb366a849ef40c602b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 9 Jun 2024 17:54:57 +0200 Subject: feat: add low-memory mode --- searchix.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'searchix.go') 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") -- cgit 1.4.1