Skip to content

feat: add index.ignore config to skip indexing paths#1986

Open
gleber wants to merge 1 commit into
silverbulletmd:mainfrom
gleber:feat/index-ignore
Open

feat: add index.ignore config to skip indexing paths#1986
gleber wants to merge 1 commit into
silverbulletmd:mainfrom
gleber:feat/index-ignore

Conversation

@gleber

@gleber gleber commented May 16, 2026

Copy link
Copy Markdown

Mirrors sync.ignore — gitignore-style patterns read from config.get(["index", "ignore"]). Filters both incremental file:changed queuing and full reindexSpace cycles.

I've added a lot of files to the space directory, but I do not want them to be indexed. Currently SB is unusable. In the long run, I'd want them to be viewable but not indexed or synced (I do not think this is supported yet), discoverable only via links from other accessible files.

Mirrors sync.ignore — gitignore-style patterns read from config.get(["index", "ignore"]).
Filters both incremental file:changed queuing and full reindexSpace cycles.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zefhemel

Copy link
Copy Markdown
Collaborator

For your use, would sync.ignore not suffice?

@gleber

gleber commented May 17, 2026

Copy link
Copy Markdown
Author

I've got it set already:

config.set {
  sync = {
    ignore = {
      "gmail/**",
      "gcal/**",
      "drive/**",
      "gdrive/**",
      "syncdata/**",
      "_plug/**",
      "Library/**",
      ".silverbullet.db*",
      ".ingest-state.json"
    }
  },
...

but it does not help and a lot of files are in CTRL+K:
image

SB web UI freezes for 1-2s on every interaction, click, typing, etc. I regularly see this in the console:

[Service Worker] [Sync] Completed: 1 operations in 1.165s

If I do Sync: Space command, here's what I see:

[Service Worker] [sync] Performing a full sync cycle...
logger.ts:43 [Service Worker] [sync] File has changed on secondary, but not primary: copy from secondary to primary AGENTS.md
logger.ts:43 [Service Worker] [Sync] Completed: 1 operations in 1.227s
6logger.ts:43 [Service Worker] [sync] Performing a single file sync CONFIG.md
logger.ts:43 [Service Worker] [sync] Performing a full sync cycle...
logger.ts:43 [Service Worker] [sync] File has changed on secondary, but not primary: copy from secondary to primary AGENTS.md
logger.ts:43 [Service Worker] [Sync] Completed: 1 operations in 1.207s
3logger.ts:43 [Service Worker] [sync] Performing a single file sync CONFIG.md
logger.ts:43 [Service Worker] [sync] Performing a full sync cycle...
logger.ts:43 [Service Worker] [sync] Sync already in progress...
(anonymous) @ logger.ts:43
syncSingleFile @ sync.ts:183
syncSingleFile @ sync_engine.ts:135
observedRequest @ service_worker.ts:370
emit @ event.ts:32
(anonymous) @ proxy_router.ts:309
setTimeout
handleGet @ proxy_router.ts:307
await in handleGet
handleRequest @ proxy_router.ts:254
(anonymous) @ proxy_router.ts:227
await in (anonymous)
onFetch @ proxy_router.ts:241
(anonymous) @ service_worker.ts:388
logger.ts:43 [Service Worker] [sync] File has changed on secondary, but not primary: copy from secondary to primary AGENTS.md
logger.ts:43 [Service Worker] [Sync] Completed: 1 operations in 1.133s
2logger.ts:43 [Service Worker] [sync] Performing a single file sync CONFIG.md
logger.ts:43 [Service Worker] [sync] Performing a full sync cycle...
logger.ts:43 [Service Worker] [sync] File has changed on secondary, but not primary: copy from secondary to primary AGENTS.md
logger.ts:43 [Service Worker] [Sync] Completed: 1 operations in 1.161s
5logger.ts:43 [Service Worker] [sync] Performing a single file sync CONFIG.md
logger.ts:43 [Service Worker] [sync] Performing a full sync cycle...
logger.ts:43 [Service Worker] [sync] File has changed on secondary, but not primary: copy from secondary to primary AGENTS.md
logger.ts:43 [Service Worker] [Sync] Completed: 1 operations in 1.369s
logger.ts:43 [Service Worker] [sync] Performing a single file sync CONFIG.md

Note: AGENTS.md is a symlink to CLAUDE.md, I doubt it is being actually modified by anything.

@zefhemel

Copy link
Copy Markdown
Collaborator

Ah yes of course, it doesn't sync those files but it does "see" them. But there's also the SB_SPACE_IGNORE environment variable, see: https://silverbullet.md/Install/Configuration

That's what you need?

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.

2 participants