For AI agents: this page is also available as Markdown at /docs/compat-opensearch.md. Every docs page is: add .md to its URL. llms.txt lists them all.
OpenSearch
WarpSearch supports OpenSearch Query DSL searches, aggregations, k-NN search and document APIs at https://api.warpsearch.io/compat/opensearch. An index is a WarpSearch collection; mappings are translated into collection schemas. The endpoint identifies itself as OpenSearch for client version checks, but implements the APIs and behavior described below rather than a full cluster.
You can also send a Query DSL body to POST /v1/search/{collection} with "language": "es". PPL pipelines run through the native search API with "language": "ppl".
#Support at a glance
| Area | Support |
|---|---|
| Search and count | _search, _msearch, _count, full-text queries and structured filters |
| Aggregations | Terms, histograms, ranges, metrics, geo and pipeline aggregations, with the limits below |
| Vector and hybrid search | knn queries, knn_vector mappings and inline rank-fusion pipelines |
| Collections and documents | Index creation, mappings, dynamic mapping, _bulk, document reads/writes and partial updates |
| Paging | from/size, field-sorted search_after, and emulated scroll without a snapshot |
| Several indices | Comma-separated lists, wildcard patterns, exclusions and _all; no index aliases |
| PPL | Native API with language: "ppl"; the OpenSearch _plugins/_ppl route is not served |
| Templates and ISM policies | Setup requests are acknowledged, but definitions are not stored or applied |
| Cluster management | Selected compatibility probes; no OpenSearch Dashboards, snapshots or lifecycle execution |
#Connect
Create an API key in the management console. Send it as Authorization: Bearer, Authorization: ApiKey or X-API-Key.
HTTP Basic also accepts the key as the password with username apikey or an empty username. Other usernames must match the actor associated with the key.
The base URL is https://api.warpsearch.io/compat/opensearch, port 443. Configure the base path as part of the URL or with your client’s path-prefix setting. Send the key as is in a header, or use the Basic-auth form above.
Client and tool connection settings
| Client or tool | Base URL setting | Key |
|---|---|---|
Python opensearch-py | hosts=[{"host": "api.warpsearch.io", "port": 443, "url_prefix": "compat/opensearch"}], use_ssl=True | headers={"Authorization": "Bearer ws_..."} |
JavaScript @opensearch-project/opensearch | node: "https://api.warpsearch.io/compat/opensearch" | headers: {Authorization: "Bearer ws_..."} |
Java opensearch-java | Host https://api.warpsearch.io plus .setPathPrefix("/compat/opensearch") on the transport builder | setDefaultHeaders |
Go opensearch-go | Addresses: []string{"https://api.warpsearch.io/compat/opensearch"}, without a trailing slash | Header: http.Header{"Authorization": {"Bearer ws_..."}} |
.NET OpenSearch.Client | new ConnectionSettings(new Uri("https://api.warpsearch.io/compat/opensearch")) | .GlobalHeaders(...) |
Ruby opensearch-ruby | url: "https://api.warpsearch.io/compat/opensearch" | transport_options: {headers: {Authorization: "Bearer ws_..."}} |
PHP opensearch-php | ->setHosts(["https://api.warpsearch.io/compat/opensearch"]) | A default Authorization header on the HTTP client |
Fluent Bit opensearch output | Host api.warpsearch.io, Port 443, tls On, Path /compat/opensearch, Suppress_Type_Name On | HTTP_User apikey, HTTP_Passwd ws_... |
| Grafana OpenSearch datasource | URL https://api.warpsearch.io/compat/opensearch | Custom header Authorization |
OpenSearchTransport transport = ApacheHttpClient5TransportBuilder
.builder(HttpHost.create("https://api.warpsearch.io"))
.setPathPrefix("/compat/opensearch")
.setDefaultHeaders(new Header[] {
new BasicHeader("Authorization", "Bearer ws_...")})
.build();
OpenSearchClient client = new OpenSearchClient(transport);
from opensearchpy import OpenSearch
client = OpenSearch(
hosts=[{"host": "api.warpsearch.io", "port": 443, "url_prefix": "compat/opensearch"}],
use_ssl=True,
headers={"Authorization": "Bearer ws_..."},
)
client.search(index="books", body={"query": {"match": {"title": "dune"}}})
curl -s https://api.warpsearch.io/compat/opensearch/books/_search \
-H "Authorization: Bearer ws_..." \
-H "Content-Type: application/json" \
-d '{"query": {"match": {"title": "dune"}}}'
The Java builder's path-prefix and header options and Python's connection options configure the gateway URL and authentication. typed_keys is ignored, so typed Java aggregation responses may not deserialize; use raw JSON or a low-level client for aggregations.
#Endpoints
Paths below are relative to https://api.warpsearch.io/compat/opensearch.
| Endpoint | Behavior |
|---|---|
GET / | Compatibility version probe: version.distribution: opensearch, version 2.19.0 |
GET /_plugins/_security/authinfo | Caller identity and roles; the older /_opendistro/_security/authinfo path also works |
GET, POST /{index}/_search, /_search | Search one or several indices; the index-less form searches visible collections |
GET, POST /_msearch, /{index}/_msearch | NDJSON searches; the header's index may be a name, comma-separated list or array |
GET, POST /{index}/_count, /_count | Exact count |
PUT, GET, HEAD, DELETE /{index} | Create, inspect, check existence or delete a collection |
GET, PUT, POST /{index}/_mapping | Read mappings or add fields |
POST, PUT /_bulk, /{index}/_bulk | index, create, delete, and partial update actions |
PUT, POST /{index}/_doc/{id}, POST /{index}/_doc | Index a document; omit the ID to generate one |
PUT, POST /{index}/_create/{id} | Create with a non-atomic existence check |
GET, HEAD /{index}/_doc/{id}, GET /{index}/_source/{id} | Read a committed document |
DELETE /{index}/_doc/{id} | Delete by ID |
GET, POST /_mget, /{index}/_mget | Read several documents |
POST /{index}/_update/{id} | Merge doc fields; supports doc_as_upsert and upsert, without scripts |
GET, POST /_search/scroll; DELETE /_search/scroll | Continue or clear an emulated scroll |
GET, POST /{index}/_refresh | Publish pending writes and build eligible approximate vector indexes |
POST /{index}/_forcemerge | Merge segments and build eligible approximate vector indexes |
Use explicit index names when refreshing after a load. POST /_refresh and POST /_all/_refresh are no-ops. A refresh that is still running returns 202; repeat the refresh until it completes. Selected _cluster, _nodes, _cat and _stats routes provide compatibility responses, not cluster administration. Unimplemented routes return 404.
#Query DSL and aggregations
| Query family | Support and limits |
|---|---|
| Full text | match, match_phrase, match_bool_prefix, multi_match, query_string, simple_query_string |
| Phrase prefix | A one-word match_phrase_prefix is exact; several words use a phrase plus a prefix anywhere in the field, with a warning |
| Structured filters | term, terms, ids, exists, range; date math and time zones in ranges |
| Pattern and fuzzy matching | prefix, wildcard, regexp, fuzzy; extended regex operators ~ & @ # <n-m> are unsupported |
| Boolean and scoring | bool, constant_score, boosting, dis_max, and function_score with weights, field values, decays and random scoring; no general scripts |
| Geo | Distance, bounding box, polygon and inline shape queries; see Geo search |
| Result options | post_filter, min_score, field sorting, collapse with inner_hits, source filtering and highlighting |
simple_query_string field boosts are ignored with a warning. Field patterns other than * in multi_match and query_string are unsupported. Scores and some analysis behavior differ from OpenSearch; compare relevance on your own queries before switching traffic.
| Aggregation family | Support and limits |
|---|---|
| Buckets | terms, histogram, date_histogram, auto_date_histogram, range, date_range, filter, filters, global |
| Metrics | avg, sum, min, max, value_count, stats, extended_stats on fields |
| Approximate metrics | cardinality, percentiles, percentile_ranks; percentiles use t-digest, not HDR |
| Per-bucket documents | top_hits |
| Geo | Grid buckets, distance ranges, bounds and centroid; see Geo aggregations |
| Pipelines | Bucket metrics, derivatives, cumulative sums, moving functions, bucket_sort, bucket_script, bucket_selector; scripts are restricted expressions, not general Painless |
| Advanced buckets | multi_terms and composite depend on enabled aggregation capabilities; unsupported combinations are rejected |
Bucket sizes and ordering are subject to plan and aggregation limits. Pipeline aggregations operate on the buckets returned by their parent, so a parent's size can truncate their input. See Facets and aggregations for examples.
#Mappings and analysis
Create mappings with PUT /{index} and add fields with PUT /{index}/_mapping. OpenSearch-created collections support dynamic mapping. dynamic: false drops unmapped fields; dynamic: strict rejects them. date_detection, numeric_detection and supported dynamic_templates control inference. Changes that would break existing data return 409.
Supported mapping types include text, keyword, integer and floating-point types, scaled_float, boolean, ip, date, date_nanos, geo_point, geo_shape and knn_vector. Multi-fields, copy_to and field aliases work. An alias names an existing field for queries; documents cannot write to it. Index aliases are not supported.
Mapped scalar fields can hold arrays and are returned as lists even when written with one value. Vector fields accept one vector or an array of vectors; k-NN scores a document by its closest vector. _source is rebuilt from stored fields, so it is not the original JSON: dates return as epoch milliseconds, geo points as [lon, lat] and shapes as GeoJSON. See Schemas and field types, including nested document limits.
Custom analyzers in settings.analysis and language analyzers are translated to WarpSearch analyzers. Supported components include synonyms, n-grams, shingles, word delimiters, patterns, phonetic encoders, ICU, kuromoji, nori, phone and phone-search. smartcn maps to jieba, and polish and ukrainian to Snowball, with warnings. A field's separate search_analyzer is not applied; queries use its field analyzer, with a warning. Unsupported analysis components may be dropped with warnings; synonyms_path is rejected. See Languages and text analysis.
#PPL
PPL is supported through POST /v1/search with "language": "ppl". Use WarpSearch's pipeline syntax, starting with FROM; this is not a claim of complete OpenSearch PPL syntax compatibility. The account must have the pipelines feature enabled and read access to every source collection.
curl -s https://api.warpsearch.io/v1/search \
-H "Authorization: Bearer ws_..." \
-H "Content-Type: application/json" \
-d '{
"language": "ppl",
"query": "FROM logs | WHERE status_i >= 400 | STATS count() AS events BY host_s | SORT events DESC | LIMIT 20"
}'
The example assumes logs has status_i and host_s fields. Supported stages include FROM, SEARCH, WHERE, EVAL, KEEP, DROP, RENAME, STATS, SORT, LIMIT/OFFSET, inner/left/semi/anti JOIN, UNION ALL, EXPAND and PARSE_JSON. STATS supports count, count_distinct, sum, avg, min and max. Use vars for scalar parameters. Put filtering, sorting, paging and aggregation in the pipeline, rather than the native request's separate filters, sort or limit fields.
Results use the native search response: rows are hits keyed by column name, with a columns list of types. Add ?format=csv for a table. Execution is bounded by row, group, memory and request limits; a final LIMIT does not reduce the input needed by an earlier aggregation. There is no streaming cursor or unbounded aggregation. See PPL: pipe query language for the stage reference and more examples.
The OpenSearch plugin route /_plugins/_ppl is not served. Clients that call it must use the native API above. Likewise, /_plugins/_sql is not served; SQL queries use the native API as described in SQL and PostgreSQL.
#k-NN search
Create an index with a knn_vector field and index.knn: true. This small example uses three dimensions; use your embedding model’s dimension in both the mapping and every vector:
PUT /products
{
"settings": {"index": {"knn": true}},
"mappings": {
"properties": {
"title": {"type": "text"},
"in_stock": {"type": "keyword"},
"embedding": {
"type": "knn_vector",
"dimension": 3,
"method": {"name": "hnsw", "space_type": "cosinesimil"}
}
}
}
}
After indexing documents, query POST /products/_search with the OpenSearch knn query:
{
"size": 10,
"query": {
"knn": {
"embedding": {
"vector": [0.12, -0.03, 0.88],
"k": 10,
"filter": {"term": {"in_stock": "yes"}},
"method_parameters": {"ef_search": 100, "nprobes": 8}
}
}
}
}
| OpenSearch parameter | Behavior |
|---|---|
k | Bounded by your plan's result window |
filter | Applied inside the vector search, so it narrows candidates before ranking |
method_parameters.ef_search | Candidate-effort input, at least k and at most 10000; translated to a larger full-precision rescoring pool capped at 10000 |
method_parameters.nprobes | Search effort on approximate indexes |
rescore.oversample_factor | Widens the rescoring pool |
dimension | Up to 8192 |
ivf and exact (extensions) | Tune recall, or force a full scan for ground truth |
A knn_vector mapping with method.name of hnsw or ivf requests a WarpSearch IVF approximate index. It does not build an HNSW graph. Refreshes and force merges build indexes for eligible segments, and merges can build them during ingestion. Small segments or segments without an approximate index use exact scans. Other build parameters (m, ef_construction, engine, nlist, encoders, mode, compression_level) are accepted and reported as warnings.
index.knn: true is accepted without a warning. Other index.knn.* settings are accepted with warnings and have no effect. Query-time parameters above control search effort.
knn_vector supports data_type: "float", "byte" and "binary". Binary vectors use space_type: "hamming", require a dimension divisible by eight, and always use exact scans.
A knn query combined with other scoring clauses in a bool, several knn clauses, or a boost produce hybrid search. A document matches if any clause does, and its score is the sum of the clause scores times their boosts. kNN scores are WarpSearch similarity scores, not OpenSearch's. See Vector search and Hybrid search.
Not supported: radial-search parameters (
max_distanceormin_scoreinsideknn, even withk),neuralandneural_sparsequeries, thehybridquery with a stored search pipeline (send the pipeline definition in thesearch_pipelinebody key instead, see Hybrid search), and k-NN searches over nested vectors. Requests that use them fail with400andunsupported_feature. Compute embeddings in your application and send the vector.
#Write semantics
_bulk reports each item's result separately. Overloaded items return 429 so clients can retry just those items. Unknown indices are created on first write only if the key may create collections.
- Writes become searchable according to the collection's durability and commit settings. Use
refresh=true,refresh=wait_for, or a named_refreshafter a load. Check warnings and202responses when a commit is still running. See Consistency and durability. createchecks committed documents for an existing ID and returns409when found. The check and write are not atomic: concurrent creates or uncommitted writes can still overwrite an ID.- Document gets read committed data.
_versionis always1; indexing reportscreatedeven when replacing an ID, and deleting a missing ID succeeds. _updateand bulkupdatemergedocfields, withdoc_as_upsertorupsertfor missing documents. These are read-modify-write operations without atomic cross-instance concurrency control. See Partial updates.- Atomic version/sequence-number conditions and scripted updates are unsupported.
_delete_by_querycurrently returnsunsupported_feature; use delete by ID.
#Paging and several indices
Use from/size within the result window, or search_after with supported field sorts and the last hit's sort values. Scroll reruns the search for each page using offsets: it does not hold a snapshot, and intervening writes can repeat or skip hits. Point in time and slices are unsupported. See Paging.
Name indices as books,articles/_search, use patterns such as logs-*, or supply an _msearch header such as {"index": ["books", "articles"]}. Patterns, exclusions and _all resolve against collections visible to the caller. At most 20 index searches may run per request, counting all searches in _msearch and any additional suggester searches.
Hits are merged by sort values or per-index scores; each hit's _index identifies its collection. Totals and bucket counts are summed. Averages are weighted by per-index hit counts, with a warning. Cardinality and percentile merging depend on support for mergeable aggregation states: without it, cardinalities are summed as an upper bound with a warning, and multi-index percentiles are rejected. Truncated terms buckets can affect merged counts. Multi-index collapse, rank fusion and top_hits are unsupported.
#Ingest tools
Tools can write through _bulk using the OpenSearch base URL, a collection name as the index, and an API-key header or Basic credentials (apikey as username, the key as password). For example, Fluent Bit's OpenSearch output supports the path prefix and Basic authentication:
[OUTPUT]
Name opensearch
Match *
Host api.warpsearch.io
Port 443
tls On
Path /compat/opensearch
Index logs
HTTP_User apikey
HTTP_Passwd ws_...
Suppress_Type_Name On
Create the collection with the desired mapping before ingesting. Shippers may make startup probes or try to install templates, ISM policies and ingest pipelines. Template and ISM setup APIs acknowledge requests without storing or applying definitions; ingest pipelines are not executed. Disable automatic setup that depends on these features. Test your shipper version with a small batch and inspect per-item bulk errors and warnings before moving production traffic.
#Grafana
Configure Grafana's OpenSearch datasource with the OpenSearch base URL and a custom Authorization: Bearer ws_... header. Use the collection as the index and its mapped date field as the time field for Query DSL logs and metrics panels. Datasource modes that call the PPL plugin route cannot use that route here; use the native PPL API for pipelines.
#Errors and limitations
Unsupported query features generally return 400 with an OpenSearch-shaped error:
{"error": {"type": "unsupported_feature", "reason": "..."}, "status": 400}
Unknown query or aggregation names return query_error; unimplemented routes return 404. Approximations and ignored options can return Warning: 299 headers. Log these while testing. Search limits, bucket sizes, request sizes and rate limits still apply; see Limits and errors.
track_total_hits: true requests an exact total; a positive integer requests a bounded total. Inspect hits.total.relation rather than assuming every count is exact. typed_keys and rest_total_hits_as_int are ignored with warnings.
The following remain unsupported:
neural,neural_sparse,template,common, span queries,intervals,more_like_this,terms_set, general rescoring andpercolatequeries. Use the Match API for reverse search.- Stored search pipelines. An inline
search_pipelinewith ascore-ranker-processorworks withhybrid; see Hybrid search. - Derived fields,
runtime_mappings,script_fields, general document scripts, join-field mappings,flattenedandcompletionmappings. - Index aliases,
_update_by_query,_reindex, ingest-pipeline execution and atomic conditional writes. - OpenSearch Dashboards, ISM execution, alerting, snapshots, cross-cluster search, ML Commons, and security plugin APIs other than caller identity. Data streams map to one ordinary collection without backing-index rollover.
#Cost compared with managed and serverless OpenSearch
WarpSearch bills per GB stored, per GB written and per request, with no nodes or OCUs to keep awake. For line-by-line monthly costs on the same workloads, see managed OpenSearch pricing (Amazon OpenSearch Service domains) and OpenSearch Serverless pricing.
#Highlighting
The standard highlight object is supported on search and multi-search requests, including hybrid queries. See Highlighting for options, response shapes and the stored-offset field configuration.