All Products
Search
Document Center

OpenSearch:config clause

Last Updated:Apr 01, 2026

The config clause controls pagination, response format, and ranking scope for search results.

Parameters

ParameterTypeRequiredValid valueDefaultDescription
startINTNo[0, 5000]0Offset of the first document to return.
hitINTNo[0, 500]10Maximum number of documents per result set.
formatSTRINGNoJSON, fullJSONJSONResponse format. fullJSON includes two additional fields: variableValue and sortExprValues.
rerank_sizeINTNo[0, 2000]200Number of documents passed to the fine sort expression.
total_rank_sizeINTNoNumber of documents passed to the rough sort expression.
default_operatorSTRINGNoAND, ORANDDefault query operator. Supported only for exclusive instances.

Usage notes

  1. The config clause is optional.

  2. Separate key-value pairs with commas (,). Separate each key and value with a colon (:).

  3. The sum of start and hit must not exceed 5,000. Queries that exceed this limit return an error with no results. This limit exists because retrieving deep result windows requires loading all preceding documents into memory, which increases resource usage significantly. To paginate beyond 5,000 documents, use a scroll search instead.

  4. default_operator is supported only for exclusive instances.

  5. total_rank_size uses different syntax depending on your SDK:

    • Java SDK: config.addToCustomConfig("total_rank_size:200000");

    • PHP SDK: $params->setCustomConfig('total_rank_size', 200000);

  6. To include sort details in the response, add format:fulljson to the config clause. The sortExprValues field in the response is an array of sort field values corresponding to the sort clause. For example, with sort=-price;-RANK, sortExprValues returns [price, Document score]. If no sort clause is configured, sortExprValues returns the document score by default.

Response format: JSON vs fullJSON

FieldJSONfullJSON
Standard result fieldsYesYes
variableValueYes
sortExprValuesYes

Use fullJSON when you need to inspect per-document sort scores or variable expression values — for example, when debugging ranking behavior.

Examples

Paginate results — 20 documents per page

# Page 1
config=start:0, hit:20, format:xml

# Page 2
config=start:20, hit:20, format:xml
The source document uses format:xml in this paging example. However, the Parameters table lists only JSON and fullJSON as supported format values. This inconsistency exists in the original source and is flagged for product team review.

Set the fine sort candidate pool to 1,000 documents

config=start:0, hit:20, rerank_size:1000

Limit rough sort to 100 documents

config=start:0, hit:20, total_rank_size:100

What's next

  • Scroll searches — retrieve more than 5,000 documents across multiple pages