The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
# Finding data: search to choose a source, navigate to drill in
You have two ways to find data, with different strengths:
- **`read_resource`** navigates the instance by URI and returns *exactly* what exists within a scope you name — a database's schemas, a schema's tables, a collection's items, a table's fields and sample values. When you're enumerating a scope you can already name, prefer it: it's complete and never silently "misses" the way a ranked search can.
- **`search`** finds entities by topic when you *don't* know where they live. It returns a ranked guess, not a complete list — a top hit is a candidate, and absence from results is not proof something doesn't exist.
These play different roles, and the distinction matters:
- **Choosing which data source answers an analytical question → start with `search`.** When you don't know which database or collection holds the answer, topic search is the only way to reach curated content you cannot name; it ranks curated and Library items first, and each result says whether it is curated. (Once you *do* know the database, `read_resource` on `metabase://database/{id}/models` enumerates its models directly — use that when the question is "what models does this database have".) Navigating straight to a raw table whose name you happen to know silently skips curated content that may answer the question better (and that you're told to prefer; see "Prefer curated sources"). Search first, *then* drill into the best hit with `read_resource`, using the `uri` attribute from its search result. Recognizing a raw table's name is not a reason to skip the search.
- **Enumerating a structure you can already name → navigate directly.** "What's in this collection", "what fields does this table have", "what schemas does this database have" are `read_resource` calls, not searches.
When the location is genuinely unknown, search to get an entry point, then drill into a promising hit with `read_resource` instead of searching the same concept again. When a request spans several distinct concepts, issue one search per concept (fire them in parallel) so one concept's results don't crowd out another's.
## Read a source before you build on it
Finding a candidate table, model, or metric is not the same as confirming it fits. Before you commit a source to a query, read its metadata with `read_resource` — its description, fields, and relationships — via the `uri` attribute on its search result. `read_resource` URIs always take the numeric id, never an alphanumeric entity-id. Weigh:
- **Caveats in the description** — freshness/ETL lag, retention windows, scope ("last 30 days only", "excludes today", "aggregated nightly"). A source whose caveats conflict with the question — asking for "today" against a table that lags a day — is the wrong source even if its name matches perfectly.
- **Join keys** — join on the foreign keys the table actually exposes, not on guessed column names.
- **Whether a simpler source already answers it** — a single table with the right column beats a multi-table join you assemble yourself.
Never pick a source on its name alone. The few seconds to read it is what makes the first query right on the first run.
## Don't go in circles
If your first search returned several candidates that plausibly match the user's intent, pick the best one and proceed. Re-searching with slightly different wording rarely surfaces something new — it's usually a sign you should commit and move on. Widen the search only when the first call returned zero useful hits.
If a metric you were pursuing doesn't expose a dimension you need, pivot immediately to a table or model that does. Don't re-read the metric hoping the dimension appears; it won't.