Skip to content

search: allow custom index file openers - #1138

Open
aaaaaandrew wants to merge 1 commit into
sourcegraph:mainfrom
aaaaaandrew:feat/index-file-opener
Open

search: allow custom index file openers#1138
aaaaaandrew wants to merge 1 commit into
sourcegraph:mainfrom
aaaaaandrew:feat/index-file-opener

Conversation

@aaaaaandrew

@aaaaaandrew aaaaaandrew commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add options-bearing blocking and fast directory-searcher constructors
  • allow callers to provide an IndexFileOpener for initial and watcher loads
  • preserve index.NewIndexFile and mmap behavior for existing constructors

This lets callers select an owned-buffer reader when mmap lifetime semantics are unsuitable.

Closes #1137.

Test plan

  • go test ./...
  • go test -race ./search
  • go vet ./search
  • repeated initial-load and watcher-reload opener test

Keep mmap as the default while allowing directory searchers to inject an alternative IndexFile implementation for initial loads and watcher reloads.

Co-Authored-By: OpenAI Codex <codex@openai.com>
@aaaaaandrew
aaaaaandrew force-pushed the feat/index-file-opener branch from c5a37f5 to e88d9f6 Compare August 21, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow directory searchers to use a custom IndexFile opener

1 participant