OpenSearch Serverless – Search Without Cluster Management

OpenSearch Serverless: Search and Analytics Without Cluster Management

Managing Elasticsearch clusters is operational overhead that doesn’t add business value. OpenSearch Serverless eliminates nodes, shards, and capacity planning—you just query. In 2025, it’s become the default choice for new search workloads.

What OpenSearch Serverless Manages

Traditional OpenSearch Serverless
Choose instance types Automatic
Configure shard count Automatic
Scale nodes manually Auto-scales to zero
Patch and upgrade Automatic
Monitor cluster health Managed

Collection Types

# OpenSearch Serverless collection types

1. Search
   - Full-text search workloads
   - E-commerce product search
   - Document search
   - Optimized for query latency

2. Time Series
   - Log analytics
   - Metrics storage
   - IoT data
   - Optimized for time-based queries

3. Vector Search
   - Semantic search
   - RAG applications
   - Image similarity
   - k-NN queries

Creating a Serverless Collection

import boto3

client = boto3.client('opensearchserverless')

# Step 1: Create security policy
client.create_security_policy(
    name='products-encryption',
    type='encryption',
    policy='''
    {
        "Rules": [{"ResourceType": "collection", "Resource": ["collection/products"]}],
        "AWSOwnedKey": true
    }
    '''
)

# Step 2: Create network policy
client.create_security_policy(
    name='products-network',
    type='network',
    policy='''
    [{
        "Rules": [{"ResourceType": "collection", "Resource": ["collection/products"]}],
        "AllowFromPublic": true
    }]
    '''
)

# Step 3: Create collection
response = client.create_collection(
    name='products',
    type='SEARCH',
    description='Product catalog search'
)

print(f"Collection endpoint: {response['createCollectionDetail']['collectionEndpoint']}")

Vector Search for RAG

# Create vector index for RAG application
from opensearchpy import OpenSearch

client = OpenSearch(
    hosts=[{'host': 'your-collection.us-east-1.aoss.amazonaws.com', 'port': 443}],
    http_auth=awsauth,
    use_ssl=True
)

# Create index with k-NN
client.indices.create(
    index='knowledge-base',
    body={
        'settings': {
            'index.knn': True
        },
        'mappings': {
            'properties': {
                'embedding': {
                    'type': 'knn_vector',
                    'dimension': 1536,
                    'method': {'engine': 'faiss', 'name': 'hnsw'}
                },
                'text': {'type': 'text'},
                'metadata': {'type': 'object'}
            }
        }
    }
)

Pricing Model

OpenSearch Serverless uses OCUs (OpenSearch Compute Units). Minimum 4 OCUs when active, scales to zero when idle. For bursty workloads, this is often cheaper than provisioned clusters sitting idle.

Marcus Chen

Marcus Chen

Author & Expert

Jason Michael is the editor of Team AWS. Articles on the site are researched, fact-checked, and reviewed by the editorial team before publication. Read our editorial standards or send a correction at the editorial policy page.

55 Articles
View All Posts

Stay in the loop

Get the latest team aws updates delivered to your inbox.