mirror of
https://gitlab.com/MisterBiggs/brain-quartz.git
synced 2025-07-29 17:51:23 +00:00
.github
content
advanced
features
Latex.md
Mermaid diagrams.md
RSS Feed.md
SPA Routing.md
backlinks.md
callouts.md
folder and tag listings.md
full-text search.md
graph view.md
index.md
no-code layout configuration.md
popover previews.md
syntax highlighting.md
table of contents.md
upcoming features.md
tags
configuration.md
custom domain.md
hosting.md
index.md
philosophy.md
quartz-transform-pipeline.png
showcase.md
quartz
.gitignore
.prettierignore
.prettierrc
CODE_OF_CONDUCT.md
LICENSE.txt
README.md
globals.d.ts
index.d.ts
package-lock.json
package.json
quartz.config.ts
tsconfig.json
29 lines
1.4 KiB
Markdown
29 lines
1.4 KiB
Markdown
---
|
|
title: Full-text Search
|
|
tags:
|
|
- component
|
|
---
|
|
|
|
Full-text search in Quartz is powered by [Flexsearch](https://github.com/nextapps-de/flexsearch). It's fast enough to return search results in under 10ms for Quartzs as large as half a million words.
|
|
|
|
It can be opened by either clicking on the search bar or pressing ⌘+K. The top 5 search results are shown on each query. Matching subterms are highlighted and the most relevant 30 words are excerpted. Clicking on a search result will navigate to that page.
|
|
|
|
This component is also keyboard accessible: Tab and Shift+Tab will cycle forward and backward through search results and Enter will navigate to the highlighted result (first result by default).
|
|
|
|
> [!info]
|
|
> Search requires the `ContentIndex` emitter plugin to be present in the [[configuration]].
|
|
|
|
### Indexing Behaviour
|
|
|
|
By default, it indexes every page on the site with **Markdown syntax removed**. This means link URLs for instance are not indexed.
|
|
|
|
It properly tokenizes Chinese, Korean, and Japenese characters and constructs separate indexes for the title and content, weighing title matches above content matches.
|
|
|
|
## Customization
|
|
|
|
- Removing search: delete all usages of `Component.Search()` from `quartz.config.ts`.
|
|
- Component: `quartz/components/Search.tsx`
|
|
- Style: `quartz/components/styles/search.scss`
|
|
- Script: `quartz/components/scripts/search.inline.ts`
|
|
- You can edit `contextWindowWords` or `numSearchResults` to suit your needs
|