Help:Inline queries/Result limits and links to further results

Subpages of the main Help page: **3.1 /Result limits and links to further results **3.2 /Introduction and default text
 * 1 /Introduction to "hash"ask
 * 2 /The "hash"show parser function
 * 3 /Standard parameters for inline queries
 * 3.3 /Sorting results
 * 3.4 /Configuring labels or table headers
 * 3.5 /Changing the first result column
 * 4 /Result formats
 * 5 /Exporting query results: RSS, etc.
 * 6 /Using templates for custom formatting

You can set the parameter limit to restrict the maximum number of results that are returned. For example, the query

displays at most 3 cities in Germany. Even if you do not specify a value for limit, SMW always applies some limit to the results a query returns. Depending on a site's settings, it might be possible to increase the number of displayed results by specifying a higher value for limit. However, there is usually a maximum limit that cannot be exceeded, set by the wiki administrator based on performance considerations.

Running the above query produces:

This shows that whenever a query does not display all results due to a limit, it will normally show a link to «further results». The text of this link can be modified by setting the parameter searchlabel. If the value of searchlabel is empty, then no link to further results appears. Some output formats (see below) never display the search link, or display it only if a searchlabel was specified.

An interesting application of limit and searchlabel is to display only a link to the results of a search, without showing any result inline. You achive this by specifying a limit of «0» or «-1». For instance, the query

displays:. this link will only appear if there are any results at all. In other words, SMW will still compute the query to check if there are any results. If this is not needed, or if a link should be shown in any case, one can use the limit «-1». SMW will then only print a link to further results, even if no results exist at all. This also saves some computation time on the server.