Meta-tagging quotes #5

Open
opened 2 years ago by brejela · 1 comments
Owner

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:

tag = "tag"
quotes = session.query(Quotes).filter(Quotes.quote.match(tag)).all()
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() ```
brejela added the
enhancement
help wanted
labels 2 years ago
brejela added this to the General media-quoting improvements project 2 years ago
Poster
Owner

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

> 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
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: neeble-club/neeble#5
Loading…
There is no content yet.