function displaySearchResults(results) {
	clearSearchResults();

	if (results.length) {
		const list = document.createElement("ul");
		list.setAttribute("role", "list");
		list.classList.add("search-results__list");
		resultsElement.append(list);
		resultsElement.setAttribute("data-results", "true");
		activeIndex = -1;

		for (const result of results) {
			const listItem = document.createElement("li");
			listItem.classList.add("search-results__item");
			const maxLvl = Math.max(
				...Object.keys(result._highlightResult.hierarchy).map(k =>
					Number(k.substring(3)),
				),
			);
			listItem.innerHTML = `
                <h2 class="search-results__item__title"><a href="${result.url}">${result.hierarchy.lvl0}</a></h2>
                <p class="search-results__item__context">${typeof result._highlightResult.content !== "undefined" ? result._highlightResult.content.value : result._highlightResult.hierarchy[`lvl${maxLvl}`].value}</p>
            `.trim();
			list.append(listItem);
		}
	} else {
		showNoResults();
	}
}
Displays the given search results in the page.
@param {Array<object>} results The search results to display.
@returns {void}