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

Site Search Resources #2376

Closed
gavinr opened this issue Sep 18, 2019 · 7 comments
Closed

Site Search Resources #2376

gavinr opened this issue Sep 18, 2019 · 7 comments

Comments

@gavinr
Copy link

gavinr commented Sep 18, 2019

I really think we need to improve the "site search" story for Hugo. The Search for your Hugo Website page is insufficient - there are too many half-baked options listed. Why not have a single, well-documented recommended setup? Here are a few specific issues but I'm really more interested in a holistic improvement of the "site search" story.

  • GitHub Gist for Hugo Workflow - this feels old - I realize that it's been updated over the years, but it's using Grunt which feels old in 2019 and I have to process through all the comments to figure out how to piece this solution together. Tough sell.
  • https://www.npmjs.com/package/hugo-lunr - this is not maintained - last commit in 2016 and there are un-merged PRs
  • Algolia - You have to create the records manually or figure out how to build hugo to push to the Algolia API?
    • I would propose we remove Algolia from the recommended list - in my experience as soon as you sign up for the free account you get bombarded by high-pressure sales tactics, contacting you via phone and even email addresses that they have found online that you did not give them.
  • Bonsai - part of the way there but I need to figure out how to push the data to Bonsai automatically

Thanks to the Hugo team for a quality product - I really appreciate it and am just trying to give some feedback to help future users.

@stale
Copy link

stale bot commented Jan 21, 2020

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@gavinr
Copy link
Author

gavinr commented Jan 21, 2020

This is a long-term feature request - would request an opt-out from the auto-stale-bot for discussion sake.

@bep
Copy link
Member

bep commented Jan 21, 2020

Why not have a single, well-documented recommended setup?

I agree that this issue is important, but it's hard to come up with a single solution cause the setup kind of depends ... so you may end up with a 1) Client side only solution (Lunr is an exellen choice), 2) A fully hosted solution (Algolia) or 3) A Self-hosted server solution (e.g. Bleve).

And those options are just for the search index. Some other static gens have better stories in this area, and I think the main reason we don't do so well here is that we are JS-framework-agnostic.

@budparr
Copy link

budparr commented Jan 21, 2020

Hugo-lunr works just fine (just tested it). It appears to be stable, as is Lunr. Algolia may be an advanced and—sometimes paid—product, but it's a good tool (I use it a lot) and also has an open source version that's in use on the Hugo website. Not sure about the others, but according to NPMJS, Grunt has a stable half-million weekly downloads, so it's still relevant to some.

In my opinion, while the list is incomplete, the links that are there may be helpful to some, particularly because Hugo is used by a wide variety of people around the world with different skills, toolsets and budgets.

@gavinr
Copy link
Author

gavinr commented Jan 21, 2020

@bep @budparr thank you for the thoughtful responses. I think you structured it well, and I think the page should maybe reflect that - something like:


A static website with a dynamic search function? Yes, Hugo provides an alternative to embeddable scripts from Google or other search engines for static websites. Hugo allows you to provide your visitors with a custom search function by indexing your content files directly. Depending on your needs, you may want a client-side only solution, a fully hosted solution, or a self-hosed server solution

client-side only solution

[text about when to use client-side only solutions]

Lunr.js is our recommended format for search index when using client-side only solutions. Some Libraries that allow you to easily create Lunr.js indexes from hugo include:

[LIST OF LIBRARIES with links and short descriptions, like hugo-lunr, etc]

fully hosted solution

[text about when to use fully hosted solutions]

[LIST OF SERVICES with links and short descriptions, like algolia, etc]

self-hosed server solutions

[text about when to use self-hosed server solutions]

[LIST OF LIBRARIES with links and short descriptions, like Bleve, etc]


Let me know what you think of this approach. I'm happy to create a PR if you think i'm on the right track.

@Brixy
Copy link

Brixy commented Jan 21, 2020

It's hard to come up with a single solution cause the setup kind of depends …

gomakethings.com uses a vanilla/plain JavaScript search script which does not require a JSON file.

How about adding something this simple and fast to Hugo for optional use out of the box.

We would only need a similar search template and an sample form which could be implemented anywhere in a template.

All other options can be implemented by the user as documented on the Hugo website.

Zola has search functionalities on board, see the “Comparisons with other static site generators” table.

@jmooring jmooring transferred this issue from gohugoio/hugo Dec 24, 2023
@jmooring
Copy link
Member

jmooring commented Feb 9, 2024

Closing in favor of #1573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants