# MaxResults

The maximum number of documents that GetQueryTagValues can examine when it runs the document query.

By default, GetQueryTagValues returns the values that occur in the specified FieldName for all the documents in your index that match the query. The MaxResults configuration parameter does not apply to GetQueryTagValues.

You can use `MaxResults` to restrict the number of documents that the action examines when it runs the query.

This behavior is not the same as the MaxResults parameter for the Query action. For example, if you set `MaxResults` to `10`, and the action finds 10 documents that match the query Text, it examines these 10 documents. If these documents do not match a subsequent query step, such as FieldText, GetQueryTagValues might not return any values. For the same query, the Query action examines further documents to find up to 10 matching results.

TIP: To use the Query form of MaxResults, you can set QuerySort, which defines the ordering of the documents that GetQueryTagValues uses. In this case, the query must examine all documents to find the top results according to your sort method, and `MaxResults` specifies the number of top results to use to return tag values.

As an alternative method to restrict the number of documents that GetQueryTagValues examines, you can set MaxValues. In this case, the action stops examining further documents when it finds enough matching documents to satisfy MaxValues, unless you also set another parameter that requires further evaluation (such as Sort or TotalValues)

NOTE: When you use a Distributed Action Handler (DAH) to distribute GetQueryTagValues, DAH requests the specified number of source documents from each child server that it forwards the request to. DAH does not enforce the `MaxResults` limit across the distributed architecture.

Actions: | GetQueryTagValues
Type: | Long
Default: |
Example: | `MaxResults=1000`
See Also: | MaxValues QuerySort

_FT_HTML5_bannerTitle.htm