Skip to content

Commit 253b441

Browse files
authored
Merge pull request #17 from RavinduWeerakoon/main
Update the docsite with working algolia configuration
2 parents 58da5a8 + 6aef579 commit 253b441

4 files changed

Lines changed: 13 additions & 14 deletions

File tree

‎docusaurus.config.ts‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const config: Config = {
6868

6969
customFields: {
7070
latestVersion,
71-
searchProvider: 'lunr',
71+
searchProvider: 'auto',
7272
},
7373

7474
// CookiePro must load before GTM so it can categorize/block tracking
@@ -231,13 +231,9 @@ const config: Config = {
231231

232232
algolia: {
233233
appId: 'HGUIB02S86',
234-
apiKey: '5499faf1eb8741fc9f7fcfebe844572e',
235-
indexName: 'Agent Manager Documentation Site (Docusaurus)',
234+
apiKey: '08ce042847a47babb4833e131c226e33',
235+
indexName: 'Docs-agent-platform Crawler',
236236
contextualSearch: true,
237-
replaceSearchResultPathname: {
238-
from: /^\/agent-manager\/(docs\/)?/ as unknown as string,
239-
to: '/',
240-
},
241237
searchParameters: {},
242238
askAi: {
243239
assistantId: 'X4ZuiOLg5WnL',

‎package-lock.json‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"mermaid": "^11.16.1",
6565
"nanoid": "^3.3.17",
6666
"dompurify": "^3.4.13",
67-
"shell-quote": "^1.10.0",
67+
"shell-quote": "^1.12.0",
6868
"uuid": "^11.1.1",
6969
"svgo": "^4.1.0",
7070
"qs": "^6.16.0",

‎src/theme/Navbar/Content/index.tsx‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import styles from './styles.module.css';
2222
type SearchProvider = 'algolia' | 'lunr';
2323

2424
const CACHE_KEY = 'docs-search-provider';
25-
const CACHE_TTL = 60 * 60 * 1000; // 10 minutes
25+
const CACHE_TTL = 60 * 60 * 1000; // 1 hour
2626

2727
function getCachedProvider(): SearchProvider | null {
2828
try {
@@ -61,13 +61,16 @@ async function isAlgoliaReachable(algolia: {
6161

6262
try {
6363
const response = await fetch(
64-
`https://${algolia.appId}-dsn.algolia.net/1/indexes`,
64+
`https://${algolia.appId}-dsn.algolia.net/1/indexes/${encodeURIComponent(
65+
algolia.indexName,
66+
)}/query`,
6567
{
66-
method: 'GET',
68+
method: 'POST',
6769
headers: {
6870
'X-Algolia-Application-Id': algolia.appId,
6971
'X-Algolia-API-Key': algolia.apiKey,
7072
},
73+
body: JSON.stringify({query: '', hitsPerPage: 0}),
7174
signal: controller.signal,
7275
},
7376
);

0 commit comments

Comments
 (0)