Skip to content

prepareSimpleSearch

Official

Construct a simple search callback that runs on a target string.

Import:

import { prepareSimpleSearch } from 'obsidian';

Signature:

function prepareSimpleSearch(query: string): (text: string) => null | SearchResult

Parameters:

Parameter Type Description
query string the space-separated words.

Returns: (text: string) => null | SearchResult — fn - the callback export function to apply the search on or null if the query is empty.