IntermediateVector Database12 min read

Connect OpenSearch to Gateco

Connect OpenSearch (self-hosted or Amazon OpenSearch Service) to Gateco. Covers k-NN plugin, hybrid vector+BM25 search, and identity-aware RAG access control.

Last updated: May 27, 2026

Prerequisites

  • OpenSearch 2.9+ with the k-NN plugin enabled (included by default in all distributions)
  • Admin credentials or a user with index-level read/write access

Overview — 4 steps

  1. 1Verify k-NN plugin
  2. 2Create an index with a knn_vector field
  3. 3Add the connector in Gateco
  4. 4Configure search settings

OpenSearch is a community-driven search and analytics suite with strong BM25 full-text search and k-NN approximate nearest neighbor search via the k-NN plugin. Gateco connects to OpenSearch as a Tier 2 connector, supporting vector, keyword, hybrid, and grep search — adding identity-aware retrieval and RAG access control policies on top of your existing indexes.

Step 1 — Verify the k-NN plugin

bash
curl -s -u admin:admin http://localhost:9200/_cat/plugins?v | grep knn

You should see a row for opensearch-knn. If not, install OpenSearch 2.9+ from opensearch.org — the k-NN plugin is included.

Step 2 — Create an index with a knn_vector field

bash
curl -s -u admin:admin -XPUT http://localhost:9200/my-docs \
  -H 'Content-Type: application/json' -d '
{
  "settings": { "index.knn": true },
  "mappings": {
    "properties": {
      "embedding": {
        "type": "knn_vector",
        "dimension": 1536,
        "method": { "name": "hnsw", "space_type": "cosinesimil", "engine": "lucene" }
      },
      "content": { "type": "text" },
      "doc_id": { "type": "keyword" }
    }
  }
}'

Use space_type: "cosinesimil" for cosine similarity (recommended for semantic search). Use "l2" for Euclidean distance. The engine can be "lucene", "nmslib", or "faiss" — "lucene" is available on all OpenSearch distributions.

Step 3 — Add the connector in Gateco

  1. Navigate to Connectors → Add connector → OpenSearch.
  2. Enter your OpenSearch endpoint URL.
  3. Enter username and password (or leave blank if security plugin is disabled).
  4. Click Test connection.
  5. Click Save.
FieldExampleDescription
urlhttps://search-my-domain.us-east-1.es.amazonaws.comOpenSearch cluster endpoint
index_namemy-docsIndex containing vector embeddings
vector_fieldembeddingField with type knn_vector
content_fieldcontentText field for keyword/hybrid/grep search
usernameadminOpenSearch username (leave blank if security disabled)
passwordyour-passwordOpenSearch password

Step 4 — Configure search settings

After saving the connector, configure search settings:

  1. Click your OpenSearch connector → Search config.
  2. Set the Index name, Vector field, and Content field.
  3. For hybrid search, the default alpha of 0.5 provides equal vector and keyword weight.
  4. Save.

OpenSearch supports substring and regex grep search. Patterns are validated server-side (max 200 chars, no nested quantifiers). Regex grep uses OpenSearch Lucene regex syntax.

Troubleshooting

ErrorCauseFix
index_not_found_exceptionWrong index nameCheck the exact index name in OpenSearch Dashboard → Index Management
mapper_parsing_exception: knn_vectork-NN plugin not activeRun GET /_cat/plugins and verify opensearch-knn is installed
security_exception: 403User lacks index permissionsGrant index-level indices:data/read/* permissions to the OpenSearch user

Frequently asked questions

Does Gateco work with Amazon OpenSearch Service?

Yes. Enter your Amazon OpenSearch Service domain endpoint (e.g. https://search-my-domain-abc123.us-east-1.es.amazonaws.com) as the URL. Use an IAM-mapped user with HTTP Basic auth (fine-grained access control), or configure AWS SigV4 signing if you need IAM role-based authentication. For most deployments, a dedicated OpenSearch internal user with index-level permissions is simpler.

How does OpenSearch hybrid search work in Gateco?

OpenSearch does not have a single alpha parameter for hybrid search. Gateco emulates hybrid search by combining a knn query (boosted by alpha × 10) and a match query (boosted by (1 − alpha) × 10) inside a bool.should query. This produces comparable ranking to engines with native hybrid alpha (e.g. Weaviate, Qdrant) but the weighting is approximate. Default alpha is 0.5 (equal weight).

Can I connect Gateco to an Elasticsearch cluster?

Gateco targets the OpenSearch API, which is based on the Elasticsearch 7.10 fork. If your Elasticsearch cluster is version 7.x and has the vector search plugin enabled, it may work. Elasticsearch 8.x uses a different API for dense_vector and k-NN — not supported in the current release. For Elasticsearch 8+, an Elastic-native connector is on the roadmap.

Ready to add policy-aware retrieval?

Connect your OpenSearch setup to Gateco in under 5 minutes.