Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search is broken on v1 documentation site #9159

Closed
dj opened this issue Oct 16, 2018 · 21 comments
Closed

Search is broken on v1 documentation site #9159

dj opened this issue Oct 16, 2018 · 21 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@dj
Copy link

dj commented Oct 16, 2018

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

@siddhant1
Copy link
Contributor

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

@Yurickh
Copy link
Contributor

Yurickh commented Oct 16, 2018

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

@Yurickh
Copy link
Contributor

Yurickh commented Oct 16, 2018

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.

@pieh pieh added the type: bug An issue or pull request relating to a bug in Gatsby label Oct 17, 2018
@pieh
Copy link
Contributor

pieh commented Oct 17, 2018

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

@pieh
Copy link
Contributor

pieh commented Oct 17, 2018

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?

@fk
Copy link
Contributor

fk commented Oct 17, 2018

@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? 🙏

@s-pace
Copy link

s-pace commented Oct 17, 2018

👋
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

@pieh
Copy link
Contributor

pieh commented Oct 17, 2018

@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 :)

@s-pace
Copy link

s-pace commented Oct 17, 2018

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

@Yurickh
Copy link
Contributor

Yurickh commented Oct 17, 2018

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

@pieh
Copy link
Contributor

pieh commented Oct 17, 2018

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

@Yurickh
Copy link
Contributor

Yurickh commented Oct 17, 2018

Looks like I wasn't fast enough XD

@fk
Copy link
Contributor

fk commented Oct 17, 2018

💜🙏🤗🙌 @s-pace, @Yurickh and @pieh!

@fk
Copy link
Contributor

fk commented Oct 17, 2018

And @dj, of course, and @siddhant1!
Sorry about forgetting you! 💜🙏🤗🙌
;-)

pieh added a commit that referenced this issue Oct 17, 2018
add meta tag so docsearch can index both v1 and v2 websites

see #9159 (comment)
@dj
Copy link
Author

dj commented Oct 18, 2018

@fk no worries!

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

@pieh
Copy link
Contributor

pieh commented Oct 22, 2018

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)

s-pace pushed a commit to algolia/docsearch-configs that referenced this issue Oct 23, 2018
@s-pace
Copy link

s-pace commented Oct 23, 2018

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.

@pieh
Copy link
Contributor

pieh commented Oct 25, 2018

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

@s-pace
Copy link

s-pace commented Oct 26, 2018

@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.

jedrichards pushed a commit to jedrichards/gatsby that referenced this issue Nov 1, 2018
add meta tag so docsearch can index both v1 and v2 websites

see gatsbyjs#9159 (comment)
gpetrioli pushed a commit to gpetrioli/gatsby that referenced this issue Jan 22, 2019
add meta tag so docsearch can index both v1 and v2 websites

see gatsbyjs#9159 (comment)
@gatsbot
Copy link

gatsbot bot commented Jan 26, 2019

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!

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Jan 26, 2019
@gatsbot
Copy link

gatsbot bot commented Feb 6, 2019

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!

@gatsbot gatsbot bot closed this as completed Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

6 participants