mazed-dev / truthsayer

Second brain for knowledge workers that retains everything you read online and helps you to back up your communication with your source as easily as you might share an anecdote over a coffee.
MIT License
2 stars 2 forks source link

fix similarity search regression & release 0.6.26 #841

Closed SergNikitin closed 1 year ago

SergNikitin commented 1 year ago

To fix a regression introduced in #838 (the 2 loop optimisations were actually behavioural changes).

Although suboptimal, the older code did not insert empty arrays into various Map-s passed around in the TFJS algo. The newer code did, and because takeNBestScoring() used a convenient but happy-to-fail-silently Array.slice() it resulted in every node that's vaguely similar to the search phrase to be reported as a match.

This PR re-introduces the old behaviour.