Knowledge Catalog lets you discover, centrally catalog, manage, and understand your organization's data. To efficiently find specific data assets within your data catalog, you can use powerful search queries. The syntax for search queries includes:
- Simple search: Finding data assets using a single search term.
- Free-text search: Finding data assets using natural language phrases or keywords.
- Qualified predicates: Refining your search using specific metadata fields like name, location, system, or type.
- Aspect search: Searching for entries based on their attached business and technical metadata.
- Logical operators: Combining multiple search criteria using
AND,OR, orNOToperators to create complex queries. By understanding this syntax, you can quickly locate the data you need.
Qualified predicates
Use a qualified predicate to narrow down the search results by explicitly instructing search to evaluate a specific metadata field, such as an asset name, type, or system.
You can qualify a predicate by prefixing it with a key that restricts the matching to a specific piece of metadata:
- An equal sign (
=) to restrict the search to an exact match. - A colon (
:) after the key to match the predicate to either a substring or a token within the value in the search results.
Tokenization splits the stream of text into a series of tokens, with each token usually corresponding to a single word.
For example:
name:fooselects resources with names that contain thefoosubstring, such asfoo1andbarfoo.description:fooselects resources with thefootoken in the description, such asbarandfoo.location=foomatches resources in a specified location withfooas the location name.
Supported qualifiers
Knowledge Catalog search supports the following qualifiers:
| Qualifier | Description |
|---|---|
name:x |
Matches x as a substring of the resource ID or resource
display name. |
displayname:x |
Matches x as a substring of the resource display name. |
column:x |
Matches x as a substring of the column name (or nested
column name) in the schema of the resource. |
description:x |
Matches x as a token in the resource description. For example:
|
labels:bar |
Matches resources that have a label (with some
value) and the label key has bar as a substring. |
labels=bar |
Matches resources that have a label (with
some value) and the label key equals bar as a string. |
labels.bar:x |
Matches x as a substring in the value of a label with
key bar attached to a resource. |
labels.foo=bar |
Matches resources where the key equals
foo and the key value equals bar. |
type=TYPE |
Matches resources of a specific entry type or its type alias. Requires the = qualifier. |
projectid:bar |
Matches resources within Google Cloud projects that match
bar as a substring in the ID. |
parent:x |
Matches x as a substring of the hierarchical path of a
resource. |
system=SYSTEM |
Matches resources from a specified system. Requires the = qualifier. |
location=LOCATION |
Matches resources in a specified location with an exact name. Requires the BigQuery Omni assets support this qualifier by using the
BigQuery Omni location name.
For example,
|
createtime |
Finds resources that were created within, before, or after a given date, timestamp, or relative time in days. For supported formats and operators, see Time filters. |
updatetime |
Finds resources that were updated within, before, or after a given date, timestamp, or relative time in days. For supported formats and operators, see Time filters. |
Exact match qualifiers
The predicate keys type, system, location, and aspect
search (excluding has) support only the exact match (=) qualifier, not the
substring qualifier (:).
Use the following exact match syntax for these predicates:
| Predicate key | Correct syntax | Incorrect syntax |
|---|---|---|
type |
type=table (or type=view, type=dataset) |
type:table or type:tab |
system |
system=bigquery (or system=spanner) |
system:bigquery or system:big |
location |
location=us-central1 (or location=europe-west1) |
location:us-central1 or location:us |
Substring qualifiers
Predicates such as name, displayname, column, projectid, and parent,
support substring matching with the colon (:) qualifier:
name:transactionsmatches resources whose ID or display name containstransactions. For example,daily_transactions_rawandtransactions_v2.column:customer_idmatches resources with a column name containingcustomer_id.projectid:prodmatches resources in projects whose ID containsprod. For example,finance-prod-2026.
Time filters
You can filter resources by creation time (createtime) or last update time
(updatetime).
Supported operators and formats
- Supported operators:
:,=,<,>,<=,>=,=>,=< - Relative days (
-Nd): Filter by a relative number of days in the past (for example,-30d,-7d,-1d). - Calendar dates (
YYYY-MM-DDorYYYY/MM/DD): Filter by a specific date in GMT/UTC. - Full timestamps (
YYYY-MM-DDTHH:MM:SSorYYYY-MM-DDTHH:MM:SSZ): Filter by a precise timestamp in GMT/UTC. Partial timestamps, such asYYYY-MM-DDTHH:MMorYYYY-MM-DDTHH, are also supported.
Time filter syntax
The following table explains the time filter syntax:
| Format category | Valid syntax | Invalid syntax | Description |
|---|---|---|---|
| Relative time units |
|
|
|
| Calendar dates |
|
|
|
| Timestamps and time zones |
|
|
|
| Time-of-day ranges |
|
|
|
| Natural language dates |
|
|
|
Label filters
Use the labels predicate to filter resources by attached labels. You
can filter by label key, label value, or both:
| Query pattern | Example | Description |
|---|---|---|
labels=KEY |
labels=environment |
Matches resources that have a label with the exact key environment, regardless of its value. |
labels:KEY_SUBSTRING |
labels:tier |
Matches resources with a label key containing tier as a substring (such as service_tier or storage_tier). |
labels.KEY=VALUE |
labels.env=prod |
Matches resources where the label key is env and its value is exactly prod. |
labels.KEY:VALUE_SUBSTRING |
labels.owner:analytics |
Matches resources with label key owner where the value contains analytics as a substring (such as analytics-team or data-analytics). |
| Multiple labels (AND) | labels.env=prod labels.data_tier=tier1 |
Matches resources that have both the env=prod and data_tier=tier1 labels attached. |
| Combined with system and type | system=bigquery type=table labels.env=prod labels.confidentiality=high |
Matches BigQuery tables labeled with env=prod and confidentiality=high. |
Aspect search
You can use query syntax to search for entries based on their attached aspects.
The substring match tries to match against a limited number of aspects. If you can't find the entry by using a fragment of the path, then use the full path to narrow the search and increase recall.
| Qualifier | Description |
|---|---|
aspect:xor has:x |
Matches x as a substring of the full path to the aspect
type of an aspect that is attached to the entry, in the format
projectid.location.ASPECT_TYPE_ID |
aspect=xor has=x |
Matches x as the full path to the aspect
type of an aspect that is attached to the entry, in the format
projectid.location.ASPECT_TYPE_ID |
x |
Searches for aspect field values. Matches
Only top-level fields of the aspect are searchable. |
Logical operators
A query can combine multiple predicates using logical operators.
Note: Logical operators AND, OR, and NOT are case-sensitive and must be in
uppercase letters.
AND operator
If you separate multiple search terms or predicates with a space, logical AND is implied, which means you don't have to write it explicitly.
The following examples show how to construct queries with the AND operator.
Search for BigQuery tables
system=bigquery type=tableSearch for resources in project
banking-prodwith a column namedcustomer_idprojectid:banking-prod column:customer_idIf required, you can use explicit
ANDoperator:system=bigquery AND type=table AND location=us-central1
OR operator
Use the OR operator to match any of multiple conditions. When
combining OR with other criteria, use parentheses ( ) to group the
expressions and define precedence.
The following examples show how to construct queries with the OR operator.
Search for BigQuery tables and views
system=bigquery (type=table OR type=view)Search for tables across multiple systems
(system=bigquery OR system=spanner) type=tableSearch for entries in either marketing or finance datasets
system=bigquery (parent:marketing_analytics OR parent:finance_analytics)
NOT operator
You can negate a predicate by prefixing it with uppercase NOT or a - (hyphen).
The following examples show how to construct queries with the NOT operator.
Find all tables except those in a sandbox project
- Use the
NOToperator
type=table NOT projectid:sandbox-project- Use hyphen
type=table -projectid:sandbox-project- Use the
Find all BigQuery resources that don't contain
testin their namesystem=bigquery -name:test
Abbreviated syntax
If you want to use the abbreviated syntax, use | (vertical bar) for
OR operators and , (comma) for AND operators within parentheses.
This abbreviated syntax works for the qualified predicates.
Search across multiple project IDs
- Use the
ORoperator:
projectid:(finance-prod|sales-prod|analytics-prod)- Use parentheses:
projectid:finance-prod OR projectid:sales-prod OR projectid:analytics-prod- Use the
Search for entries matching multiple column names (
AND)column:(customer_id,transaction_date,amount)Search for entries matching any of multiple column names (
OR)column:(customer_id|user_id|client_id)
Wildcard policy
Knowledge Catalog search syntax doesn't support wildcards, such as * or ?, in query strings or predicates.
If you include an asterisk (*) or question mark (?) in a query, it is
treated as a literal character rather than a pattern-matching wildcard.
For example, to search for tables whose names end with _masked:
- Supported:
name:_masked: uses the substring match:qualifier to find all resources whose name contains_masked, such ascustomer_records_maskedortransactions_masked. - Not supported:
name:*_masked: the*is treated as a literal character, not a pattern wildcard.
Parentheses
Parentheses in search queries have specific technical functions. If you overuse parentheses or apply them to natural language queries, you can confuse the search parser and degrade result quality.
Plain natural language
When asking a business question, pass the query in plain text. Don't wrap it in parentheses. For example, write:
Find customer orders containing email addresses
Abbreviated predicate syntax
Parentheses are highly effective when used with predicate keys to list multiple
OR andAND conditions in a compact format.
Group predicate keys with
OR(|)Search for entries residing in any of the listed projects using (
|)projectid:(finance-prod|finance-test|analytics-raw)Search for entries residing in any of the listed projects using (
OR)
projectid:finance-prod OR projectid:finance-test OR projectid:finance-rawGroup predicate keys with
AND(,)- Search for entries that contain all of the specified columns using (
,)
column:(customer_id, order_date, total_amount)- Search for entries that contain all of the specified columns using (
AND)
column:customer_id AND column:order_date AND column:total_amount- Search for entries that contain all of the specified columns using (
Hybrid search
You can combine a natural language query with compact filters.
For example, to find tables specifying monthly active users, but restrict the search to the specified projects, use the following query:
monthly active users type=table projectid:(data-warehouse|analytical-tier)
Best practices for using parentheses
Don't wrap the entire question in parentheses, because the semantic engine might treat the parentheses as literal characters, leading to low-relevance results.
- Incorrect:
(Show me datasets about US population by state) - Correct:
Show me datasets about US population by state
- Incorrect:
Avoid mixing complex, nested boolean trees with parentheses inside the natural language field. Search is optimized for natural language intent. Overcomplicating the query with parentheses and explicit logic blocks confuses the parser.
- Incorrect:
(revenue data) AND system=BIGQUERY AND projectid:(data-warehouse | analytical-tier) - Correct:
revenue data system=bigquery projectid:(data-warehouse|analytical-tier)
- Incorrect:
Don't add spaces arbitrarily unless they are part of the value.
- Incorrect:
column:( email | id ) - Correct:
column:(email|id).
- Incorrect:
What's next
- Learn how to search for resources in Knowledge Catalog
- Learn more about metadata management in Knowledge Catalog.
- Learn how to enrich entries and entry links with metadata by using aspects.
- Learn how to manage entries and ingest custom sources.