tagging

How do I retrieve items that are tagged with all the supplied tags in linq?

大城市里の小女人 提交于 2019-11-27 08:43:58
问题 I seem to be having trouble with this. I have a Task table with an ID, and a Tag table, that has a tag field and a foreign key constraint to the task table. I want to be able to perform AND searches for tasks by tags. So for example, if I search for tasks with the tags "portability" and "testing", I don't want tasks that are tagged with "portability" and not "testing". I tried the following syntax: var tasks = (from t in _context.KnowledgeBaseTasks where t.KnowledgeBaseTaskTags.Any(x => tags

How to add tagging with autocomplete to an existing model in Rails?

梦想的初衷 提交于 2019-11-27 04:58:45
问题 I'm trying to add "tags" to an Article model in a Rails 3 application. I'm wondering if there is a gem or plugin that has adds both the "tagging" functionality in the model and also the auto-complete helpers for the views. I've found acts_as_taggable but I'm not sure if that's what I should be using. Is there something newer? I'm getting results from 2007 when I google acts_as_taggable 回答1: acts_as_taggable_on and rails3-jquery-autocomplete work nicely together to make a SO like tagging

How to implement tag system

六月ゝ 毕业季﹏ 提交于 2019-11-26 23:15:00
I was wondering what the best way is to implement a tag system, like the one used on SO. I was thinking of this but I can't come up with a good scalable solution. I was thinking of having a basic 3 table solution: having a tags table, an articles tables and a tag_to_articles table. Is this the best solution to this problem, or are there alternatives? Using this method the table would get extremely large in time, and for searching this is not too efficient I assume. On the other hand it is not that important that the query executes fast. I believe you'll find interesting this blog post: Tags:

LSA - Latent Semantic Analysis - How to code it in PHP?

狂风中的少年 提交于 2019-11-26 22:46:57
问题 I would like to implement Latent Semantic Analysis (LSA) in PHP in order to find out topics/tags for texts. Here is what I think I have to do. Is this correct? How can I code it in PHP? How do I determine which words to chose? I don't want to use any external libraries. I've already an implementation for the Singular Value Decomposition (SVD). Extract all words from the given text. Weight the words/phrases, e.g. with tf–idf. If weighting is too complex, just take the number of occurrences.

Validate the number of has_many items in Ruby on Rails

╄→尐↘猪︶ㄣ 提交于 2019-11-26 22:04:45
Users can add tags to a snippet: class Snippet < ActiveRecord::Base # Relationships has_many :taggings has_many :tags, :through => :taggings belongs_to :closing_reason end I want to validate the number of tags: at least 1, at most 6. How am I about to do this? Thanks. Nikita Rybak You can always create a custom validation . Something like validate :validate_tags def validate_tags errors.add(:tags, "too much") if tags.size > 5 end sbonami A better solution has been provided by @SooDesuNe on this SO post validates :tags, length: { minimum: 1, maximum: 6 } asukiaaa I think you can validate with

What is the most efficient way to store tags in a database?

不问归期 提交于 2019-11-26 19:16:45
I am implementing a tagging system on my website similar to one stackoverflow uses, my question is - what is the most effective way to store tags so that they may be searched and filtered? My idea is this: Table: Items Columns: Item_ID, Title, Content Table: Tags Columns: Title, Item_ID Is this too slow? Is there a better way? Simon Scarfe One item is going to have many tags. And one tag will belong to many items. This implies to me that you'll quite possibly need an intermediary table to overcome the many-to-many obstacle. Something like: Table: Items Columns: Item_ID, Item_Title, Content

An easy way to support tags in a jekyll blog

天大地大妈咪最大 提交于 2019-11-26 17:15:52
I am using the standard jekyll installation to maintain a blog, everything is going fine. Except I would really like to tag my posts. I can tag a post using the YAML front matter, but how do I generate pages for each tag that can will list all posts for a tag? Brian Clapper This gist will generate a page per category for you: https://gist.github.com/524748 It uses a Jekyll Generator plugin, plus a Page subclass. Christian Specht Here is a solution with alphabetically sorted tags on a single page . It uses Liquid only, which means that it works on GitHub Pages: {% capture tags %} {% for tag in

Validate the number of has_many items in Ruby on Rails

那年仲夏 提交于 2019-11-26 08:09:15
问题 Users can add tags to a snippet: class Snippet < ActiveRecord::Base # Relationships has_many :taggings has_many :tags, :through => :taggings belongs_to :closing_reason end I want to validate the number of tags: at least 1, at most 6. How am I about to do this? Thanks. 回答1: You can always create a custom validation. Something like validate :validate_tags def validate_tags errors.add(:tags, "too much") if tags.size > 5 end 回答2: A better solution has been provided by @SooDesuNe on this SO post

How to implement tag system

浪尽此生 提交于 2019-11-26 07:50:56
问题 I was wondering what the best way is to implement a tag system, like the one used on SO. I was thinking of this but I can\'t come up with a good scalable solution. I was thinking of having a basic 3 table solution: having a tags table, an articles tables and a tag_to_articles table. Is this the best solution to this problem, or are there alternatives? Using this method the table would get extremely large in time, and for searching this is not too efficient I assume. On the other hand it is

What is the most efficient way to store tags in a database?

空扰寡人 提交于 2019-11-26 06:52:16
问题 I am implementing a tagging system on my website similar to one stackoverflow uses, my question is - what is the most effective way to store tags so that they may be searched and filtered? My idea is this: Table: Items Columns: Item_ID, Title, Content Table: Tags Columns: Title, Item_ID Is this too slow? Is there a better way? 回答1: One item is going to have many tags. And one tag will belong to many items. This implies to me that you'll quite possibly need an intermediary table to overcome