LN-Juggernaut / juggernaut-desktop

Decentralized messaging and payments
https://www.getjuggernaut.com
MIT License
130 stars 14 forks source link

Search Messages #36

Open johncantrell97 opened 4 years ago

johncantrell97 commented 4 years ago

Currently the search only searches your conversation list. Seems like most people would want this to also search your messages. We currently are not building any kind of index from the set of messages, they all just live in the indexedDB.

Simplest approach would be to just query over all messages where the search query is contained in the content. This will likely be pretty slow as the number of messages increases and also doesn't allow for surfacing 'similar' content to your search (off by some distance).

At some point I had implemented https://github.com/nextapps-de/flexsearch in the project to search aliases/pubkeys but in the end I removed it for a simpler approach.

We would probably want to use something like that for a real search but open to ideas here.

I assume we would also not want to rebuild the index every time we open the app though that might be the simplest way to start. Flexsearch and most of these libraries allow you to export/import the index to a file that we could use to initialize on start.