Run Local Search
This tutorial walks you through setting up Otso’s indexer and search UI on your machine. By the end, you’ll have a local search interface for your digital history.
Prerequisites
Section titled “Prerequisites”Before starting, ensure you have:
- Rust 1.70+ — Install from rustup.rs
- Node.js 18+ — Install from nodejs.org
- pnpm — Install with
npm install -g pnpm - Git — For cloning the repository
Quick Start
Section titled “Quick Start”-
Clone the repository
Terminal window git clone https://github.com/yourusername/otso.gitcd otso -
Install Node dependencies
Terminal window pnpm install -
Build the Rust indexer
Terminal window cd packages/otso-indexercargo build --release -
Run the indexer with demo data
The repository includes fixture data for testing:
Terminal window cargo run --release -- -c ../../data/config/sources.toml buildYou should see output like:
INFO Loaded 23 source configurationsINFO Building 23 sourcesINFO pinboard events: 15 inserted, 0 skippedINFO spotify events: 25 inserted, 0 skipped...INFO Updating projections... -
Start the search UI
Terminal window cd ../otso-searchpnpm dev -
Open the search interface
Navigate to
http://localhost:5173in your browser.
Using the Search UI
Section titled “Using the Search UI”Basic Search
Section titled “Basic Search”Type in the search box to find items across all sources. Results appear instantly as you type.
- Empty search shows recent items
- Search terms are matched against title and content
- Snippets highlight where your query matched
Timeline Histogram
Section titled “Timeline Histogram”Click the histogram icon to see your activity over time:
- Each bar represents a month
- Colors indicate different sources
- Click a bar to filter by that time period
- Click again to clear the filter
Category Filters
Section titled “Category Filters”Filter by content type using the category chips:
| Category | What it includes |
|---|---|
| Reading | Bookmarks, highlights |
| Music | Listens from Spotify, Last.fm |
| Social | Tweets, toots, messages |
| Notes | Apple Notes, Notion pages |
| Browse | Browser history, searches |
| Code | GitHub activity |
Keyboard Navigation
Section titled “Keyboard Navigation”- ↑/↓ — Move through results
- Enter — Open selected item
- Escape — Close document modal
- / — Focus search box
Adding Your Own Data
Section titled “Adding Your Own Data”Data Format Requirements
Section titled “Data Format Requirements”Otso expects your data in SQLite databases. Each source database should have tables that can be queried for:
| Field | Required | Description |
|---|---|---|
external_id | Yes | Unique identifier within the source |
title | Yes | Display title for the item |
content | No | Full text content for search |
occurred_at | Yes | Timestamp (Unix epoch or ISO 8601) |
url | No | Link to original item |
Adding a New Source
Section titled “Adding a New Source”-
Place your database
Create a directory for your source and place the database inside:
Terminal window mkdir -p data/sources/my-source/chroniclecp ~/my-data.db data/sources/my-source/chronicle/chronicle.db -
Add configuration
Edit
data/config/sources.toml:[[sources]]name = "my-source"enabled = truedb_path = "my-source/chronicle/chronicle.db"category = "notes" # Choose: reading, music, social, notes, etc.[[sources.queries]]table = "items"entry_type = "note"action_type = "CreateAction"object_type = "NoteDigitalDocument"sql = """SELECTid as external_id,title,body as content,created_at as occurred_at,NULL as urlFROM items""" -
Switch to production data directory
In
sources.toml, change the data directory:[defaults]data_dir = "data/sources" # Changed from "data/fixtures" -
Rebuild the index
Terminal window cd packages/otso-indexercargo run --release -- build -
Refresh the search UI
Your new source should appear in the category filters.
Troubleshooting
Section titled “Troubleshooting””Table not found” error
Section titled “”Table not found” error”Check that the table name in your SQL matches what’s in your database:
sqlite3 data/sources/my-source/chronicle/chronicle.db ".tables"No results appearing
Section titled “No results appearing”Verify events were indexed:
cargo run --release -- statsThis shows event counts per source.
Timestamp parsing issues
Section titled “Timestamp parsing issues”The indexer handles many formats automatically:
- Unix timestamps (seconds or milliseconds)
- ISO 8601 (
2024-01-15T10:30:00Z) - Date strings (
2024-01-15) - Various locale formats
If parsing fails, events default to the current time with a warning.
Next Steps
Section titled “Next Steps”- Configure more sources — Full reference for
sources.toml - Understand the event model — How data is stored internally
- See the roadmap — What’s coming next