Setting the file. One moment.
Chapter 45 · Amazon Opensearch Service
Subchapter 45.33
references/search-index-config.mdMarkdown2 KBView on GitHub
PUT /my-index
{
"settings": {
"index": {
"knn": true,
"default_pipeline": "my-ingest-pipeline"
}
},
"mappings": {
"properties": {
"text": {"type": "text"},
"embedding": {
"type": "knn_vector",
"dimension": 1024,
"method": {"engine": "faiss", "name": "hnsw", "space_type": "l2"}
}
}
}
}PUT /my-hybrid-index
{
"settings": {
"index": {"knn": true, "default_pipeline": "hybrid-ingest-pipeline"}
},
"mappings": {
"properties": {
"title": {"type": "text"},
"content": {"type": "text"},
"content_embedding": {
"type": "knn_vector",
"dimension": 1024,
"method": {"engine": "faiss", "name": "hnsw", "space_type": "l2"}
}
}
}
}PUT /_ingest/pipeline/my-ingest-pipeline
{
"processors": [{
"text_embedding": {
"model_id": "<model_id>",
"field_map": {"text": "embedding"}
}
}]
}PUT /_search/pipeline/hybrid-search-pipeline
{
"phase_results_processors": [{
"normalization-processor": {
"normalization": {"technique": "min_max"},
"combination": {"technique": "arithmetic_mean", "parameters": {"weights": [0.3, 0.7]}}
}
}]
}POST /my-hybrid-index/_search?search_pipeline=hybrid-search-pipeline
{
"query": {
"hybrid": {
"queries": [
{"match": {"content": "search query"}},
{"neural": {"content_embedding": {"query_text": "search query", "model_id": "<model_id>", "k": 10}}}
]
}
}
}Ensure AOSS encryption at rest is enabled before indexing embeddings. Use SigV4 authentication for all operations.