ObsidianSearchQuery
Unofficial
A parsed Obsidian search query, compiled from a raw query string into a matcher. Used by global search, the file explorer filter, and backlink search.
Import:
import type { ObsidianSearchQuery } from '@obsidian-typings/obsidian-catalyst-latest';Signature:
export interface ObsidianSearchQueryConstructor
new ObsidianSearchQuery(app: App, query: string, caseSensitive: boolean, operators?: Record<string, unknown> | undefined)Constructor.
To get the constructor instance, use getObsidianSearchQueryConstructor from obsidian-typings/implementations.
Properties
| Property | Type | Description | |
|---|---|---|---|
| app | App | Reference to the app. | |
| caseSensitive | boolean | Whether the query is matched case-sensitively. | |
| matcher | null | SearchMatcher | The root of the compiled matcher tree, or null when the query compiles to nothing (an empty query). | |
| query | string | The raw query string. | |
| requiredInputs | null | SearchRequiredInputs | The inputs the matcher requires to evaluate a file, or null when there is no matcher. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| _match(context) | null | SearchMatchResult | Runs the matcher against a match context. | |
| match(file, content) | null | SearchMatchResult | Matches a file (and optionally its content) against the query. | |
| matchContent(content) | null | SearchMatchResult | Matches content against the query. | |
| matchFilename(path) | null | SearchMatchResult | Matches a file path's name against the query. | |
| matchFilepath(path) | null | SearchMatchResult | Matches a file path against the query. | |
| matchTag(tag) | null | SearchMatchResult | Matches a tag against the query. |
Links to this page: