The admin for search pages can be located by navigating to /admin/config/search/pages
. Search pages are part of the core search and metadata that allow both users and content to be indexed and searched based on different factors. If we take a more detailed look, we will note that we can index content, configure minimum word length, and specify which search page to use for our results.
The most important aspect of search pages is the INDEXING PROGRESS status. Indexing is the process of crawling the site or database, which, in turn, stores a result set that allows content to be found when a user enters a keyword or term in the search form. Unless content has been indexed, we will not have any results to display.
In order to index our site, we need to complete two steps.
Clicking on the Re-index site button does not perform the actual indexing but merely triggers the indexing to occur.
/admin/config/system/cron
by clicking on the Run cron button.Cron allows specific tasks to run based on a set interval. The interval can be modified by changing CRON SETTINGS. By default, Drupal will run Cron every 3 hours. Cron is triggered when a user first visits the site after the 3-hour period has expired. Cron can also be triggered from a URL outside the site, which allows the manager of the Cron task to be run from the web server itself.
We will not be covering the configuration of Cron from systems administration level. Just know that we can manually run Cron when needed by visiting this page.
After completing the two steps required to index our site, if we navigate back to the search page's admin, we should now see that our INDEXING PROGRESS reports that 100% of the site has been indexed.
Another configuration within the search pages interface allows us to modify or configure additional settings for the label, URL, and content ranking.
In order to configure our Content search page, we will need to expand the SEARCH PAGES section and click on the Edit button, as shown in the following image:
The most important configuration option is the CONTENT RANKING section, which allows us to influence certain factors that search uses, including but not limited to Keyword relevance and Number of comments. Content ranking, as shown in the following image, can be modified by changing the value next to each factor.
A higher INFLUENCE value determines the order of the search results, and modifying this value does not require reindexing the site. For demonstration purposes, we will not change the values on this page.
One important thing to note is that Drupal not only indexes content but also any users that have accounts within the website. Although this is great in order to create member directories, in our case, we only want users to be able to search on content. We can remedy this by disabling users' search pages.
From the Search pages admin, if we look under the SEARCH PAGES section, we will see Users currently enabled:
We can always create a new Users page at a later time by returning to the Search pages admin. One last step, make sure to reindex the site now that we have removed users and then it's time to move on to review the markup of our Search results page.