knadh / tg-archive

A tool for exporting Telegram group chats into static websites like mailing list archives.
MIT License
834 stars 124 forks source link

[FEATURE REQUEST] Searchengine #48

Open Bingenberger opened 2 years ago

Bingenberger commented 2 years ago

Is it possible to add a sitewide search into the static html-page? We got a pretty big archive and finding old posts will be much easier with a searchengine included.

knadh commented 2 years ago

I haven't thought about this, but I guess you could include some sort of a JS search plugin in your site template.

joschi commented 2 years ago

Suggestion for a static local search engine: Lunr

There's a Python implementation which produces files readable by the JavaScript version: https://pypi.org/project/lunr/

knadh commented 2 years ago

Will experiment with Lunr sometime, @joschi. The size of the index might get out of hand for big channels.

f0xcb commented 2 years ago

Why not search via MySQL. This would of course require that the database runs in a Mysql database.

joschi commented 2 years ago

@f0xcb MySQL is quite a heavy dependency and you'd need an active backend service talking to the MySQL database (which doesn't exist yet) in order to run searches.

knadh commented 2 years ago

MySQL is not necessary. tg-archive stores all data in an sqlite DB anyway, which has good full text support. It's possible to build a separate frontend which simply reads this DB file and presents a searchable site. That's not in the scope of tg-archive though, as it only aims to sync data and generate static sites.

dangnhdev commented 2 years ago

I would like to have this feature too. My telegram group is deleted and I'm struggling to search for old but valuable content in chat history.

knadh commented 1 year ago

Relevant to this discussion: https://github.com/tinysearch/tinysearch

rvnikita commented 1 year ago

Would love to have server search as well.