faker icon indicating copy to clipboard operation
faker copied to clipboard

Search on next.fakerjs.dev finds non-existent pages

Open matthewmayer opened this issue 2 years ago • 3 comments

Pre-Checks

Describe the bug

Go to https://next.fakerjs.dev/ Search "unique" Click top result It takes you to https://next.fakerjs.dev/api/unique.html#unique which is a 404

Screenshot 2022-11-22 at 10 56 52 Screenshot 2022-11-22 at 10 56 58

Minimal reproduction code

No response

Additional Context

No response

Environment Info

na

Which module system do you use?

  • [X] CJS
  • [ ] ESM

Used Package Manager

npm

matthewmayer avatar Nov 22 '22 03:11 matthewmayer

I highly assume that is because Algolia Index is based on fakerjs.dev not next.fakerjs.dev and so you see the results for the prod site.

Shinigami92 avatar Nov 22 '22 07:11 Shinigami92

algolia: {
      apiKey: process.env.API_KEY,
      appId: process.env.APP_ID,
      indexName: 'fakerjs',
    },

maybe its possible to specify a different indexName for each environment?

matthewmayer avatar Nov 22 '22 08:11 matthewmayer

Well, the next branch is build the most recent, but the index still only takes the main page into consideration, so I wonder if we have to configure something more than just the index name. I assume we have to configure that directly in algolia.


I think we could use this for the index name:

export const indexName = deployContext === 'production' || deployContext === 'branch-deploy' ? branchName : 'other';

(other for deploy previews, if we want the search there at all)

To be added to docs/.vitepress/versions.ts.

This needs to be backported to all other versions/branches.

ST-DDT avatar Nov 22 '22 09:11 ST-DDT

I'm closing this issue is no longer relevant as it has been fixed in #2513.

  • #2513

xDivisionByZerox avatar Apr 09 '24 20:04 xDivisionByZerox