Bootstrap: Searching for "tabs" on v4 docs site doesn't return nav page

Created on 13 Nov 2016  路  10Comments  路  Source: twbs/bootstrap

Go to https://v4-alpha.getbootstrap.com/getting-started/introduction/ and search for "tabs"
Expected: https://v4-alpha.getbootstrap.com/components/navs/ is returned
Actual: "Sorry, there are no results for that search."

docs v4

Most helpful comment

TBH, the whole search functionality is sorely lacking. It seems very basic, and just looks for specific page names. It would be nice to see a full search engine in here. maybe something like Algolia.

All 10 comments

TBH, the whole search functionality is sorely lacking. It seems very basic, and just looks for specific page names. It would be nice to see a full search engine in here. maybe something like Algolia.

Yeah Algolia seems to work pretty well - We're using it on a bunch of Facebook project sites now (React, Yarn, Flow, and a few others). On the other hand, even a Google search box would be useful :)

This is on the roadmap over at #17021 (under Docs). Currently we use christian-fei/Simple-Jekyll-Search. Pull requests would likely be accepted for this, but I would suggest discussing the choice of service with mdo on Slack before you implement.

Hey all,

React, React Native, Yarn and others are using DocSearch. It's a great improvement over the previous PR (#16901) that was using a Jekyll plugin and custom JS code.

DocSearch is a crawler we run on our side (I work at Algolia), that will look at the markup of the documentation website and extract content (titles, subtitles, content, etc), push it to Algolia and make it publicly available. We've also developed a JS lib (hosted on various CDNs) that will only require a few lines on your side to instanciate and bind to an input.

The product itself is completly free, no Algolia account needed and all the code is open-source (you can even run the crawler yourself if you want). As it's on a cron every 24h, you don't have anything to add to your build steps.

Let me know if you need any more information, I'd be happy to help.

Yeah, we definitely to improve what's there today. I implemented the current v4 docs search long ago as a first step to getting easier navigation in there. It's missing page content, keyboard shortcuts, and more compared to other solutions. But it was easy for me to implement. :grin:

@pixelastic Let's see this through for v4 :).

My main concern is being able to keep docs up to date locally as I develop things. New pages get added, headings changed, page content rewritten. How do we balance indexing public pages that get deployed one every couple months with local development? Ideally we'd run a Grunt (or Gulp or npm) task to generate those things as we go.

DocSearch itself is a crawler, self-contained in a Docker image, that only takes some urls and CSS selectors as input. We do run a version on a regular cron on our infra for ease of use, but the Docker image is publicly available and you could run it on demand. The front-end search can then be queried through a js lib we also provide.

So for your development concerns what you could do is create an npm run index-docs script that will run the docker image and index your current content. You would just have to make it target localhost while in dev, and push records in a different index than the one in prod. Then it will just be a matter of having a flag in your build process to specify if it's for dev or prod.

This would only require minor tweaks on our side to make it work, but if the idea sounds ok with you we could get started :)

self-contained in a Docker image

@pixelastic - The readme in that repo doesn't seem to mention a Docker image, it just has instructions on how to manually install it (install Python, run pip, etc). If there is a Docker image, it'd be worth mentioning the Docker instructions above the manual installation instructions :)

Apart from search & technical wishes, I loved the old docs and really dislike the v4 ones in terms of navigation. The old navigation gives good overview everywhere with a topnav for the big navigation and the affix subnav for in-page. I've been giving the new docs some tries over time and every time find it hard to navigate, know what link does what, how to know what's in a page (that's only in the TOC which scrolls away), etc.

Probably you're already aware of this, but you never know.

Should be much improved with #22715 and #22716.

Was this page helpful?
0 / 5 - 0 ratings