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

General: Create Site Search #302

Merged
merged 7 commits into from Jun 28, 2021

Conversation

RoboticMind
Copy link
Contributor

Creates a basic site search system. Especially useful for the wiki. As the wiki has gotten larger, it has gotten harder to find things on there

Limitations:

  • Done client side, so has to send more data and store in memory
  • Has to reload page to search again
    • Keeps memory down because it can garbage collect the page data after a search. Already a ~10MB difference in RAM, but that will grow as the site grows.

@nathanielcwm
Copy link
Contributor

nathanielcwm commented Apr 17, 2021

Appears like G analytics can track site searches. Wait nvm i'm guessing it's for non local searches.

https://support.google.com/analytics/answer/1012264?hl=en

@RoboticMind
Copy link
Contributor Author

It would actually still work because this uses ?query=yoursearch in the URL

I originally planned on making the search work differently through having search bars across the site where using that made more sense. I stuck with it because it would take more work to change and I've already spent too much time on this. As well I may still add search bars to the wiki pages

@barton2526
Copy link
Member

Could the search bar be made a little wider? It looks a little squished on my screen:
image

@barton2526
Copy link
Member

additionally, this is a pretty empty page
image

@barton2526
Copy link
Member

barton2526 commented Jun 28, 2021

nit: searching "~" throws an uncaught exception, but we probably don't care

":" also throws an exception. Probably don't care about that either

assets/js/search.js Outdated Show resolved Hide resolved
assets/js/search.js Outdated Show resolved Hide resolved
assets/js/search.js Outdated Show resolved Hide resolved
assets/js/search.js Outdated Show resolved Hide resolved
assets/js/search.js Outdated Show resolved Hide resolved
assets/js/search.js Outdated Show resolved Hide resolved
assets/js/search.js Outdated Show resolved Hide resolved
assets/js/search.js Outdated Show resolved Hide resolved
assets/js/search.js Outdated Show resolved Hide resolved
@barton2526
Copy link
Member

Could the search bar be made a little wider? It looks a little squished on my screen:
image

resolved, thanks

@RoboticMind
Copy link
Contributor Author

additionally, this is a pretty empty page

It's less empty when it's filled with results, but I think with the wider search bar its not as bad.

@barton2526 barton2526 merged commit 56ca54f into gridcoin-community:master Jun 28, 2021
@RoboticMind
Copy link
Contributor Author

nit: searching "~" throws an uncaught exception, but we probably don't care

Yeah those are related to extra search parameters you can give with lunr.js. ~ is to try to fuzzy match and is used like work~1 to say that one character can be off of that word. https://lunrjs.com/guides/searching.html#fuzzy-matches

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

Successfully merging this pull request may close these issues.

None yet

3 participants