Gatsby: Search is broken on v1 documentation site

Created on 16 Oct 2018  Β·  21Comments  Β·  Source: gatsbyjs/gatsby

Description

When I search the v1 docs site, I get results for pages that only exist on v2. If I click them I get taken to an error page.

Steps to reproduce

  1. Visit https://v1.gatsbyjs.org/docs/
  2. Focus search input, type in createPage, click first result
    screen shot 2018-10-16 at 11 55 20 am
  3. You are taken to this page: https://v1.gatsbyjs.org/docs/page-creation/#oncreatepage-api

Expected result

Results for v2 site should not show up when searching on v1 site.

Actual result

New page loads in weird state, loading icon never goes away and my macbook pro's fans turn on. Can't immediately tell what is going on by looking at network tab.

Environment

Able to reproduce here:
https://v1.gatsbyjs.org/docs/

Firefox 62.0.3 (64-bit)
macOS High Sierra Version 10.13.6

stale? bug

Most helpful comment

πŸ‘‹
We can continue to use the same index and add a facetFilter in order to reduce the scope of the search to either v1 or v2. Your analytics will be more relevant.

Could you add a meta tag within your website in order to highlight the version of your documenation? It should looks this way:

<meta name="docsearch:version" content="1.0">

Then ping me and I will update your index

All 21 comments

Should we redirect them to the v2 docs or should we block these searches?

I would say that searching from within the v1 docs should only yield results from the v1 docs, and vice-versa.

My guess here is that we'll need to create a new index in docsearch for the v1 docs, but I'm not sure on how to.

Edit: Yup, the current docsearch config currently crawls the www.gatsbyjs.org url. We'll need to apply again for a new config file in docsearch with the new subdomain. From what I've read in their docs, I would guess that only the @gatsbyjs/inkteam can apply here.

I must say I'm green when it comes to docsearch, so actual tips how to "apply" for new config would be appreciated ;)

Do I just open PR in algolia/docsearch-config repo with new entry for v1 site? And after it is indexed we can adjust v1 site to use that new index?

@pieh I guess I know as much about this as you (probably less ;-)), but what @Yurickh and you commented makes sense to me.

I think adding a new config file for v1.gatsbyjs.org with the config file from https://github.com/algolia/docsearch-configs/blob/b0c02ab108e53d1e8fe7d17ba26a6546b466104e/configs/gatsbyjs.json β€” which should have the correct setup/selectors for v1 should work.

πŸ‘‹@s-pace I saw you did the last updates to gatsbyjs.json, maybe you can help us? πŸ™

πŸ‘‹
We can continue to use the same index and add a facetFilter in order to reduce the scope of the search to either v1 or v2. Your analytics will be more relevant.

Could you add a meta tag within your website in order to highlight the version of your documenation? It should looks this way:

<meta name="docsearch:version" content="1.0">

Then ping me and I will update your index

@s-pace thanks for info! I just have a question: v1 and v2 sites are completely separate (www.gatsbyjs.org vs v1.gatsbyjs.org) and have separate sitemaps - will that cause problems with using same index? If not we will add meta tags to v1 and v2 sites :)

We can handle both sitemap normally. Let's give it a try

If it is a matter of adding the meta tags, I can look into it.

Thanks for offer @Yurickh - I was just doing that when you commented ;)

Looks like I wasn't fast enough XD

πŸ’œπŸ™πŸ€—πŸ™Œ @s-pace, @Yurickh and @pieh!

And @dj, of course, and @siddhant1!
Sorry about forgetting you! πŸ’œπŸ™πŸ€—πŸ™Œ
;-)

@fk no worries!

Is this deployed / ready to be tested? I can still reproduce right now

Sorry for delay - it should be deployed on both v1 and v2 sites now (v1 site had problems with rebuilding but it's fixed now)

I have done a crawl of your website in order to let you know what we need from our side.

Please have a look to the requirements exposed in this PR

Quickly, we will need you to:

  • update the sitemap of the v1
  • update the DocSearch javascript snippet in order to filter on the proper part of your documenation.

So sitemap update for v1 obviously need to go in first. What about changes for client side docSearch init options change? If we update that before index is updated it will break our current search, right? So we would need to sync it somehow

@pieh you are right.

You can update your website first and we will merge the PR asap. if you do not want the search to be stopped, you can update your client without the filters:
algoliaOptions: { 'facetFilters': ["version:$VERSION", "tags:$TAGS"] },
It will introduce duplicates but the search will not be broken.

We can agree on a precise date for the merge and behaves depending on your move.

Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  Β·  3Comments

ghost picture ghost  Β·  3Comments

benstr picture benstr  Β·  3Comments

hobochild picture hobochild  Β·  3Comments

KyleAMathews picture KyleAMathews  Β·  3Comments