Both run on the same Flight SQL connection as the pools,
and over SQL over HTTP. Both run only in interactive
queries, such as a Plot that a browser Pane runs. A Plot that a Report runs
cannot call them: saving the Plot records an error, and the Plot cannot
publish until you remove the call. For a Report, search first, then write the
Plot’s SQL against the source table.
Find tables and columns
search_available_data(query [, scope [, kind]]) searches the names and
descriptions of tables and columns in the Provider and Workspace pools. It
returns only the pools your role can query.
scope starts with providers or workspace, such as providers.linear or
providers.linear.issues.*. kind is 'table' or 'column'.
Search Available Data
lists every scope pattern and result column.
Find records by what they say
search_everything finds rows in the Provider pool whose text matches a
question by meaning, not only by keyword. It returns one row for each matching
source record, never one row for each passage.
Ask your Parable representative to turn on search for your Workspace. Until
then,
search_everything returns no rows.What is searchable
search_everything searches only the Provider pool, and only the text fields
that a Provider’s Tap schema marks for search with
x-transformEmbed. Some fields are searched with context from the same record.
For example, an issue’s title comes before its body. A call transcript is
searched as windows of speaker turns. A Notion page is searched as its blocks,
under its title, and its column_name is blocks.
Email and Drive file records are searched by the text that their taps hold:
A title, such as a file name or a calendar event’s
summary, is searched when
it has at least two telling words, such as “Q4 Roadmap”. A title is not searched
when it has one word or only generic words, such as “Roadmap”, “Test” or
“Untitled document”. Other text with fewer than four words is not searched, such
as an email preview that says “Thanks”. To find a value that is not searched,
query its source table, for example with ILIKE.
Arguments
search_everything(query [, scope [, limit [, half_life]]]) takes up to four
arguments, by position only. Named arguments (query => ...) are refused.
Parable refuses arguments that it cannot search before anything runs:
- A scope that does not start with
providers. - A limit outside 1 to 100, or a limit that is not a whole number.
- An empty query.
- A query or scope that is not text.
- A half-life that is not a positive
INTERVAL. - A bound parameter, such as
$1, with no value when the search runs.
search_everything($1, NULL, 20) and send the text a person types as $1.
The refusal is INVALID_ARGUMENT with error code QL-PL-018. Its message
names the argument and what to use instead. Over HTTP, it is a 400 with the
same code.
Results
The snippet is not the whole record. Read the record from its source table.
With a half-life,
relevance = score × (0.5 + 0.5 × 2^(−age / half_life)),
where age is the time since updated_at. Age can at most halve a score,
and a record with no updated_at counts as the oldest. score does not
change. Search Everything
has the details:
Join back to the source table
row_key is a JSON object of the source table’s key columns. Read a text key
with json_get_str and a numeric key with json_get_int:
row_key holds. A record with more than one key
column matches on each of them.
Policies apply
Parable reads each matching record again from its source table before it returns the record. That read applies the same Provider Policies and source permissions as your own query of the table. A record that a Policy hides from you is left out, and its text never appears in a snippet. If you cannot query the Provider pool, you see no records. When your Workspace applies source permissions, a Google Calendar event is found only by the people on it: its attendees, members of a group that attends, its organizer, and the person whose calendar holds it. Its title (summary) and its description, with the title
before it, are searched.
When one source table takes too long to read, its records are left out of the
result, and records from other tables still return. When no source table can
be read in time, the search fails with DEADLINE_EXCEEDED and error code
QL-TO-004. Over HTTP, it is a 504 with the same code. The message names
the time limit. Run the search again. If it fails again, narrow the scope to
fewer tables, such as providers.linear.*.
An empty result
An empty result does not prove that nothing matches.search_everything also
returns no rows when:
- Search is not turned on for your Workspace.
- The Workspace’s AI policy admits no embedding model for this search.
- The search index is missing or still building.
- A record’s text changed after Parable indexed it, until the index catches up.
search_available_data and query it
directly.