Elektrine lite

← Feed

@joepie91@fedi.slightly.tech

Post #4323758

2026-08-01 23:10 UTC

an hour of hacking around and I have a basic functional fulltext search thingem code here: https://codeberg.org/joepie91/srap-search #ProjectToot

Replies (1)

  • @joepie91@fedi.slightly.tech 2026-08-01 23:19

    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

    Open ##4323757