Post #4323757
2026-08-01 23:19 UTC
this is extremely rudimentary of course, but basically it's nothing more than a key/value store, a regex, a string concatenation and some Maps and arrays in a trenchcoat
split every name into something approximating a 'word', also generate a concatenation of every 2 subsequent 'words' and add that to the 'words', then store a reference from each of those words to the original item's ID
then you do the same splitting for the search query, get every reference from the index DB for every 'word' in the query, order the reference IDs by how many of them matched and put the one with the most matches against the query at the top, fetch the actual underlying record (the name and the URL) for the top 10 results and show them
and presto, that's it
Replies (1)
-
@joepie91@fedi.slightly.tech 2026-08-01 23:19
a real-world full text search has more trickery than that of course, but like, this kinda already.. works? and none of it is *particularly* complicated, as long as you have a key/value database like lmdb that supports storing multiple values for a key