numpy.org icon indicating copy to clipboard operation
numpy.org copied to clipboard

Search box needed

Open bjnath opened this issue 4 years ago • 16 comments

I don't see a search box on the site, and I didn't find search mentioned in the issues. Is that correct? Is one in the works?

Users expect a search box on every site, but especially on a site that exists to be informative.

I imagine there are technical challenges because of the split content. We somehow need to solve them.

Imagine the response if we go live without a search box. "They put up this fancy new site and forgot / took away the search box."

bjnath avatar May 23 '20 14:05 bjnath

Good point, we don't have one but do need one. So much to think about when building a nice website ....

There's some options to implement one at https://gohugo.io/tools/search/

rgommers avatar May 23 '20 15:05 rgommers

But Hugo search isn't adequate.

Users will put NumPy questions in the search box and expect the same answers they do now. Users don't know there's a different site under the cover.

Search results must come from Hugo and Sphinx, and if either of them is expendable it's Hugo.

bjnath avatar May 23 '20 15:05 bjnath

But Hugo search isn't adequate.

Sure it is! It searches the site.

Users will put NumPy questions in the search box and expect the same answers they do now. Users don't know there's a different site under the cover.

Probably true, but we don't know this. I don't think we can expect adding search to be the same as using StackOverflow.

Is this something we want to add before launch? Because if it is, I'd push to start small, and add as we go. I agree search for both the site & docs would be great, I'm not sure it's doable by the time we want to launch, which I was understanding was very soon.

joelachance avatar May 23 '20 15:05 joelachance

It searches the site.

There are two sites, with HTML in different places.

bjnath avatar May 23 '20 15:05 bjnath

@bjnath Yep, of course. But it will be a good amount of work to search both sites. Starting small is in our best interest.

joelachance avatar May 23 '20 15:05 joelachance

starting small

"Starting small" would mean passing through Sphinx search and ignoring Hugo for now.

We can't give users a search box that's broken for the kinds of queries people expect the site to answer.

bjnath avatar May 23 '20 15:05 bjnath

@bjnath I think that would be great, I'd welcome a PR if you want to tackle it!

joelachance avatar May 23 '20 15:05 joelachance

@joelachance Cool -- let me take a look.

bjnath avatar May 23 '20 16:05 bjnath

Low-stress solution: a hyperlink that looks like a search box:

image

The user has to click on the box to fill it out. Instead of going blank, it takes the user to https://numpy.org/devdocs/search.html, our real search page:

image

Less annoying than you'd think, when I tried it out.

It's not perfect, but it solves the users' problem and ours.

Gist: https://gist.github.com/bjnath/d1830c3434413ecfeaca3bc36fb99d3d

bjnath avatar May 23 '20 18:05 bjnath

That'd be a good stopgap solution (with some styling). Where would we put it - right side of the navbar?

rgommers avatar May 23 '20 18:05 rgommers

https://pytorch.org/ has a styled looking glass in the right top corner that's quite nice. With live incremental search. Not for now, just noting cause it's pretty cool.

rgommers avatar May 23 '20 18:05 rgommers

right side of the navbar?

That's what I'd envisioned. I'm open to any place you'd expect a search bar to be.

with some styling

Yes, please! That was strictly proof of concept.

bjnath avatar May 23 '20 18:05 bjnath

https://pytorch.org/ has a styled looking glass in the right top corner that's quite nice. With live incremental search. Not for now, just noting cause it's pretty cool.

That is pretty neat! And, this should be quite doable, since Sphinx has a JS library, and StackOverflow has an API.

Agreed that this can wait, but would be fun to build.

stefanv avatar May 23 '20 18:05 stefanv

I assume everyone has already clicked and found how painlessly they're doing it?

https://docsearch.algolia.com/

bjnath avatar May 23 '20 19:05 bjnath

I hadn't - looks pretty cool!

rgommers avatar May 23 '20 19:05 rgommers

@bjnath, nice find!

joelachance avatar May 23 '20 20:05 joelachance