All Products
Search
Document Center

OpenSearch:Solr syntax conversion

Last Updated:Apr 01, 2026

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 constructOpenSearch equivalentNotes
INT, FLOAT, DOUBLE, LITERAL, TEXTINT, FLOAT, DOUBLE, LITERAL, TEXTSupported natively. Also supported: INT_ARRAY, FLOAT_ARRAY, DOUBLE_ARRAY, LITERAL_ARRAY, SHORT_TEXT.
LOCATIONTwo FLOAT or DOUBLE fieldsStore longitude and latitude as separate fields.
BOOLEANINTUse 0 for false and 1 for true.
DATEINTTimestamps in milliseconds. Fields pushed from a data source are converted automatically; fields pushed via API must be converted manually.
DynamicFieldSchema modificationDynamicField is not supported. OpenSearch lets you modify the application schema at any time, so add fields dynamically through the schema management interface instead.
CopyFieldMerge fields in advanceCopyField is not supported. Merge the source fields into a single field before indexing.
patternTokenizerCustom analyzer with \t delimiterSet the delimiter to \t. Convert any other delimiter in your source data before pushing.
Payload analyzerNot supported. No equivalent.
Bitwise analyzerNot supported. No equivalent.
Paoding analyzerChinese basic analyzerOpenSearch 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 parameterOpenSearch equivalentNotes
qquery clauseRequired. See q conversion rules for boolean operator mapping.
fqFilter fieldFilters 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.
flfetch_fields parameterDefines which fields to return.
hlSummary and HTML tag settingsConfigure in the OpenSearch console.
startstart in the config clauseEquivalent.
rowshit in the config clauseEquivalent.
wtformat in the config clauseEquivalent.
dfDefault query fieldEquivalent.
sortSort expressionfield desc-field; field asc+field; scoresort=RANK (sorts results in ascending order).
facetaggregate clauseThe field must have its index attribute configured. See Facet conversion rules.
groupdistinct clause + sort clausegroup is not supported. Use the distinct clause with the sort clause for simple grouping scenarios.
statsaggregate clauseSupported 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 queryOpenSearch queryExample
field:value (: operator)Not supportedUse filter fields for exact matches.
Range indexFiltered rangeConvert range queries to filter-based range expressions.
+AAThe + prefix is dropped.
-ANot supported
A AND BA AND BDirect equivalent.
A AND -BA ANDNOT B
A OR BA OR BDirect equivalent.
A OR +BA RANK B
A AND B OR CA AND B RANK CExample: Hongfushi AND Apple OR Shandong
A OR B AND CB AND C RANK AExample: Hongfushi OR Apple AND Shandong
A AND B OR +CA AND B AND CExample: Hongfushi AND Apple OR +Shandong
A OR +B AND CB AND C RANK AExample: Hongfushi OR +Apple AND Shandong
+A OR B AND CA AND B AND CExample: +Hongfushi OR Apple AND Shandong
A AND B OR -C(A AND B) ANDNOT CExample: Hongfushi AND Apple OR -Shandong
A AND -B OR CA ANDNOT B RANK CExample: Apple AND -Hongfushi OR Shandong
-A AND B OR CB ANDNOT A RANK CExample: -Hongfushi AND Apple OR Shandong
A OR B AND -CB ANDNOT C RANK AExample: Hongfushi OR Apple AND -Shandong
A OR -B AND CC ANDNOT B RANK AExample: Hongfushi OR -Shandong AND Apple
-A OR B AND C(B AND C) ANDNOT AExample: -Hongfushi OR Shandong AND Apple
A OR B OR -C(A OR B) ANDNOT CEquivalent regardless of operand order.
A AND B OR C AND DA AND B AND C AND D

Facet conversion rules

Solr parameterOpenSearch equivalentNotes
facet.fieldgroup_key in the aggregate clause
facet.limitmax_group in the aggregate clauseDefault: 1000.
facet.mincountNot supportedProcess all results manually and filter client-side.
facet.offsetNot supportedImplement pagination manually across all results.
facet.sortNot supportedSort all results manually.

Example:

# Solr
facet=true&facet.field=price&facet.limit=200

# OpenSearch
aggregate=group_key:price,agg_fun:count(),max_group:200

Limitations

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.