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
Core
- 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 β.
UI
InstantSearch β- Write your own simple components.
TODO
- 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