From 73bfbb45bd14e4539bec41af5550ac5858a55fc7 Mon Sep 17 00:00:00 2001 From: Jonathan Matthews Date: Thu, 6 Feb 2025 15:48:26 +0000 Subject: [PATCH] search: rank summary matches before content matches This boosts the search ranking of pages that match a search term in their summary field over those that only match in the page content. Also: add an explicit page summary for a page to test that it now ranks for the term "FAQ" (which was previously absent from the page content). This will not be testable before the change is made to the search index, which only happens after CL submission. The impact of this change being incorrect should be close to zero, as nothing is being removed from the search results. The only change could be some subtle results reordering, and an updated search-results-page snippet for the FAQ page. After this change is made, and its effect can be observed behaving as expected on the live site, an issue tracking the lack of explicit page summaries will be opened. Fixes cue-lang/docs-and-content#194. Signed-off-by: Jonathan Matthews Change-Id: Ic58451a879839e1748c71d5a8b7413d1a5d56107 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1208424 Reviewed-by: Paul Jolly TryBot-Result: CUEcueckoo --- content/docs/concept/faq/new-modules-vs-old-modules/en.md | 4 ++++ hugo/algolia-settings.js | 2 +- .../en/docs/concept/faq/new-modules-vs-old-modules/index.md | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/content/docs/concept/faq/new-modules-vs-old-modules/en.md b/content/docs/concept/faq/new-modules-vs-old-modules/en.md index ba7d0699d7..549fb769a8 100644 --- a/content/docs/concept/faq/new-modules-vs-old-modules/en.md +++ b/content/docs/concept/faq/new-modules-vs-old-modules/en.md @@ -2,6 +2,10 @@ title: New modules vs old modules tags: [modules] toc_hide: false +summary: | + Frequently Asked Questions (FAQ) about the differences between CUE's old + modules implementation and its new modules implementation that became the + default with CUE v0.9.0. --- The [v0.9.0](/releases/v0.9.0) release of CUE diff --git a/hugo/algolia-settings.js b/hugo/algolia-settings.js index f52aff140b..9b956e0726 100644 --- a/hugo/algolia-settings.js +++ b/hugo/algolia-settings.js @@ -20,7 +20,7 @@ const index = client.initIndex(indexName); index.setSettings({ queryLanguages: ['en'], - searchableAttributes: ['title', 'content', 'summary', 'tags', 'contentType', 'authors'], + searchableAttributes: ['title', 'summary', 'content', 'tags', 'contentType', 'authors'], attributesForFaceting: ['tags', 'contentType', 'authors'], distinct: true, attributeForDistinct: 'link', diff --git a/hugo/content/en/docs/concept/faq/new-modules-vs-old-modules/index.md b/hugo/content/en/docs/concept/faq/new-modules-vs-old-modules/index.md index 4326e37d4a..32444c822a 100644 --- a/hugo/content/en/docs/concept/faq/new-modules-vs-old-modules/index.md +++ b/hugo/content/en/docs/concept/faq/new-modules-vs-old-modules/index.md @@ -2,6 +2,10 @@ title: New modules vs old modules tags: [modules] toc_hide: false +summary: | + Frequently Asked Questions (FAQ) about the differences between CUE's old + modules implementation and its new modules implementation that became the + default with CUE v0.9.0. --- The [v0.9.0](/releases/v0.9.0) release of CUE