Faceted search
Faceted search is a method of searching through data by using “facets” (data attributes) to gradually narrow down a large data set. In the case of markdown notes, data attributes can come from front matter.
Options
Section titled “Options”- Expose full content as JSON, similar to what I did in graph.json ↗ + facets ↗
- Cons: Not scalable for text search.
- Add filters to HTML (
data-pagefind-filter
) in a hidden div + pagefind ↗- Cons: There are issues related to faceting. See Discussion: Pagefind as a General Faceting Search Engine ↗.
- Hybrid solution: Use Pagefind for text search and facets library for faceting.
Other less feasible options:
- SQLite WASM + HTTP Range ↗
- I read somewhere that SQLite’s text index is not optimal for this use case (that is why the author tried to use Tantivy - see next line).
- Tantivy Compiled to WASM ↗.
InstantSearch ↗- Write your own simple components.
- I created a basic proof of concept using facets and InstantSearch ↗. I don’t like it, though. It supports facets for:
- Tags
- Date
- I can still use
facets
orpagefind
, but I need a different UI.- Use something slim, like Preact or Solid. However, I can’t find a good components library. Or give up and use React. Then I can use
shadcn/ui
and many others.- Maybe there are options in Components for Web ↗.
- Maybe implement a custom Pagefind UI (@pagefind/modular-ui ↗).
- Use something slim, like Preact or Solid. However, I can’t find a good components library. Or give up and use React. Then I can use
- Other potential fields for facets:
- Maybe a
stage
field (make it a separate field instead of using emojis in the title 🧠, 🚷, 🚧). - Maybe a task count (closed, open, total).
- Maybe a
- Sort by:
- Date
- Title
- Task count