News for hackers. Stuff that matters.
Re:A tiny static full-text search engine using Rust and WebA... by bigiain on Wednesday June 10, 2020 @12:19AM (#23473875)
You can probably push that "certain size" a long way down the road if you need to. (at least in this specific client side text search case, rather than a generic "how do I server large json files" way)

If you tweak the search box so it doesn't do anything until you've typed at least 2 or 3 letters, you could then serve regenerated son files that only contain that matches that have that prefix... No need for any of the json payload for words/phrases starting with aa..rt if someone's typed "ru" into the search box.

That means you'd have 676 distinct json files, but you'd only ever load the one you need...

Re:A tiny static full-text search engine using Rust and WebA... by thallada on Wednesday June 10, 2020 @12:38AM (#23473966)
But that requires a network request after typing to get results, which is about the same user experience of a search bar that requests some search API.
Re:A tiny static full-text search engine using Rust and WebA... by KajMagnus on Wednesday June 10, 2020 @03:12PM (#23480890)
> requires a network request

Seems to me that often, though not always, this network request would happen whilst the user is typing — say, busy typing chars 3, 4 and 5. That the netw req won't be noticeable for the human

And, if typing more chars, or backspace-deleting to fix a typo ... no netw request required.

And the same scenario, if typing a 2nd word.

I'm guessing in like 90% of the cases, it'll seem as if there was never a netw req.

Re:A tiny static full-text search engine using Rust and WebA... by bigiain on Wednesday June 10, 2020 @11:19PM (#23484898)
True, but it'd still allow your site to be a collection of static files instead of needing a executable running on a backend somewhere.