- Categories:
CORTEX_ SEARCH_ BATCH¶
This table function submits a batch of queries to a Cortex Search service for high-throughput offline use cases such as entity resolution, deduplication, audience matching, or clustering.
Batch search uses dedicated serverless compute that scales independently of interactive search traffic. For a full guide including cost considerations, usage notes, and examples, see Batch Cortex Search.
Syntax¶
Arguments¶
Required:
SERVICE_NAME => 'string'Fully-qualified name of the Cortex Search service to query.
You can specify any of the following:
- Unqualified name (
service_name) - Partially qualified name (
schema_name.service_name) - Fully qualified name (
database_name.schema_name.service_name)
- Unqualified name (
Optional:
QUERY => string_columnColumn containing query strings for searching the service.
MULTI_INDEX_QUERY => variant_columnColumn containing an object that specifies one or more vector or keyword query inputs to search against the service index. See multi_index_query for details.
FILTER => variant_columnColumn containing filter objects to apply to the search results.
LIMIT => integerMaximum number of results to return per query. Default: 10.
OPTIONS => variant_columnColumn containing a VARIANT object with optional per-query settings. Supported keys:
scoring_config: Customize ranking for the query. See Customize scoring.replicas: Number of index copies serving the query (default: 2). Higher values complete jobs faster.
Note
At least one of QUERY, MULTI_INDEX_QUERY, or FILTER must be specified.
Output¶
The function returns columns from the indexed service data that match each query, including relevance scores.
Usage notes¶
- Use with a
LATERALjoin to pass a column of queries from a source table. - Reranking is not supported for batch search queries. Any reranker settings in
scoring_configare ignored. - Batch search can query services that are currently suspended in serving.
- Batch and interactive queries use separate compute and don’t compete for resources.
- For fewer than 2,000 queries, the interactive Cortex Search API typically provides faster results.
- Requires the same privileges as querying the Cortex Search service interactively.
For detailed usage notes and cost information, see Batch Cortex Search.
Examples¶
Match user-submitted product names against a golden catalog: