The config clause is a required part of every query statement. Use it to control query behavior at runtime — including pagination, output format, timeouts, and ranking.
Syntax
config=key1:value1,key2:value2,...Separate each parameter name and value with a colon (:). To set multiple parameters, chain them with commas.
Parameters
Parameters are grouped by function. For most queries, you only need the pagination and output parameters.
Pagination
| Parameter | Default | Description |
|---|---|---|
start | 0 | The zero-based offset of the first document to return. The sum of start and hit must not exceed 5,000; exceeding this limit returns an error with no results. |
hit | 10 | The maximum number of documents to return per result set. The sum of start and hit must not exceed 5,000; exceeding this limit returns an error with no results. |
Output format
| Parameter | Valid values | Default | Description |
|---|---|---|---|
format | json, xml | xml | The format of the query results. |
no_summary | yes, no | no | If set to yes, only the first-phase query runs and the summary is not fetched. Use this to reduce latency when you don't need document summaries. |
fetch_summary_type | docid, pk, rawpk | docid | The method used to fetch the summary. docid fetches by document ID. pk fetches by the hash value of the primary key. rawpk fetches by the original primary key value. We recommend that you use pk or rawpk. |
Timeout and performance
| Parameter | Default | Description |
|---|---|---|
timeout | 0 | The query timeout in milliseconds. Must be a non-negative number. When set, seek_timeout defaults to timeout × 0.7 unless you set seek_timeout explicitly. |
seek_timeout | 0 | The timeout for the query seeking phase, in milliseconds. Defaults to timeout × 0.7. Set this explicitly to override the derived value. |
searcher_return_hits | 0 | The number of records returned by the searcher. When set to 0, the value is determined by start and hit. Cannot exceed 5,000. |
research_threshold | 0 | If the number of returned records is less than this value, the query runs again. |
Default query settings
| Parameter | Valid values | Default | Description |
|---|---|---|---|
default_index | STRING | "" | The default index for this query. Falls back to the index set in query_config in the cluster configuration file. An index specified in the query itself takes precedence. |
default_operator | AND, OR | "" | The default logical operator for this query. Falls back to the operator set in query_config in the cluster configuration file. An operator specified in the query takes precedence. |
Deduplication and replica selection
| Parameter | Valid values | Default | Description |
|---|---|---|---|
dedup | yes, no | yes | When set to yes, duplicate documents are automatically removed from results based on the primary key. When set to no, duplicates are not removed from the result. |
sourceid | STRING | (none) | Pins the query to a specific replica selected by the hash of this value. Users with the same sourceid value always query the same replica, which ensures they see the latest data during incremental index updates. When not set, a replica is selected randomly for each query. |
Ranking and scoring
| Parameter | Default | Description |
|---|---|---|
rerank_hint | false | Specifies whether to run the second scoring (rerank) pass. Set to true to enable reranking. |
rank_size | 0 | The number of documents included in the rough sort pass, or the truncation count for dynamic indexing. When set to 0, the value from the cluster configuration file is used. |
rerank_size | 0 | The number of documents passed to the fine sort pass. When set to 0, the value from the cluster configuration file is used. |
total_rank_size | 0 | The total number of roughly sorted documents across all partitions, or the truncation count for a dynamic index. When set to 0, the value from the cluster configuration file is used. |
total_rerank_size | 0 | The total number of finely sorted documents across all partitions. When set to 0, the value from the cluster configuration file is used. |
rank_trace | (none) | The verbosity level of front-end scoring output. Valid values: FATAL, ERROR, INFO, DEBUG, WARN, TRACE1, TRACE2, TRACE3. |
actual_hits_limit | 0 | Controls whether totalhits in the response is an exact count or an estimate. If the actual number of matching documents is less than this value, the exact count is returned. If it is greater, an estimate is returned. If the actual number is 0, the estimated count is returned. Setting this to numeric_limits<uint32_t>::max() always returns the exact count. |
Examples
Implement pagination
Fetch 20 documents per page. Increment start by 20 for each subsequent page.
# Page 1
config=start:0,hit:20,format:xml
# Page 2
config=start:20,hit:20,format:xmlControl fine sort size
Pass 1,000 documents to the fine sort pass:
config=start:0,hit:20,rerank_size:1000Set query timeout
Set a 500 ms query timeout. The seeking phase will automatically use 350 ms (500 × 0.7):
config=start:0,hit:20,timeout:500To override the seeking timeout explicitly:
config=start:0,hit:20,timeout:500,seek_timeout:400Usage notes
Separate each parameter name and value with a colon (
:).The sum of
startandhitmust not exceed 5,000. Exceeding this limit returns an error with no results.