From 90fbe6bb7e4de5181538b38dfd3f0e8164e47f50 Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Wed, 20 May 2026 15:03:08 -0700 Subject: [PATCH 1/3] chore(search): Tune Algolia ranking to favor title and relevance Override the index settings pushed by scripts/algolia.ts so search results lean on titles and textual relevance instead of SDK popularity. - Add `title` as the first searchable attribute. Previously only `section`, `keywords`, and `text` were searched, so page titles like "Tracing" didn't contribute to matching unless they happened to also be a heading on the page. - Move `asc(popularity)` to the last position in the ranking criteria. It was running ahead of `attribute`, `exact`, and `proximity`, which meant a popular SDK page with a "Tracing" heading would outrank the Tracing product page on a "Tracing" query. Textual relevance now decides first; popularity is a final tiebreaker. Co-Authored-By: Claude --- scripts/algolia.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/algolia.ts b/scripts/algolia.ts index 1b1fbc46fba51c..679f1165512d90 100644 --- a/scripts/algolia.ts +++ b/scripts/algolia.ts @@ -105,7 +105,26 @@ async function indexAndUpload() { } if (!isDeveloperDocs) { - await index.setSettings(sentryAlgoliaIndexSettings); + await index.setSettings({ + ...sentryAlgoliaIndexSettings, + searchableAttributes: [ + 'unordered(title)', + 'unordered(section)', + 'unordered(keywords)', + 'text', + ], + ranking: [ + 'filters', + 'typo', + 'words', + 'attribute', + 'exact', + 'proximity', + 'desc(sectionRank)', + 'asc(position)', + 'asc(popularity)', + ], + }); } const totalSeconds = (performance.now() - startTime) / 1000; From 0e10bf0960c7b3a8a9de0c0652457185c7733cc7 Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Thu, 21 May 2026 11:39:11 -0700 Subject: [PATCH 2/3] chore(search): Boost SDK-agnostic product docs in popularity ranking Pages outside `platforms/` previously fell back to `MAX_SAFE_INTEGER` for the popularity field, so they always lost the `asc(popularity)` ranking tiebreaker to any SDK page. That meant queries like "Tracing" or "Sentry CLI" surfaced random SDK pages instead of the product or CLI docs that match the query subject more directly. Treat product/concept/CLI/guides/integrations pages as the most popular non-platform group by giving them popularity 0 (better than every individual SDK). The platform `optionalFilters` boost still runs ahead of popularity in the ranking pipeline, so users who have a platform selected keep getting platform-relevant results first. Co-Authored-By: Claude --- scripts/algolia.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/algolia.ts b/scripts/algolia.ts index 679f1165512d90..44c0801a626fe6 100644 --- a/scripts/algolia.ts +++ b/scripts/algolia.ts @@ -203,13 +203,22 @@ const frameworkPopularity: Record = { unity: 17, }; -const getPopularity = (sdk: string | undefined, framework: string | undefined) => { +const PRODUCT_DOC_PREFIXES = ['product/', 'concepts/', 'cli/', 'guides/', 'integrations/']; + +const getPopularity = ( + slug: string, + sdk: string | undefined, + framework: string | undefined +) => { if (sdk && frameworkPopularity[sdk]) { return frameworkPopularity[sdk]; } if (framework && frameworkPopularity[framework]) { return frameworkPopularity[framework]; } + if (PRODUCT_DOC_PREFIXES.some(prefix => slug.startsWith(prefix))) { + return 0; + } return Number.MAX_SAFE_INTEGER; }; @@ -238,7 +247,7 @@ async function getRecords( keywords: pageFm.keywords, sdk, framework, - ...(!isDeveloperDocs && {popularity: getPopularity(sdk, framework)}), + ...(!isDeveloperDocs && {popularity: getPopularity(pageFm.slug, sdk, framework)}), }; const cacheFileName = `v${CACHE_VERSION}_${md5(html + JSON.stringify(meta))}.json`; From 7557e8bf807171641c2f589d75ce9884edadf493 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Wed, 27 May 2026 22:54:50 +0000 Subject: [PATCH 3/3] [getsentry/action-github-commit] Auto commit --- scripts/algolia.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/algolia.ts b/scripts/algolia.ts index 44c0801a626fe6..af79ec297c67a1 100644 --- a/scripts/algolia.ts +++ b/scripts/algolia.ts @@ -203,7 +203,13 @@ const frameworkPopularity: Record = { unity: 17, }; -const PRODUCT_DOC_PREFIXES = ['product/', 'concepts/', 'cli/', 'guides/', 'integrations/']; +const PRODUCT_DOC_PREFIXES = [ + 'product/', + 'concepts/', + 'cli/', + 'guides/', + 'integrations/', +]; const getPopularity = ( slug: string,