Skip to content

Search box needed #263

Open
Open

Description

@bjnath

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

Activity

  1. rgommers commented on May 23, 2020

    @rgommers
    Member

    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/

  2. bjnath commented on May 23, 2020

    @bjnath
    ContributorAuthor

    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.

  3. joelachance commented on May 23, 2020

    @joelachance
    Contributor

    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.

  4. bjnath commented on May 23, 2020

    @bjnath
    ContributorAuthor

    It searches the site.

    There are two sites, with HTML in different places.

  5. joelachance commented on May 23, 2020

    @joelachance
    Contributor

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

  6. bjnath commented on May 23, 2020

    @bjnath
    ContributorAuthor

    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.

  7. joelachance commented on May 23, 2020

    @joelachance
    Contributor

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

  8. bjnath commented on May 23, 2020

    @bjnath
    ContributorAuthor

    @joelachance Cool -- let me take a look.

  9. bjnath commented on May 23, 2020

    @bjnath
    ContributorAuthor

    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

  10. rgommers commented on May 23, 2020

    @rgommers
    Member

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

  11. rgommers commented on May 23, 2020

    @rgommers
    Member

    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.

  12. bjnath commented on May 23, 2020

    @bjnath
    ContributorAuthor

    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.

  13. stefanv commented on May 23, 2020

    @stefanv
    Contributor

    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.

  14. bjnath commented on May 23, 2020

    @bjnath
    ContributorAuthor

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

    https://docsearch.algolia.com/

  15. rgommers commented on May 23, 2020

    @rgommers
    Member

    I hadn't - looks pretty cool!

  16. joelachance commented on May 23, 2020

    @joelachance
    Contributor

    @bjnath, nice find!

  17. InessaPawson commented on Jan 12, 2026

    @InessaPawson
    Member

    To follow up on this old but still relevant issue: scientific-python-hugo-theme now includes built-in support for site search:
https://github.com/scientific-python/scientific-python-hugo-theme/blob/main/assets/theme-css/search.css
    To make this feature visible and usable, we need to wire this up at the numpy.org level by adding a search box. I will try to take a stab at this.

  18. linked a pull request that will close this issueENH: enable site search with pagefind #915on Sep 29, 2026
  19. mattip commented on Oct 9, 2026

    @mattip
    Member

    Reopening for more discussion. The solution in #915 only searches numpy.org hugo site and not the numpy documentation. Can we either get it to search the entire numpy.org or add a note to the bottom of the search pointing to https://numpy.org/doc/stable/search.html for further searches?

  20. reopened this on Oct 9, 2026
  21. InessaPawson commented on Oct 10, 2026

    @InessaPawson
    Member

    @mattip As you might guess by the age of the issue, we have had multiple discussions over the years on this topic in various settings and context, and considered a few options for a unified search for numpy.org.
    Here are my current thoughts:

    • A quick fix would be to add a link to the numpy.org search dialog pointing to https://numpy.org/doc/stable/search.html.

    • As for implementing unified search, I’d like to experiment with Pagefind mergeIndex. I quite like how fast Pagefind is on numpy.org and how it presents search results. From a quick look, it seems we’d need to generate a Pagefind index for the stable docs, then make a small override to the Hugo theme to merge the two indexes. This would be a slightly bigger effort and take a little more time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions