View a markdown version of this page

Changing a vector index's mode - Amazon Simple Storage Service

Changing a vector index's mode

A vector index whose index mode is ENHANCED applies your metadata filter before the vector search, ensuring high recall even when filters match a small fraction of vectors, and it supports the $startsWith filter operator. Indexes in vector buckets created before September 30, 2026 use CLASSIC by default, including indexes you create in those buckets later. We recommend moving these indexes to ENHANCED.

Changing an index to ENHANCED takes effect in place, with no re-ingestion, no changes to your queries or your application, and no additional charge. To change an index's mode, call UpdateIndexMode. To see an index's current mode, call GetIndex or view the index's detail page in the Amazon S3 console.

To change an index's mode (console)
  1. Sign in to the console and open the Amazon S3 console at https://console.aws.amazon.com/s3/.

  2. In the navigation pane, choose Vector buckets.

  3. Choose the vector bucket that contains the index, then choose the index.

  4. Choose Enable enhanced index mode.

  5. Review the information in the confirmation dialog, select the acknowledgement, and then choose Enable.

aws s3vectors update-index-mode --vector-bucket-name "amzn-s3-demo-vector-bucket" --index-name "idx" --index-mode "ENHANCED"

Before you change an index, confirm that your queries use 100 or fewer filter constraints. On an ENHANCED index, a query that exceeds the limit returns a validation error. For how constraints are counted, and for how to consolidate or split a query that exceeds the limit, see Filter constraints per query. For how a filter affects query latency, see Query performance with filters.

Test an index before you change it

On a CLASSIC index, you can set the queryMode parameter to ENHANCED on a QueryVectors request to run that query with pre-filtering while the index stays as it is. You can also set queryMode to ENHANCED on an index whose index mode is already ENHANCED, where it has no additional effect.

If a query uses $startsWith under queryMode=ENHANCED and you later remove queryMode, the request returns a validation error, because $startsWith requires ENHANCED query behavior. Update the index mode to use $startsWith without setting queryMode on every request.

Set the index mode for new indexes in a vector bucket

Each vector bucket has a default index mode, inherited by new vector indexes. Setting the default applies to indexes you create afterward, and does not change any index that already exists in the bucket. To read a bucket's default, call GetVectorBucket, or view the bucket's Properties tab in the Amazon S3 console.

To move a vector bucket and its indexes to ENHANCED, complete the following steps.

  1. Set the bucket's default index mode to ENHANCED with PutVectorBucketDefaultIndexMode, so that vector indexes you create afterward use ENHANCED.

  2. List the vector indexes in the bucket with ListIndexes, and call GetIndex on each one to find those whose index mode is CLASSIC.

  3. Call UpdateIndexMode with indexMode set to ENHANCED on each of those indexes.

aws s3vectors put-vector-bucket-default-index-mode --vector-bucket-name "amzn-s3-demo-vector-bucket" --default-index-mode "ENHANCED"

Turn off the enhanced index mode

Changing an index to ENHANCED is reversible if your vector bucket was created before September 30, 2026. You can change the index back to CLASSIC with the AWS CLI, the AWS SDKs, or the Amazon S3 REST API. You cannot do this from the Amazon S3 console.

aws s3vectors update-index-mode --vector-bucket-name "amzn-s3-demo-vector-bucket" --index-name "idx" --index-mode "CLASSIC"

On a CLASSIC index, a query with a selective filter can return fewer than top K results, and $startsWith is available only when the request sets queryMode to ENHANCED. For which indexes accept CLASSIC, see UpdateIndexMode in the Amazon S3 API Reference.