LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

opensearch

open-source search and analytics engine derived from Elasticsearch 7

TLDR

Start OpenSearch
$ opensearch
copy
Start with specific config
$ opensearch -E path.data=[/data] -E path.logs=[/logs]
copy
Run as a daemon (background)
$ opensearch -d
copy
Check cluster health
$ curl -XGET "http://localhost:9200/_cluster/health?pretty"
copy
Index a document
$ curl -XPOST "http://localhost:9200/[index]/_doc" -H 'Content-Type: application/json' -d '{"field":"value"}'
copy

SYNOPSIS

opensearch [options]

DESCRIPTION

OpenSearch is an open-source search and analytics engine derived from Elasticsearch 7.10.2. It provides full-text search, logging, and analytics capabilities.OpenSearch includes OpenSearch Dashboards (forked from Kibana) for visualization.

PARAMETERS

-d

Run as a daemon (in the background).
-p file
Write the process ID to file.
-E setting=value
Set a configuration setting (e.g., -E cluster.name=myCluster).
-q, --quiet
Suppress normal output to stdout.
-v, --verbose
Enable verbose output.

CONFIGURATION

$ /etc/opensearch/opensearch.yml
/etc/opensearch/jvm.options
copy

REST API

$ # Create index
curl -XPUT "localhost:9200/myindex"

# Search
curl -XGET "localhost:9200/myindex/_search?q=field:value"

# Delete index
curl -XDELETE "localhost:9200/myindex"
copy

CAVEATS

Requires Java. Memory-intensive; configure heap size. Security plugin enabled by default.

HISTORY

OpenSearch was created by Amazon Web Services in 2021 as an open-source fork of Elasticsearch after Elastic changed its license.

SEE ALSO

Copied to clipboard
Kai