Feature Request: Search Scopes (Define Default Search Corpus, Override on Demand)

Many users maintain heterogeneous content inside a single Obsidian vault: primary notes, reference material, archives, generated files, and other supporting content. While all of this material should remain indexed and linkable, not all of it should participate equally in default search results.

This proposal introduces Search Scopes: a query-time mechanism for defining which subset of indexed files Search operates on by default, while allowing simple, temporary overrides at search time when broader or narrower search is desired.

A common example is a reference or document folder (books, papers, etc) that should remain indexed and linkable, but should not appear in everyday searches unless it is explicitly included.

Current options are poor:

  • Excluded files: too strong (removes from indexing).

  • Manual -path: every time: repetitive and error-prone.

  • Saved searches: partial workaround, not a general model.

What’s missing is a first-class way to keep content indexed while making it out of scope by default, with an easy opt-in when needed.


Proposal: Search Scopes (query-time only)

Introduce Search Scopes as a query-time concept (does not affect indexing). A scope defines what corpus Search uses.

Example scopes:

  • Notes (default): excludes /Library

  • Library: includes /Library

  • All content: current behaviour


Scope definition (filters)

Each scope is defined declaratively using existing search concepts:

  • Included paths (supports literal or regex)

  • Excluded paths (supports literal or regex; exclusion wins if both match)

  • Included file types/extensions (e.g., .md, .pdf)

  • Excluded file types/extensions

That’s sufficient for the common “Notes vs Library” use case without adding a second query language.


UX: two ways to switch scope at search time

A) Optional GUI selector (for users who want it)

An opt-in selector in the Search panel (kept off by default for minimal UI):

Search …   [ Notes ▼ ]

Switching scope:

  • Preserves the query text

  • Re-runs instantly

  • Requires no settings changes during normal search

B) A -scope / scope operator (for users who want zero UI)

Allow scope override directly in the query, e.g.:

  • scope:Library term

  • scope:Notes term

This provides a clean workflow for power users who prefer the Search panel to remain unchanged.


Settings: define scopes once, don’t use Settings to search

Scopes are defined in Settings (name + filters + default scope). Normal searching never requires “meddling” with Settings.


Why this helps

  • Keeps Library indexed and linkable

  • Keeps default search clean

  • One-action opt-in to search Library (UI switch or operator)

  • No reliance on habits like always typing -path:…

  • Minimal and non-disruptive: default behaviour can remain “All content” unless the user enables scopes and sets a default


Summary

Search Scopes provide a structured way to apply persistent, query-time path/type filters—keeping large reference corpora indexed while preserving a clean default search experience. Users can switch scopes either via an optional UI selector or via a scope: / -scope operator, without changing settings during search.

2 Likes

I really like this idea!

1 Like