{"author":"chmaynard","children":[{"author":"londons_explore","children":[{"author":"kevincox","children":[],"created_at":"2022-07-31T01:30:54.000Z","created_at_i":1659231054,"id":32292265,"options":[],"parent_id":32291401,"points":null,"story_id":32290634,"text":"It&#x27;s not quite that simple because the user can search for more than one word. Generating all searches for one or two words is probably feasible but not much more than that. After that you probably do want to just generate one index per word and merge them together at search time to dynamically generate the search result page.","title":null,"type":"comment","url":null},{"author":"liambigelow","children":[],"created_at":"2022-07-31T05:31:29.000Z","created_at_i":1659245489,"id":32293443,"options":[],"parent_id":32291401,"points":null,"story_id":32290634,"text":"That is, in essence, what Pagefind is doing under the hood \u2014 but Pagefind also addresses the other reply in that it can combine these results when you search multiple words (among many other search benefits)","title":null,"type":"comment","url":null}],"created_at":"2022-07-30T23:24:49.000Z","created_at_i":1659223489,"id":32291401,"options":[],"parent_id":32290634,"points":null,"story_id":32290634,"text":"So....   A complete index of my site is too large...<p>So I could chunk the index up...   For example, one index for words beginning with each letter of the alphabet.   I could host the index for words beginning with &#x27;a&#x27; at mysite.com&#x2F;search&#x2F;a<p>But I could do yet smaller indexes!   I could make one index for each word.  Ie. use the URL mysite.com&#x2F;search&#x2F;abacus<p>We could call these mini-indexes search result pages...","title":null,"type":"comment","url":null},{"author":"fanf2","children":[],"created_at":"2022-07-30T23:29:13.000Z","created_at_i":1659223753,"id":32291420,"options":[],"parent_id":32290634,"points":null,"story_id":32290634,"text":"I recently deployed pagefind on my web site and it was pleasingly easy, and the result is reasonably nippy <a href=\"https:&#x2F;&#x2F;dotat.at&#x2F;search.html\" rel=\"nofollow\">https:&#x2F;&#x2F;dotat.at&#x2F;search.html</a>","title":null,"type":"comment","url":null},{"author":"xSxY3fj5gVCmvWE","children":[],"created_at":"2022-08-01T06:56:40.000Z","created_at_i":1659337000,"id":32302899,"options":[],"parent_id":32290634,"points":null,"story_id":32290634,"text":"Nice, thanks! A while ago I was looking for a a search lib precisely like this for my blog. I really like the idea of a client-side search - it feels extremely responsive to use compared to server side. The bandwidth-saving chunking tech is a nice bonus that I didn&#x27;t expect - the websites I&#x27;ve used seem to naively load the entire index.","title":null,"type":"comment","url":null},{"author":"fmajid","children":[],"created_at":"2022-08-01T08:59:35.000Z","created_at_i":1659344375,"id":32303564,"options":[],"parent_id":32290634,"points":null,"story_id":32290634,"text":"Five years ago when I switched from WO to Hugo I wrote my own solution based on SQLite\u2019s fts5 full-text search and using Hugo itself so the results match the theme of your site:<p><a href=\"https:&#x2F;&#x2F;github.com&#x2F;fazalmajid&#x2F;fts5index\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;fazalmajid&#x2F;fts5index</a>","title":null,"type":"comment","url":null},{"author":"lloydatkinson","children":[{"author":"liambigelow","children":[],"created_at":"2022-08-01T10:02:32.000Z","created_at_i":1659348152,"id":32303890,"options":[],"parent_id":32303855,"points":null,"story_id":32290634,"text":"I wrote out an explainer recently on HN answering exactly that: <a href=\"https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32172290\" rel=\"nofollow\">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=32172290</a>","title":null,"type":"comment","url":null}],"created_at":"2022-08-01T09:54:52.000Z","created_at_i":1659347692,"id":32303855,"options":[],"parent_id":32290634,"points":null,"story_id":32290634,"text":"I wonder how this compares to algolia? I recently added that to an open source project I released recently and the search results aren\u2019t just not relevant they aren\u2019t even close to correct. It works by first indexing your site by scraping it.<p>Not sure why everyone seems to use it.","title":null,"type":"comment","url":null},{"author":"tbran","children":[],"created_at":"2022-08-01T12:38:50.000Z","created_at_i":1659357530,"id":32305114,"options":[],"parent_id":32290634,"points":null,"story_id":32290634,"text":"This looks fantastic! I&#x27;ve used Lunr [0] (a client-side search engine), but as noted in the article, the index is huge and search is quite slow for a site with a lot of content. Splitting the index up is a great idea. Thank you!<p>[0]: <a href=\"https:&#x2F;&#x2F;lunrjs.com&#x2F;\" rel=\"nofollow\">https:&#x2F;&#x2F;lunrjs.com&#x2F;</a>","title":null,"type":"comment","url":null},{"author":"jacooper","children":[],"created_at":"2022-08-01T16:08:38.000Z","created_at_i":1659370118,"id":32308140,"options":[],"parent_id":32290634,"points":null,"story_id":32290634,"text":"Im working on a Hugo website, and it already includes a search engine.\nDoes Hugo include a search index ? And If so, is PageFind that much better?<p>The theme I&#x27;m trying hugo-theme-stack.","title":null,"type":"comment","url":null}],"created_at":"2022-07-30T21:42:11.000Z","created_at_i":1659217331,"id":32290634,"options":[],"parent_id":null,"points":76,"story_id":32290634,"text":null,"title":"Pagefind: Static Low-Bandwidth Search at Scale","type":"story","url":"https://cloudcannon.com/blog/introducing-pagefind/"}
