cj icon indicating copy to clipboard operation
cj copied to clipboard

Better way to search wiki

Open NotUnlikeTheWaves opened this issue 4 years ago • 4 comments

Currently wiki pages are searched for in two hardcoded folders: /wiki/docs/scripting/callbacks and /wiki/docs/scripting/functions.

With the wiki pages also getting sections for resources and tutorials on top of functions/callbacks (and who knows what more) I suggest making the search implementation more generic. My suggestion is to search for any file named like the entered query in /docs or any subfolder. Ideas?

NotUnlikeTheWaves avatar Jun 03 '20 16:06 NotUnlikeTheWaves

This would make sense. I've wanted to try out Bleve for something like this for a while: https://blevesearch.com/

Southclaws avatar Jun 03 '20 16:06 Southclaws

Does bleve make sense for this application? A quick scan around their functionality seems that it returns multiple results as a closest match. Could this favor a page mentioning X over page X itself?

I think this could be a discussion too: what's the desired behavior of the wiki command? is searching pages for content a good functionality instead of matching the title? What's a good use case for it?

I might be misinterpreting how you suggest bleve can be used here, so feel free to point it out

NotUnlikeTheWaves avatar Jun 03 '20 16:06 NotUnlikeTheWaves

Yes it's a search tool. I probably wouldn't suggest full-text content searching though, that's a bit of a bad match for Discord as a UI for this.

Though an actual search could be useful in some contexts. I've had a few cases where a user has asked about a broad topic and I post a bunch of APIs for that topic. Being able to /wiki vehicle and get all the vehicle functions could be beneficial.

Though this would be better done through tagging inside the wiki content itself. I believe Docusaurus supports some form of categorisation or tagging.

It might also be worth just doing a levenshtein distance on the filename.

Southclaws avatar Jun 03 '20 17:06 Southclaws

Worth pointing out that currently there already is a Levenshtein distance check on what it currently returns

NotUnlikeTheWaves avatar Jul 08 '20 09:07 NotUnlikeTheWaves