arj03 / ssb-browser-demo

A secure scuttlebutt client interface running in the browser
Other
58 stars 11 forks source link

Search for keyword #164

Closed KyleMaas closed 3 years ago

KyleMaas commented 3 years ago

It would awfully nice if we could do searches for posts by a keyword. When I was looking for information on the nonstandard way to include a post title in #67, it took me quite a while to find the SSB messages which talked about that. I forgot to file this at the time, but it would have been really handy if I could have searched for that using terms I knew were part of that conversation. I think Patchwork supports searching like this. We should, too.

KyleMaas commented 3 years ago

@arj03 Best way I can think of to implement this would be to pull the last X messages and search their content with indexOf(). Is there a better way to do this in db2 other than the brute force approach?

arj03 commented 3 years ago

There was an index thing that looked really nice. Let me just find that.

arj03 commented 3 years ago

This one. See this thread on ssb: %4NrjfBaWS/YuKjR6bU+wbqR9mGhnBKy73LXO1gJeOE8=.sha256

KyleMaas commented 3 years ago

Hm. Looks like meilisearch requires a server instance. But I think the basic principle could work. I'll see what I can find.

KyleMaas commented 3 years ago

Thinking maybe FlexSearch might be a good one to use:

https://github.com/nextapps-de/flexsearch

Either that or MiniSearch (which is under an MIT license instead of Apache):

https://github.com/lucaong/minisearch

If we only indexed only the last few thousand posts, I could see this working pretty quickly.