binyamin / eleventy-garden

:seedling: A starter site for building a mind garden with eleventy
https://eleventy-garden.netlify.app
MIT License
452 stars 48 forks source link

Search function #11

Closed RosieCampbell closed 2 years ago

RosieCampbell commented 4 years ago

I'd like to be able to bring up a search bar to search across all content on the site.

binyamin commented 4 years ago

Great idea.

Here are some relevant articles/solutions, for anyone tackling this issue:

itsthecheat commented 4 years ago

Hello, If this is still available I'd be happy to work on it!

binyamin commented 4 years ago

@itsthecheat Sure! Lmk if you need anything.

binyamin commented 4 years ago

@itsthecheat Are you still working on this? Asking because #4 will be affected by this feature.

binyamin commented 4 years ago

@tannerdolby @RosieCampbell How many notes should we expect to be searching through?

tannerdolby commented 4 years ago

I was asking myself this question last night. Which made me think: How many hashtags should the project support? Currently the tags in #33 are hardcoded to look for (#art, #easter, #food) to produce lists of related notes.

Right now the project has 4 notes.

I think we could expect to search for around 10 notes or < 20. Where this ceiling of notes to be searched can be updated as the project grows, allowing the search to index more notes.

As the number of notes increases, the potential for new hashtags arises. I think the number of hashtags could be set to a default 3 or something like? Allowing for more hashtags to be added via the tags.liquid template.

binyamin commented 4 years ago

Where this ceiling of notes to be searched can be updated as the project grows

@tannerdolby My intent was more that the search will get slower with more documents. If possible, I don't want to manually limit the number of items searched.

I think the number of hashtags could be set to a default 3 or something like?

I don't think we should limit the number of possible hashtags. I don't want to make users comb through their notes, looking for which tags they use.

tannerdolby commented 4 years ago

How many notes should we expect to be searching through?

@binyamin I agree, the search will definitely become slower with more documents. I was only giving my thoughts for an expected number of notes within /notes/ to be searching through.

I don't want to make users comb through their notes, looking for which tags they use.

Agreed, the implementation I proposed in #33 will have to be updated to dynamically create related lists rather than what I've spun up for the first prototype.

gerwitz commented 3 years ago

FWIW, I implemented search on my personal Eleventy site with lunr (the "father" of Elasticlunr) and it works brilliantly and performs fairly well with nearly 1,000 pages.

binyamin commented 2 years ago

I'm considering this out-of-scope. See https://github.com/binyamin/eleventy-garden/discussions/71#discussion-3765981