Skip to content

Commit 3a0c657

Browse files
authored
Add default/optional tables to common-query-parameters.adoc (#2340)
1 parent 7c45162 commit 3a0c657

File tree

1 file changed

+106
-29
lines changed

1 file changed

+106
-29
lines changed

solr/solr-ref-guide/modules/query-guide/pages/common-query-parameters.adoc

Lines changed: 106 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,24 @@ Several query parsers share supported query parameters.
2020

2121
The following sections describe Solr's common query parameters, which are supported by the xref:configuration-guide:requesthandlers-searchcomponents.adoc#search-handlers[search request handlers].
2222

23+
2324
== defType Parameter
2425

25-
The defType parameter selects the query parser that Solr should use to process the main query parameter (`q`) in the request.
26-
For example:
26+
[%autowidth,frame=none]
27+
|===
28+
|Optional |Default: `lucene`
29+
|===
2730

28-
`defType=dismax`
31+
The `defType` parameter selects the xref:query-syntax-and-parsers.adoc[query parser] to process the main query parameter (`q`) in the request. Acceptable values include: `lucene` (xref:standard-query-parser.adoc[]), `dismax` (xref:dismax-query-parser.adoc[]), `edismax` (xref:edismax-query-parser.adoc[]), or one of the xref:query-syntax-and-parsers.adoc[other query parsers].
2932

30-
If no `defType` parameter is specified, then by default, the xref:standard-query-parser.adoc[] is used.
31-
(e.g., `defType=lucene`)
3233

3334
== sort Parameter
3435

36+
[%autowidth,frame=none]
37+
|===
38+
|Optional |Default: `score desc`
39+
|===
40+
3541
The `sort` parameter arranges search results in either ascending (`asc`) or descending (`desc`) order.
3642
The parameter can be used with either numerical or alphabetical content.
3743
The directions can be entered in either all lowercase or all uppercase letters (i.e., both `asc` and `ASC` are accepted).
@@ -77,43 +83,59 @@ Users looking to avoid this behavior can define an additional sort criteria on a
7783

7884
== start Parameter
7985

80-
When specified, the `start` parameter specifies an offset into a query's result set and instructs Solr to begin displaying results from this offset.
86+
[%autowidth,frame=none]
87+
|===
88+
|Optional |Default: `0`
89+
|===
8190

82-
The default value is `0`.
83-
In other words, by default, Solr returns results without an offset, beginning where the results themselves begin.
91+
The `start` parameter specifies an offset into a query's result set and instructs Solr to begin displaying results from this offset.
8492

85-
Setting the `start` parameter to some other number, such as `3`, causes Solr to skip over the preceding records and start at the document identified by the offset.
93+
In other words, setting the `start` parameter to a number other than 0, such as 3, causes Solr to skip over the first 3 records and start at the document identified by the offset.
8694

8795
You can use the `start` parameter this way for paging.
8896
For example, if the `rows` parameter is set to 10, you could display three successive pages of results by setting start to 0, then re-issuing the same query and setting start to 10, then issuing the query again and setting start to 20.
8997

9098
== rows Parameter
9199

92-
You can use the `rows` parameter to paginate results from a query.
93-
The parameter specifies the maximum number of documents from the complete result set that Solr should return to the client at one time.
100+
[%autowidth,frame=none]
101+
|===
102+
|Optional |Default: `10`
103+
|===
94104

95-
The default value is `10`.
96-
That is, by default, Solr returns 10 documents at a time in response to a query.
105+
The `rows` parameter specifies the number of documents from the complete result to return in the response.
106+
You can use the `rows` parameter to paginate results from a query.
97107

98108
== canCancel Parameter
99109

100-
This parameter defines if this query is cancellable during execution using the
110+
[%autowidth,frame=none]
111+
|===
112+
|Optional |Default: `false`
113+
|===
114+
115+
The `canCancel` parameter specifies if the query can be cancelled during its execution using the
101116
xref:deployment-guide:task-management.adoc[task management] interface.
102117

103118
== queryUUID Parameter
104119

105-
For cancellable queries, this allows specifying a custom UUID to identify the query with.
106-
If `canCancel` is specified and `queryUUID` is not set, an auto generated UUID will be assigned to the query.
120+
[%autowidth,frame=none]
121+
|===
122+
|Optional |Default: none
123+
|===
124+
125+
For cancellable queries, the `queryUUID` parameter allows specifying a custom UUID to identify the query with. Otherwise an auto-generated UUID will be assigned.
107126

108-
If `queryUUID` is specified, this UUID will be used for identifying the query.
109-
Note that if using `queryUUID`, the responsibility of ensuring uniqueness of the UUID lies with the caller.
110-
If a query UUID is reused while the original query UUID is still active, it will cause an exception to be throws for the second query.
127+
When using `queryUUID`, the responsibility of ensuring uniqueness of the UUID lies with the caller.
128+
If a query UUID is reused while the original query UUID is still active, it will cause an exception to be thrown for the second query.
111129

112-
It is recommended that the user either uses all custom UUIDs or depends completely on the system to generate UUID.
113-
Mixing the two can lead to conflict of UUIDs.
130+
It is recommended that to either use all custom UUIDs or depends completely on the system to generate UUID to avoid UUID conflicts.
114131

115132
== fq (Filter Query) Parameter
116133

134+
[%autowidth,frame=none]
135+
|===
136+
|Optional |Default: none
137+
|===
138+
117139
The `fq` parameter defines a query that can be used to restrict the superset of documents that can be returned, without influencing score.
118140
It can be very useful for speeding up complex queries, since the queries specified with `fq` are cached independently of the main query.
119141
When a later query uses the same filter, there's a cache hit, and filter results are returned quickly from the cache.
@@ -180,6 +202,11 @@ fq={!frange cache=false cost=200 l=0}pow(mul(sum(1, query('tag:smartphone')), di
180202

181203
== fl (Field List) Parameter
182204

205+
[%autowidth,frame=none]
206+
|===
207+
|Optional |Default: `*`
208+
|===
209+
183210
The `fl` parameter limits the information included in a query response to a specified list of fields.
184211
The fields must be either `stored="true"` or `docValues="true"``.`
185212

@@ -256,6 +283,11 @@ fl=id,sales_price:price,secret_sauce:prod(price,popularity),why_score:[explain s
256283

257284
== debug Parameter
258285

286+
[%autowidth,frame=none]
287+
|===
288+
|Optional |Default: none
289+
|===
290+
259291
The `debug` parameter can be specified multiple times and supports the following arguments:
260292

261293
* `debug=query`: return debug information about the query only.
@@ -271,13 +303,18 @@ The default behavior is not to include debugging information.
271303

272304
== explainOther Parameter
273305

306+
[%autowidth,frame=none]
307+
|===
308+
|Optional |Default: none
309+
|===
310+
274311
The `explainOther` parameter specifies a Lucene query in order to identify a set of documents.
275312
If this parameter is included and is set to a non-blank value, the query will return debugging information, along with the "explain info" of each document that matches the Lucene query, relative to the main query (which is specified by the `q` parameter).
276313
For example:
277314

278315
[source,text]
279316
----
280-
q=supervillains&debugQuery=on&explainOther=id:juggernaut
317+
q=supervillains&debug=all&explainOther=id:juggernaut
281318
----
282319

283320
The query above allows you to examine the scoring explain info of the top matching documents, compare it to the explain info for documents matching `id:juggernaut`, and determine why the rankings are not as you expect.
@@ -286,6 +323,11 @@ The default value of this parameter is blank, which causes no extra "explain inf
286323

287324
== partialResults Parameter
288325

326+
[%autowidth,frame=none]
327+
|===
328+
|Optional |Default: `true`
329+
|===
330+
289331
This parameter controls Solr's behavior when a query execution limit is reached (e.g. `timeAllowed` or `cpuAllowed`).
290332

291333
When this parameter is set to `true` (default) then even though reaching a limit terminates further query processing Solr will still attempt to return partial results collected so far. These results may be incomplete in a non-deterministic way (e.g. only some matching documents, documents without fields, missing facets or pivots, no spellcheck results, etc).
@@ -294,6 +336,11 @@ When this parameter is set to `false` then reaching a limit will generate an exc
294336

295337
== timeAllowed Parameter
296338

339+
[%autowidth,frame=none]
340+
|===
341+
|Optional |Default: none
342+
|===
343+
297344
This parameter specifies the amount of time, in milliseconds, allowed for a search to complete.
298345
If this time expires before the search is complete, any partial results will be returned, but values such as `numFound`, xref:faceting.adoc[facet] counts, and result xref:stats-component.adoc[stats] may not be accurate for the entire result set.
299346
In case of expiration, if `omitHeader` isn't set to `true` the response header contains a special flag called `partialResults`.
@@ -332,6 +379,11 @@ Regular search and the JSON Facet component abandon requests in accordance with
332379

333380
== cpuAllowed Parameter
334381

382+
[%autowidth,frame=none]
383+
|===
384+
|Optional |Default: none
385+
|===
386+
335387
This parameter specifies the amount of CPU time, in milliseconds, allowed for a search to complete.
336388
In contrast to the `timeAllowed` this parameter monitors the actual CPU usage by the thread that executes the query. The same CPU usage limit is applied to the query coordinator as to each replica that participates in the distributed search (although reaching this limit first in the query coordinator is unlikely).
337389
Should any replica locally exceed the allowed CPU time the whole distributed search will be terminated (by canceling requests to other shards).
@@ -343,36 +395,50 @@ All other considerations regarding partial results listed for the `timeAllowed`
343395

344396
== segmentTerminateEarly Parameter
345397

346-
This parameter may be set to either `true` or `false`.
398+
[%autowidth,frame=none]
399+
|===
400+
|Optional |Default: `false`
401+
|===
347402

348403
If set to `true`, and if xref:configuration-guide:index-segments-merging.adoc#mergepolicyfactory[the mergePolicyFactory] for this collection is a {solr-javadocs}/core/org/apache/solr/index/SortingMergePolicyFactory.html[`SortingMergePolicyFactory`] which uses a `sort` option compatible with <<sort Parameter,the sort parameter>> specified for this query, then Solr will be able to skip documents on a per-segment basis that are definitively not candidates for the current page of results.
349404

350405
If early termination is used, a `segmentTerminatedEarly` header will be included in the `responseHeader`.
351406

352407
Similar to using <<timeAllowed Parameter,the `timeAllowed` Parameter>>, when early segment termination happens values such as `numFound`, xref:faceting.adoc[Facet] counts, and result xref:stats-component.adoc[Stats] may not be accurate for the entire result set.
353408

354-
The default value of this parameter is `false`.
355-
356409
== omitHeader Parameter
357410

358-
This parameter may be set to either `true` or `false`.
411+
[%autowidth,frame=none]
412+
|===
413+
|Optional |Default: `false`
414+
|===
359415

360-
If set to `true`, this parameter excludes the header from the returned results.
416+
If set to `true`, the `omitHeader` parameter excludes the header from the returned results.
361417
The header contains information about the request, such as the time it took to complete.
362-
The default value for this parameter is `false`.
418+
363419
When using parameters such as <<timeallowed-parameter,`timeAllowed`>>, and xref:deployment-guide:solrcloud-distributed-requests.adoc#shards-tolerant-parameter[`shards.tolerant`], which can lead to partial results, it is advisable to keep the header, so that the `partialResults` flag can be checked, and values such as `numFound`, `nextCursorMark`, xref:faceting.adoc[Facet] counts, and result xref:stats-component.adoc[Stats] can be interpreted in the context of partial results.
364420

365421
== wt Parameter
366422

423+
[%autowidth,frame=none]
424+
|===
425+
|Optional |Default: `json`
426+
|===
427+
367428
The `wt` parameter selects the Response Writer that Solr should use to format the query's response.
368429
For detailed descriptions of Response Writers, see xref:response-writers.adoc[].
369430

370431
If you do not define the `wt` parameter in your queries, JSON will be returned as the format of the response.
371432

372433
== logParamsList Parameter
373434

435+
[%autowidth,frame=none]
436+
|===
437+
|Optional |Default: all parameters
438+
|===
439+
374440
By default, Solr logs all query parameters on each request.
375-
This parameter allows users to override this behavior, by specifying a comma-separated "allowlist" of parameter names that should be logged.
441+
The `logParamsList` parameter allows users to override this behavior, by specifying a comma-separated "allowlist" of parameter names that should be logged.
376442
This may help control logging to only those parameters considered important to your organization.
377443

378444
NOTE: `logParamsList` only governs the logging of query parameters.
@@ -390,6 +456,11 @@ TIP: This parameter not only applies to query requests, but to any kind of reque
390456

391457
== echoParams Parameter
392458

459+
[%autowidth,frame=none]
460+
|===
461+
|Optional |Default: `none` or default in `solrconfig.xml`
462+
|===
463+
393464
The `echoParams` parameter controls what information about request parameters is included in the response header.
394465

395466
The `echoParams` parameter accepts the following values:
@@ -453,6 +524,12 @@ This is what happens if a similar request is sent that adds `echoParams=all` to
453524
----
454525

455526
== minExactCount Parameter
527+
528+
[%autowidth,frame=none]
529+
|===
530+
|Optional |Default: none
531+
|===
532+
456533
When this parameter is used, Solr will count the number of hits accurately at least until this value.
457534
After that, Solr can skip over documents that don't have a score high enough to enter in the top N.
458535
This can greatly improve performance of search queries.

0 commit comments

Comments
 (0)