Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.6k views
in Q2A Core by
I want to add a number of tag words   in the database so that they appear in the example tags list. How can I do this?

1 Answer

+2 votes
by
selected by
 
Best answer

Tags are automatically added to the DB when saving a post that has new tags. Tags keep a usage count. When it drops to 0 they are not displayed when suggesting tags.

If you know SQL then you could also add the tags massively by running some SQL statements directly to the DB. The thing is that you will have to force the count of usages of the tag to a number higher than 0. In order to do so you'd have to run this SQL statement:

insert into
qa_words(word, titlecount, contentcount, tagwordcount, tagcount)
values('newtag', 0, 0, 0, 1);
 
Now, again, bear in mind that  if the usage count of the tag drops from 1 to 0 it won't be displayed anymore. Also take into account that if you reindex post contents (in admin/stats) the usage count will again drop to 0 if it is not used in any post.
by
does that means we do not have to do  anything to the qa_tagwords table and the wordid will be inserted there as well?
by
That's right, they're automatically managed. Just add a question with a new tag and you'll see the tag is suggested for future questions
...