Cortex Search: METADATA$RANK removed from CORTEX_ SEARCH_ BATCH (Pending)¶
Attention
This behavior change is in the 2026_07 bundle.
For the current status of the bundle, refer to Bundle history.
When this behavior change bundle is enabled, the METADATA$RANK column is no longer returned from
CORTEX_SEARCH_BATCH. Any query that
references METADATA$RANK will fail with the following SQL compilation error:
This impacts any query using CORTEX_SEARCH_BATCH that references METADATA$RANK, including SELECT lists,
WHERE clauses, or QUALIFY filters on that column.
- Before the change:
The
CORTEX_SEARCH_BATCHtable function returns aMETADATA$RANKcolumn.METADATA$RANKis a 1-based integer that reflects the physical row delivery order of results within eachMETADATA$REQUEST_IDpartition.- After the change:
METADATA$RANKis no longer returned fromCORTEX_SEARCH_BATCH. Queries that referenceMETADATA$RANKfail with a SQL compilation error. The returned results are still in ranked order.
The rank position of each result can be determined directly from the order in which CORTEX_SEARCH_BATCH
returns rows within a partition, making METADATA$RANK unnecessary. This change simplifies the function
output by removing a redundant column.
How to update your code¶
Replace any reference to METADATA$RANK with a ROW_NUMBER() window function partitioned by
METADATA$REQUEST_ID and ordered by SEQ8():
This reproduces the same 1-based row number within each request partition that METADATA$RANK previously
provided. For example:
Ref: 2418