Text quotes can easily be searched with qsearch, but other types of quotes (links and images, for example), can't easily be found.
One possible solution would add a new column to the quotes table, called tags, tags would be checked with qinfo, defined with a new command qtags <comma separated list of tags>, and searched with qsearch tags=<cm.sp. list of tags>.
Following that solution, a couple of elements must be thought over:
The table will need to contain a Full-Text Index on the tags column. qsearch tag will MATCH('tags') AGAINST('tag1'). qsearch will only be able to look for one tag at a time.
SQLAlchemy ORMs can do MATCH() AGAINST() statements like:
Text quotes can easily be searched with `qsearch`, but other types of quotes (links and images, for example), can't easily be found.
One possible solution would add a new column to the quotes table, called `tags`, tags would be checked with `qinfo`, defined with a new command `qtags <comma separated list of tags>`, and searched with `qsearch tags=<cm.sp. list of tags>`.
Following that solution, a couple of elements must be thought over:
The table will need to contain a [Full-Text Index](https://mariadb.com/kb/en/full-text-index-overview/) on the `tags` column. `qsearch tag` will `MATCH('tags') AGAINST('tag1')`. `qsearch` will only be able to look for **one** tag at a time.
SQLAlchemy ORMs can do `MATCH() AGAINST()` statements like:
```py
tag = "tag"
quotes = session.query(Quotes).filter(Quotes.quote.match(tag)).all()
```
· Words less than [...] or 3 (InnoDB) characters in length will not be stored in the fulltext index. This value can be adjusted by changing the innodb_ft_min_token_size system variable.
· Words longer than 84 characters in length will also not be stored in the fulltext index. This values can be adjusted by changing the innodb_ft_max_token_size system variable.
It is unlikely that tags will have more than 84 characters. It is certain, however, that many tags will have two or maybe even one character.
Also, discord messages get to the client in a word list. Which means that there is no need to parse comma generated tags and instead just sparate the tags with s
> The table will need to contain a Full-Text Index
Keeping up with the reference:
> · Words less than [...] or 3 (InnoDB) characters in length will not be stored in the fulltext index. This value can be adjusted by changing the innodb_ft_min_token_size system variable.
· Words longer than 84 characters in length will also not be stored in the fulltext index. This values can be adjusted by changing the innodb_ft_max_token_size system variable.
It is unlikely that tags will have more than 84 characters. It is certain, however, that many tags will have two or maybe even one character.
Also, discord messages get to the client in a word list. Which means that there is no need to parse comma generated tags and instead just sparate the tags with s
Text quotes can easily be searched with
qsearch
, but other types of quotes (links and images, for example), can't easily be found.One possible solution would add a new column to the quotes table, called
tags
, tags would be checked withqinfo
, defined with a new commandqtags <comma separated list of tags>
, and searched withqsearch tags=<cm.sp. list of tags>
.Following that solution, a couple of elements must be thought over:
The table will need to contain a Full-Text Index on the
tags
column.qsearch tag
willMATCH('tags') AGAINST('tag1')
.qsearch
will only be able to look for one tag at a time.SQLAlchemy ORMs can do
MATCH() AGAINST()
statements like:Keeping up with the reference:
It is unlikely that tags will have more than 84 characters. It is certain, however, that many tags will have two or maybe even one character.
Also, discord messages get to the client in a word list. Which means that there is no need to parse comma generated tags and instead just sparate the tags with s