tag-cloud

Optimal data architecture for tagging, clouds, and searching (like StackOverflow)?

為{幸葍}努か 提交于 2019-12-03 01:33:05
问题 I'd love to know how Stack Overflow's tagging and search is architected, because it seems to work pretty well. What is a good database/search model if I want to do all of the following: Storing Tags on various entities, (how normalized? i.e. Entity, Tag, and Entity_Tag tables?) Searching for items with particular tags Building a tag cloud of all tags that apply to a particular search result set How to show a tag list for each item in a search result? Perhaps it makes sense to store the tags

How to design a MySql Table for a Tag Cloud?

♀尐吖头ヾ 提交于 2019-12-02 21:12:55
I have articles on my site, and I would like to add tags which would describe each article, but I'm having problems with design mysql table for tags. I have two ideas: each article would have field "tags", and tags would be in format: "tag1,tag2,tag3" create other table called tags with fields: tag_name, article_id So when I want tags for article with ID 1, I would run SELECT ... FROM tags WHERE `article_id`=1; But, I would also like to know 3 most similar articles by comparing tags, so if I have article which has tags "php,mysql,erlang", and 5 articles with tags: "php,mysql", "erlang,ruby",

Optimal data architecture for tagging, clouds, and searching (like StackOverflow)?

陌路散爱 提交于 2019-12-02 13:48:59
I'd love to know how Stack Overflow's tagging and search is architected, because it seems to work pretty well. What is a good database/search model if I want to do all of the following: Storing Tags on various entities, (how normalized? i.e. Entity, Tag, and Entity_Tag tables?) Searching for items with particular tags Building a tag cloud of all tags that apply to a particular search result set How to show a tag list for each item in a search result? Perhaps it makes sense to store the tags in a normalized form, but also as a space-delimited string for the purposes of #2, #4, and perhaps #3.

Solr powered Tag Cloud

妖精的绣舞 提交于 2019-12-02 00:00:05
I seem to be stuck behind the logic of a Solr faceting-powered tag cloud. First of all, I'm using OpenNLP to parse my docs and obtain relevant words out of it, so every single document gets split into n number of words. And here's basically what my Solr response looks like: <docID> <title>My Doc Title</title> <content>My Doc Title</content> <date_published>My Doc Title</date_published> </docID> I believe there must be a way to integrate the words in here. I first thought of something like this: <docID> <title>My Doc Title</title> <content>My Doc Title</content> <date_published>My Doc Title<

Solr powered Tag Cloud

痞子三分冷 提交于 2019-12-01 23:20:12
问题 I seem to be stuck behind the logic of a Solr faceting-powered tag cloud. First of all, I'm using OpenNLP to parse my docs and obtain relevant words out of it, so every single document gets split into n number of words. And here's basically what my Solr response looks like: <docID> <title>My Doc Title</title> <content>My Doc Title</content> <date_published>My Doc Title</date_published> </docID> I believe there must be a way to integrate the words in here. I first thought of something like

Symfony2 - Need help setting up a doctrine query for finding tags

妖精的绣舞 提交于 2019-12-01 21:02:41
I've been looking far and wide and still haven't been able to find an example of how to setup a query to look for a specific 'tag' that the user selects from a sidebar which in turn will bring up all posts with that tag. I understand how to find all tags, but not to find a specific selected by the user. blogrepository public function getTags($tags) { $qb = $this->createQueryBuilder('b'); $qb->select('b') ->join('b.tags', 'tag') ->where('b.tags LIKE ?', '%'.$tags.'%'); return $qb->getQuery()->getResult(); } blog entity /** * @var string * * @ORM\Column(name="tags", type="text") */ private $tags

How to model tags in the database?

被刻印的时光 ゝ 提交于 2019-11-30 03:37:24
问题 I have an existing webapp and want to add a tag feature so that users can tag existing objects. The question is should I add a tag column to each object? or should I normalize it and use a tag table where each object will have a collection of tags? I am leaning towards the latter because it feels cleaner, easier to report on and easier to create a tag cloud. But since I know this has been solved 1000 times I wanted to ask and see if I am missing something? 回答1: Do you foresee users needing to

What's the best way to generate a tag cloud from an array using h1 through h6 for sizing?

心已入冬 提交于 2019-11-29 23:08:48
I have the following arrays: $artist = array("the roots", "michael jackson", "billy idol", "more", "and more", "and_YET_MORE"); $count = array(5, 3, 9, 1, 1, 3); I want to generate a tag cloud that will have artists with a higher number in $count enclosed in h6 tags and the lowest enclosed h1 tags. berkes You will want to add a logarithmic function to it too. (taken from tagadelic, my Drupal module to create tag clouds http://drupal.org/project/tagadelic ): db_query('SELECT COUNT(*) AS count, id, name FROM ... ORDER BY count DESC'); $steps = 6; $tags = array(); $min = 1e9; $max = -1e9; while (

What's the best way to generate a tag cloud from an array using h1 through h6 for sizing?

社会主义新天地 提交于 2019-11-28 19:25:19
问题 I have the following arrays: $artist = array("the roots", "michael jackson", "billy idol", "more", "and more", "and_YET_MORE"); $count = array(5, 3, 9, 1, 1, 3); I want to generate a tag cloud that will have artists with a higher number in $count enclosed in h6 tags and the lowest enclosed h1 tags. 回答1: You will want to add a logarithmic function to it too. (taken from tagadelic, my Drupal module to create tag clouds http://drupal.org/project/tagadelic): db_query('SELECT COUNT(*) AS count, id

Tag Cloud in C#

拜拜、爱过 提交于 2019-11-28 16:21:33
问题 I am making a small C# application and would like to extract a tag cloud from a simple plain text. Is there a function that could do that for me? 回答1: Building a tag cloud is, as I see it, a two part process: First, you need to split and count your tokens. Depending on how the document is structured, as well as the language it is written in, this could be as easy as counting the space-separated words. However, this is a very naive approach, as words like the, of, a, etc... will have the