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) => SearchResult | null

Parameters:

ParameterTypeDescription
querystringthe space-separated words.

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