Mastodon Feed: Post

Mastodon Feed

Boosted by soatok@furry.engineer ("Soatok Dreamseeker"):
joepie91@slightly.tech ("Sven Slootweg, ("still kinky and horny anyway")") wrote:

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