Add OpenSearch Serverless (AOSS) support#802
Conversation
- Add --serverless and --aws-region CLI options - Use AWS SigV4 authentication via requests-aws4auth for AOSS - Skip unsupported operations for serverless: cluster settings, force merge, manual refresh, replica updates, warmup API - Use smaller batch size (100) for serverless bulk inserts - Store id as document field (serverless doesn't support custom _id) - Retrieve id from _source in search results for serverless - Remove 'engine' and 'encoder' from index method config for serverless (AOSS manages these internally)
XuanYang-cn
left a comment
There was a problem hiding this comment.
I left a few inline comments for the AOSS paths that look like they still need fixes before merge.
- Route serverless through single-client insert path (AOSS doesn't support custom _id; the multi-client path would send _id and fail) - prepare_filter now filters NumGE on the stored 'id' field for serverless, and mappings store 'id' as a numeric (long) field so range queries work - Add boto3 and requests-aws4auth to the opensearch extra in pyproject.toml and to install/requirements_py3.11.txt - Update README serverless prerequisites to reference the opensearch extra and mention boto3
|
Thanks for the review, @XuanYang-cn! I've addressed all three comments in 57f7448:
PTAL when you get a chance. /assign @XuanYang-cn |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: norrishuang, XuanYang-cn The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
Add support for Amazon OpenSearch Serverless (AOSS) to the awsopensearch client.
Changes
is_serverlessandaws_regionfields; use AWS SigV4 authentication viarequests-aws4authfor AOSS connections--serverlessflag and--aws-regionoption_id)_sourcein search resultsengineandencoderfrom method config (AOSS manages internally)http_compressto avoid SigV4 checksum verification failuresUsage
Prerequisites
requests-aws4authinstalledaoss:APIAccessAllTesting
Tested against a live AOSS collection with 1M 768-dim vectors (Cohere dataset). Data loading and index creation verified successfully.