This page maps Solr schema types, query parameters, and search features to their OpenSearch equivalents, so you can migrate your Solr application without guessing.
Schema
OpenSearch supports various data types and analyzers. The following table lists how Solr schema constructs map to OpenSearch.
| Solr construct | OpenSearch equivalent | Notes |
|---|---|---|
INT, FLOAT, DOUBLE, LITERAL, TEXT | INT, FLOAT, DOUBLE, LITERAL, TEXT | Supported natively. Also supported: INT_ARRAY, FLOAT_ARRAY, DOUBLE_ARRAY, LITERAL_ARRAY, SHORT_TEXT. |
LOCATION | Two FLOAT or DOUBLE fields | Store longitude and latitude as separate fields. |
BOOLEAN | INT | Use 0 for false and 1 for true. |
DATE | INT | Timestamps in milliseconds. Fields pushed from a data source are converted automatically; fields pushed via API must be converted manually. |
DynamicField | Schema modification | DynamicField is not supported. OpenSearch lets you modify the application schema at any time, so add fields dynamically through the schema management interface instead. |
CopyField | Merge fields in advance | CopyField is not supported. Merge the source fields into a single field before indexing. |
patternTokenizer | Custom analyzer with \t delimiter | Set the delimiter to \t. Convert any other delimiter in your source data before pushing. |
Payload analyzer | — | Not supported. No equivalent. |
Bitwise analyzer | — | Not supported. No equivalent. |
Paoding analyzer | Chinese basic analyzer | OpenSearch provides a built-in Chinese basic analyzer with equivalent functionality. |
Field count limit: OpenSearch supports a maximum of 256 fields per application. If you need more, merge non-range-query fields into a single ARRAY-type field to reduce the total count.
Query parameters
The following table maps Solr query parameters to their OpenSearch equivalents.
| Solr parameter | OpenSearch equivalent | Notes |
|---|---|---|
q | query clause | Required. See q conversion rules for boolean operator mapping. |
fq | Filter field | Filters retrieved documents without affecting relevance scores. Use filter fields for non-fuzzy queries and query fields for fuzzy queries. Do not use fq together with sorting. |
fl | fetch_fields parameter | Defines which fields to return. |
hl | Summary and HTML tag settings | Configure in the OpenSearch console. |
start | start in the config clause | Equivalent. |
rows | hit in the config clause | Equivalent. |
wt | format in the config clause | Equivalent. |
df | Default query field | Equivalent. |
sort | Sort expression | field desc → -field; field asc → +field; score → sort=RANK (sorts results in ascending order). |
facet | aggregate clause | The field must have its index attribute configured. See Facet conversion rules. |
group | distinct clause + sort clause | group is not supported. Use the distinct clause with the sort clause for simple grouping scenarios. |
stats | aggregate clause | Supported functions: min, max, count, avg. Not supported: missing, sumOfSquares, mean, stddev, distinctValue, countDistinct. |
q conversion rules
The q parameter maps to the OpenSearch query clause. The following table lists how Solr boolean operators convert.
| Solr query | OpenSearch query | Example |
|---|---|---|
field:value (: operator) | Not supported | Use filter fields for exact matches. |
| Range index | Filtered range | Convert range queries to filter-based range expressions. |
+A | A | The + prefix is dropped. |
-A | Not supported | — |
A AND B | A AND B | Direct equivalent. |
A AND -B | A ANDNOT B | |
A OR B | A OR B | Direct equivalent. |
A OR +B | A RANK B | |
A AND B OR C | A AND B RANK C | Example: Hongfushi AND Apple OR Shandong |
A OR B AND C | B AND C RANK A | Example: Hongfushi OR Apple AND Shandong |
A AND B OR +C | A AND B AND C | Example: Hongfushi AND Apple OR +Shandong |
A OR +B AND C | B AND C RANK A | Example: Hongfushi OR +Apple AND Shandong |
+A OR B AND C | A AND B AND C | Example: +Hongfushi OR Apple AND Shandong |
A AND B OR -C | (A AND B) ANDNOT C | Example: Hongfushi AND Apple OR -Shandong |
A AND -B OR C | A ANDNOT B RANK C | Example: Apple AND -Hongfushi OR Shandong |
-A AND B OR C | B ANDNOT A RANK C | Example: -Hongfushi AND Apple OR Shandong |
A OR B AND -C | B ANDNOT C RANK A | Example: Hongfushi OR Apple AND -Shandong |
A OR -B AND C | C ANDNOT B RANK A | Example: Hongfushi OR -Shandong AND Apple |
-A OR B AND C | (B AND C) ANDNOT A | Example: -Hongfushi OR Shandong AND Apple |
A OR B OR -C | (A OR B) ANDNOT C | Equivalent regardless of operand order. |
A AND B OR C AND D | A AND B AND C AND D |
Facet conversion rules
| Solr parameter | OpenSearch equivalent | Notes |
|---|---|---|
facet.field | group_key in the aggregate clause | |
facet.limit | max_group in the aggregate clause | Default: 1000. |
facet.mincount | Not supported | Process all results manually and filter client-side. |
facet.offset | Not supported | Implement pagination manually across all results. |
facet.sort | Not supported | Sort all results manually. |
Example:
# Solr
facet=true&facet.field=price&facet.limit=200
# OpenSearch
aggregate=group_key:price,agg_fun:count(),max_group:200Limitations
Keep the following limitations in mind when migrating.
Deep pagination
OpenSearch provides two interfaces for retrieving results:
search: Standard queries. Returns up to 5,000 results with page turning supported (maximum 500 results per page).scroll: Data export. Exports tens of millions of records without sorting support. Use this for bulk data extraction and offline analysis.
Statistical result accuracy
OpenSearch uses sampling and estimation to maintain retrieval performance, so statistical results (such as facet counts) may not be exact.
Total result count
The total number of results is always an estimate, regardless of the actual dataset size.
Multiple OR operators
Query strings have a maximum encoded length of 1 KB. Queries with many OR operators may exceed this limit and return no results. To work around this:
Increase the query string length limit in your application configuration.
Split the query into multiple concurrent requests and merge the results.