Skip to content

Commit

Permalink
search: rank summary matches before content matches
Browse files Browse the repository at this point in the history
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 <[email protected]>
Change-Id: Ic58451a879839e1748c71d5a8b7413d1a5d56107
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1208424
Reviewed-by: Paul Jolly <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
jpluscplusm committed Feb 7, 2025
1 parent 588bffa commit 73bfbb4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions content/docs/concept/faq/new-modules-vs-old-modules/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hugo/algolia-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73bfbb4

Please sign in to comment.