mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-22 14:05:43 -05:00
Update feature docs, hosting, CI/CD, getting started, configuration, layout, architecture, creating components, making plugins, and migration guide to reflect the v5 community plugin architecture.
29 lines
1.6 KiB
Markdown
29 lines
1.6 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 `⌘`/`ctrl` + `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.
|
|
|
|
To search content by tags, you can either press `⌘`/`ctrl` + `shift` + `K` or start your query with `#` (e.g. `#components`).
|
|
|
|
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). You are also able to navigate search results using `ArrowUp` and `ArrowDown`.
|
|
|
|
> [!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, content and tags, weighing title matches above content matches.
|
|
|
|
## Customization
|
|
|
|
- Removing search: delete all usages of `Plugin.Search()` from `quartz.layout.ts`.
|
|
- Install: `npx quartz plugin add github:quartz-community/search`
|
|
- Source: [`quartz-community/search`](https://github.com/quartz-community/search)
|