javabot icon indicating copy to clipboard operation
javabot copied to clipboard

~search command

Open jottinger opened this issue 9 years ago • 4 comments

The website has a search facility for factoids - I was thinking it would be nice if we had a command like:

> ~search boot

The response would be a (possibly truncated) list of factoid keys that had boot in the title or content.

jottinger avatar Oct 22 '16 16:10 jottinger

In order to do this, most of the work would involve adding a text index to the factoid model, along with some minor tweaking of the factoid DAO. Thoughts?

jottinger avatar Mar 30 '19 12:03 jottinger

I've been mulling over such a feature for a while. I was thinking ~search would return a url to the bot's site to show the results. A text index isn't strictly necessary. it's working without one now, e.g. the data set is small enough that a regex query to work but i'm not opposed to adding one depending how far down that road we go.

evanchooly avatar Mar 30 '19 13:03 evanchooly

Hmm, if it's simply returning a URL, it'd just be a factoid itself:

~search $1 is https://javabot.evanchooly.com/factoids?name=$1&value=$1

jottinger avatar Mar 30 '19 14:03 jottinger

This is true, actually. I was just thinking the web UI would be the easiest way to display an "unbounded" amount of data coming back. An operation, while almost certainly overkill, would prevent it being overwritten. or we could just lock that factoid, too.

evanchooly avatar Mar 30 '19 15:03 evanchooly