Configure default presentation settings for a results page
When you create your results page you should define some suitable default values for how the search results are presented.
This includes setting a default number of results to return per page of results and what metadata field content to include in the result data.
The default presentation settings are set using in the results page configuration, accessed from the results page management screen.
The query processor options setting is where you set these default values.
Values set as defaults can be overridden using search form/CGI parameters. For example you can set your default number of results to be 20, but allow the user to change this by providing a field in your search form that sets the number of results. |
Set the default number of search results to return per page of results
Standard search results are paginated. By default, 10 results will be returned per page of results. This system default can be changed for your results page by setting the following option in your results page configuration:
Option | Value |
---|---|
Query processor options |
|
Define what type of summaries to return for your results
The search will automatically generate a summary for each search result. You can set what type of automatic summary is generated by setting the summary mode.
Option | Value |
---|---|
Query processor options |
|
Define what metadata fields are included in the search results data
By default, the search response will only include a small set of pre-defined metadata classes, such as the metadata title and description. If you wish to use any custom metadata within your search results (either for presentation of for logic within your template), then you need to configure your results page with the set of fields that should be returned.
Option | Value |
---|---|
Query processor options |
|
Define how the search results are sorted
The query processor options are also used to define both sort type and also any associated ranking settings. At the most basic level you should decide how you would like the search results to be sorted.
By default, the search results will be sorted by relevance (which is calculated based on the set of configured ranking settings). For example, you might decide to sort your results alphabetically by title, or by date.
Ranking settings will be ignored if you change the sort from relevance. |
Tutorial: Set default results page display and ranking options
Display and ranking (and scoping) options can be set independently for each results page.
This allows the same search package to be used to serve search results with quite different ranking/display options or to be scoped to a subset of the search package’s included data. These options are set in the same way as the scoping from the previous exercise by adding options to the query processor options.
-
Log in to the search dashboard where you are doing your training.
See: Training - search dashboard access information if you’re not sure how to access the training. Ignore this step if you’re treating this as a non-interactive tutorial. -
Navigate to the Shakespeare search results page
-
Select edit results page configuration from the customize section that was edited in the previous exercise. Set the results page to return five results per page and sort alphabetically then save and publish the changes.
-clive=training~ds-shakespeare -sort=title -num_ranks=5
-
Rerun the search for dream against the Shakespeare search results page specifying and observe that the results are sorted alphabetically by title and only 5 results are returned per page. Results are all from the Shakespeare website.