bouncepaw / mycorrhiza

🍄📑 Filesystem and git-based wiki engine for the independent web written in Go using Mycomarkup as its primary markup language.
https://mycorrhiza.wiki
GNU Affero General Public License v3.0
289 stars 26 forks source link

Search in hyphae content #238

Open Eragonfr opened 1 week ago

Eragonfr commented 1 week ago

The current search is only done on title of the existing hyphae. But sometimes you want to find something that's only inside the hyphae content.

If the search would find hyphae that have content matching the request and display them under the list of hyphae that have the request in the title.

I guess something that works kind of like grep would be more than enough. There is no need for a search that allows for similar words or something like that. But having the option to find in the files would be great.

bouncepaw commented 1 week ago

So true! One day...

One of the reasons I've been postponing this is that I don't want to read every text file on every search. But maybe it's alright...

Eragonfr commented 1 week ago

It's alright if there is not too much content. But the solution might be to create an index, like how tinysearch do it. Maintaining a JSON index is probably the best solution (that doesn't involve a db) for bigger wikis

bouncepaw commented 1 week ago

Hmm, actually, an index might be a good idea! For some reason, I never thought about that, thank you.

Actually, I'm not scared of db, SQLite is quite good in my experience and I'm gonna introduce it to Mycorrhiza later. It will replace all this wide assortment of JSON files. Might as well store the index.

Tinysearch will probably serve as a source of inspiration.