Want help generating ideas for adding full-text search #42
Replies: 2 comments 2 replies
-
There are a bunch of others that are popular: I found benchmarking lists are also usedful, e.g., flexsearch's and uFuzzy's. uFuzzy's even has a way to try each of the listed search indexes. |
Beta Was this translation helpful? Give feedback.
-
Would it be technically possible to add a There could also be a Maybe a local search index could be generated as a method on the Tinybase This seems like a problem that would best be solved in Tinybase internally. It would be an incredible addition IMO. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello again! For my Mastodon client, I want to implement full-text search so that people can easily find statuses and accounts stored in stored. This is not as easy as I thought it would be due to search indexes implemented in JavaScript varying in quality, features, and the structure of their indexes. I am going to leave here a few libraries I've been investigating and the problems I've been having with them; feel free to find anything I missed.
Library Requirements
Issues with TinyBase
TinyBase doesn't really have a listener for knowing if individual rows in a table have been added, updated or deleted. My mind goes to SQLite's
CREATE TRIGGER
. I think something like below would be a good solution to the problem:Another issue is that our ID system is somewhat incompatible with the wider JavaScript ecosystem. For us, tables look like
{[rowId: Id]: Row}
, while most expect a table to look like(Row & {id: string})[]
. Of course, we can resolve this with something like:But then there's the concern of having
id
be a column in your row and then overwriting it; likely sweating small stuff here.MiniSearch
MiniSearch is pretty nice, but its serialization index is not very normalized, and it duplicates data already in our database in
storedFields
. If you used a few tables to store everything and recreated the index at runtime, you could overcome these issues, but it wouldn't necessarily be trivial.search-index
This library is quite powerful. It supports custom backends, but I'm not sure if TinyBase, a relational database built on top of JSON datatypes, is a good fit for a key-value store which holds binary blobs.
Beta Was this translation helpful? Give feedback.
All reactions