You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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].
22
22
23
+
23
24
== defType Parameter
24
25
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
+
|===
27
30
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].
29
32
30
-
If no `defType` parameter is specified, then by default, the xref:standard-query-parser.adoc[] is used.
31
-
(e.g., `defType=lucene`)
32
33
33
34
== sort Parameter
34
35
36
+
[%autowidth,frame=none]
37
+
|===
38
+
|Optional |Default: `score desc`
39
+
|===
40
+
35
41
The `sort` parameter arranges search results in either ascending (`asc`) or descending (`desc`) order.
36
42
The parameter can be used with either numerical or alphabetical content.
37
43
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
77
83
78
84
== start Parameter
79
85
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
+
|===
81
90
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.
84
92
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.
86
94
87
95
You can use the `start` parameter this way for paging.
88
96
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.
89
97
90
98
== rows Parameter
91
99
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
+
|===
94
104
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.
97
107
98
108
== canCancel Parameter
99
109
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
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.
107
126
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.
111
129
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.
114
131
115
132
== fq (Filter Query) Parameter
116
133
134
+
[%autowidth,frame=none]
135
+
|===
136
+
|Optional |Default: none
137
+
|===
138
+
117
139
The `fq` parameter defines a query that can be used to restrict the superset of documents that can be returned, without influencing score.
118
140
It can be very useful for speeding up complex queries, since the queries specified with `fq` are cached independently of the main query.
119
141
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
180
202
181
203
== fl (Field List) Parameter
182
204
205
+
[%autowidth,frame=none]
206
+
|===
207
+
|Optional |Default: `*`
208
+
|===
209
+
183
210
The `fl` parameter limits the information included in a query response to a specified list of fields.
184
211
The fields must be either `stored="true"` or `docValues="true"``.`
185
212
@@ -256,6 +283,11 @@ fl=id,sales_price:price,secret_sauce:prod(price,popularity),why_score:[explain s
256
283
257
284
== debug Parameter
258
285
286
+
[%autowidth,frame=none]
287
+
|===
288
+
|Optional |Default: none
289
+
|===
290
+
259
291
The `debug` parameter can be specified multiple times and supports the following arguments:
260
292
261
293
* `debug=query`: return debug information about the query only.
@@ -271,13 +303,18 @@ The default behavior is not to include debugging information.
271
303
272
304
== explainOther Parameter
273
305
306
+
[%autowidth,frame=none]
307
+
|===
308
+
|Optional |Default: none
309
+
|===
310
+
274
311
The `explainOther` parameter specifies a Lucene query in order to identify a set of documents.
275
312
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).
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
286
323
287
324
== partialResults Parameter
288
325
326
+
[%autowidth,frame=none]
327
+
|===
328
+
|Optional |Default: `true`
329
+
|===
330
+
289
331
This parameter controls Solr's behavior when a query execution limit is reached (e.g. `timeAllowed` or `cpuAllowed`).
290
332
291
333
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
294
336
295
337
== timeAllowed Parameter
296
338
339
+
[%autowidth,frame=none]
340
+
|===
341
+
|Optional |Default: none
342
+
|===
343
+
297
344
This parameter specifies the amount of time, in milliseconds, allowed for a search to complete.
298
345
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.
299
346
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
332
379
333
380
== cpuAllowed Parameter
334
381
382
+
[%autowidth,frame=none]
383
+
|===
384
+
|Optional |Default: none
385
+
|===
386
+
335
387
This parameter specifies the amount of CPU time, in milliseconds, allowed for a search to complete.
336
388
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).
337
389
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`
343
395
344
396
== segmentTerminateEarly Parameter
345
397
346
-
This parameter may be set to either `true` or `false`.
398
+
[%autowidth,frame=none]
399
+
|===
400
+
|Optional |Default: `false`
401
+
|===
347
402
348
403
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.
349
404
350
405
If early termination is used, a `segmentTerminatedEarly` header will be included in the `responseHeader`.
351
406
352
407
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.
353
408
354
-
The default value of this parameter is `false`.
355
-
356
409
== omitHeader Parameter
357
410
358
-
This parameter may be set to either `true` or `false`.
411
+
[%autowidth,frame=none]
412
+
|===
413
+
|Optional |Default: `false`
414
+
|===
359
415
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.
361
417
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
+
363
419
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.
364
420
365
421
== wt Parameter
366
422
423
+
[%autowidth,frame=none]
424
+
|===
425
+
|Optional |Default: `json`
426
+
|===
427
+
367
428
The `wt` parameter selects the Response Writer that Solr should use to format the query's response.
368
429
For detailed descriptions of Response Writers, see xref:response-writers.adoc[].
369
430
370
431
If you do not define the `wt` parameter in your queries, JSON will be returned as the format of the response.
371
432
372
433
== logParamsList Parameter
373
434
435
+
[%autowidth,frame=none]
436
+
|===
437
+
|Optional |Default: all parameters
438
+
|===
439
+
374
440
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.
376
442
This may help control logging to only those parameters considered important to your organization.
377
443
378
444
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
390
456
391
457
== echoParams Parameter
392
458
459
+
[%autowidth,frame=none]
460
+
|===
461
+
|Optional |Default: `none` or default in `solrconfig.xml`
462
+
|===
463
+
393
464
The `echoParams` parameter controls what information about request parameters is included in the response header.
394
465
395
466
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
453
524
----
454
525
455
526
== minExactCount Parameter
527
+
528
+
[%autowidth,frame=none]
529
+
|===
530
+
|Optional |Default: none
531
+
|===
532
+
456
533
When this parameter is used, Solr will count the number of hits accurately at least until this value.
457
534
After that, Solr can skip over documents that don't have a score high enough to enter in the top N.
458
535
This can greatly improve performance of search queries.
0 commit comments