Skills2026年4月13日·1 分钟阅读

OpenSearch — Community-Driven Search and Analytics Suite

OpenSearch is an open-source search and analytics suite forked from Elasticsearch 7.10. It provides full-text search, log analytics, observability, and security analytics — all under the Apache-2.0 license with no feature restrictions.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
step-1.md
先审查命令
npx -y tokrepo@latest install 8d537661-3734-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
OpenSearch provides full-text search, log analytics, and observability under Apache-2.0 with no feature restrictions.
§01

What it is

OpenSearch is an open-source search and analytics suite forked from Elasticsearch 7.10. It provides full-text search, log analytics, observability dashboards, and security analytics. The project is maintained by AWS and the open-source community under the Apache-2.0 license with no feature gating.

OpenSearch targets engineering teams who need a search engine, log aggregator, or observability platform without vendor lock-in or license restrictions. It is a direct alternative to Elasticsearch for teams concerned about Elastic's licensing changes.

§02

How it saves time or tokens

OpenSearch is a drop-in replacement for Elasticsearch 7.10 workloads. Teams migrating from Elasticsearch can reuse existing indices, queries, and client libraries with minimal changes. The migration path avoids rewriting application code.

OpenSearch Dashboards (the Kibana fork) provides built-in visualization, alerting, and anomaly detection. Instead of assembling separate tools for search, logging, and monitoring, OpenSearch consolidates them into one platform.

§03

How to use

  1. Run OpenSearch with Docker:
docker run -d --name opensearch \
  -p 9200:9200 -p 9600:9600 \
  -e 'discovery.type=single-node' \
  -e 'DISABLE_SECURITY_PLUGIN=true' \
  opensearchproject/opensearch:latest
  1. Index a document:
curl -X POST 'localhost:9200/products/_doc' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Widget", "price": 29.99, "tags": ["electronics"]}'
  1. Search:
curl 'localhost:9200/products/_search?q=widget'
§04

Example

Full-text search with filters and aggregations:

curl -X POST 'localhost:9200/products/_search' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": {
      "bool": {
        "must": { "match": { "name": "widget" } },
        "filter": { "range": { "price": { "lte": 50 } } }
      }
    },
    "aggs": {
      "avg_price": { "avg": { "field": "price" } },
      "by_tag": { "terms": { "field": "tags.keyword" } }
    }
  }'

This finds products matching 'widget' under $50, then aggregates average price and tag distribution.

§05

Related on TokRepo

§06

Common pitfalls

  • OpenSearch 2.x diverges from Elasticsearch's API in some areas. Client libraries that target Elasticsearch 8.x may not work. Use the official OpenSearch client libraries for full compatibility.
  • Running OpenSearch in production requires tuning JVM heap size, shard count, and replica settings. The defaults work for development but are not suitable for production workloads.
  • The security plugin is enabled by default and requires TLS certificates. For local development, disable it with the environment variable shown above. Never disable security in production.

常见问题

Is OpenSearch compatible with Elasticsearch?+

OpenSearch is compatible with Elasticsearch 7.10 APIs and index formats. Most Elasticsearch 7.x client libraries, queries, and index configurations work without changes. Compatibility with Elasticsearch 8.x features is not guaranteed as the projects have diverged.

Who maintains OpenSearch?+

OpenSearch is maintained by AWS and the open-source community under the Apache-2.0 license. AWS provides managed OpenSearch Service, but the open-source project runs independently on any infrastructure.

Can OpenSearch replace the ELK stack?+

Yes. OpenSearch plus OpenSearch Dashboards replaces Elasticsearch plus Kibana. For log ingestion, you can use Logstash, Fluentd, or Data Prepper (OpenSearch's own ingestion tool). The result is a functionally equivalent stack under an open-source license.

How does OpenSearch handle security?+

OpenSearch includes a built-in security plugin that provides TLS encryption, role-based access control, audit logging, and multi-tenancy. Unlike Elasticsearch, where some security features require a paid license, all security features in OpenSearch are free.

What is OpenSearch Dashboards?+

OpenSearch Dashboards is the visualization layer, forked from Kibana 7.10. It provides search interfaces, log explorers, dashboards, alerting, and anomaly detection. It connects to OpenSearch the same way Kibana connects to Elasticsearch.

引用来源 (3)

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产