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 #332

Closed
Maxhodges opened this issue Jun 15, 2016 · 12 comments
Closed

site search #332

Maxhodges opened this issue Jun 15, 2016 · 12 comments

Comments

@Maxhodges
Copy link

what are some strategies to getting search working on a static generated site? i.e. is it possible to allow people to search my blog if it's a static site? How would that work?

@ivanoats
Copy link
Contributor

I'm working on LunrJS integration. Therepo is on https://bitbucket.org/aerobatic/gatsby-lunr and hope to have a blog post on it by end of week.

@Maxhodges
Copy link
Author

thanks mate! LunrJS looks pretty good. Do let us know when your blog post is up!

@MoOx
Copy link

MoOx commented Jun 15, 2016

You might find interesting stuff in this issue MoOx/phenomic#142

@Alxandr
Copy link

Alxandr commented Aug 11, 2017

I have working search (though no propper UI yet) using elasticlunr here: https://github.com/Alxandr/alxandr.me/blob/feature/search/plugins/@alxandr/gatsby-plugin-search/gatsby-node.js

@erlend-sh
Copy link

An officially supported strategy for search in Gatsby would be wonderful. I'm not aware of a "1.1" or "2.0" roadmap, but if there was such a thing I'd vote for "Search" to be on there.

@bvaughn was asking around about Gatsby site search a while back, and I replied:

I'd love to see a plugin for @fergiemcdowall's norch [and/or search-index]

I know great search can be achieved with services like Algolia or Elastic, but it'd be nice to have a fairly feature-rich self-hosted option, static or otherwise.

@bvaughn
Copy link
Contributor

bvaughn commented Oct 1, 2017

FWIW I still have plans to build a plug-in for js-worker-search at some point.

@DanielRuf
Copy link
Contributor

Any updates on this? Please use GitHub repos so we can collaborate.

@andrew-codes
Copy link
Contributor

andrew-codes commented Nov 20, 2017

I turned some earlier work from this thread into a gatsby plugin NPM package; npm and repo. I'd like some feedback on it, though. I feel like the gatsby-config.js was not intended to have imperative code like in the example of the readme. If this is true, I'm thinking of refactoring the plugin to use sub-plugins to index the content.

Major shout out to @ivanoats's and @Alxandr's examples. I most definitely followed in their footsteps.

Thoughts?

@KyleAMathews
Copy link
Contributor

Adding code to the config is certainly allowed as it's a normal node.js module, especially small amounts of code like in your readme. If the plugin could require more code than that, I'd encourage consumers to out the code in a separate module.

@andrew-codes
Copy link
Contributor

I believe that is the extent of code required for the config file. I will submit a PR shortly to the docs's page listing the above plugin on the list of community supported plugins. Thanks!

@fergiemcdowall
Copy link

Heres an article about how to make a searchable static site with search-index: http://www.gordonburgett.net/post/2017/07_making_a_searchable_static_site/

@KyleAMathews
Copy link
Contributor

Closing this issue as it's a problem that'll be solved via plugins rather than in Gatsby core.

ChristopherBiscardi pushed a commit to ChristopherBiscardi/gatsby that referenced this issue Jun 27, 2019
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

10 participants