tagging

Efficient implementation of faceted search in relational databases

一个人想着一个人 提交于 2019-11-28 16:50:58
问题 I am trying to implement a Faceted search or tagging with multiple-tag filtering. In the faceted navigation, only not-empty categories are displayed and the number of items in the category that are also matching already applied criteria is presented in parenthesis. I can get all items having assigned categories using INNER JOINs and get number of items in all category using COUNT and GROUP BY, however I'm not sure how it will scale to millions of objects and thousands of tags. Especially the

TTL for a set member

笑着哭i 提交于 2019-11-28 15:56:03
问题 Is it possible in Redis to set TTL (time to live) not for a specific key, but for a member for a set? I am using a structure for tags proposed by Redis documentation - the data are simple key-value pairs, and the tags are sets containing keys corresponding to each tag, e.g. > SETEX id:id_1 100 'Lorem ipsum' OK > SADD tag:tag_1 id:id_1 (integer) 1 The key id:id_1 will expire as expected but i don't see an efficient way to remove the corresponding member from the tag:tag_1 set. One way I came

how can i create a tagging system using php and mysql?

流过昼夜 提交于 2019-11-28 14:57:16
问题 wondering how i can create a tagging system in php and with a mysql database, my initial thoughts were to create a row in the table where the articles are stored, named tags, and list the tags seperated by commas, but i am not sure how i can create a query that searches for matching tags, i dont want to have to query every article everytime someone clicks a tag. can anyone help? 回答1: You're describing a many-to-many relationship between Articles and Tags. You'd want to use an intermediate

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

一笑奈何 提交于 2019-11-28 14:26:03
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.Contains(x.tag)) select KnowledgeBaseTaskViewModel.ConvertFromEntity(t) ).ToList(); This of course does

How to auto-tag content, algorithms and suggestions needed

北城余情 提交于 2019-11-28 14:09:48
问题 I am working with some really large databases of newspaper articles, I have them in a MySQL database, and I can query them all. I am now searching for ways to help me tag these articles with somewhat descriptive tags. All these articles is accessible from a URL that looks like this: http://web.site/CATEGORY/this-is-the-title-slug So at least I can use the category to figure what type of content that we are working with. However, I also want to tag based on the article-text. My initial

‘Machine tags’ referencing model instances in Django

自古美人都是妖i 提交于 2019-11-28 12:55:14
问题 Example problem Say, you have models Publication , Photo , Event and Person ; they could relate to each other in different ways. Particularly, publications can have 1) some illustrations (related photos) and 2) some mentioned personas. Events can have some 3) photos and 4) people related as well. Also, 5) events could be mentioned in publications. No additional data needs to be associated with relationships, except for illustrations: they need a position field for sorting. So in that case (#1

How do i implement tag searching? with lucene?

不问归期 提交于 2019-11-28 04:35:28
I havent used lucene. Last time i ask (many months ago, maybe a year) people suggested lucene. If i shouldnt use lucene what should i use? As am example say there are items tagged like this apples carrots apples carrots apple banana if a user search apples i dont care if there is any preference from 1,2 and 4. However i seen many forums do this which i HATED is when a user search apple carrots 2 and 3 have high results while 1 is hard to find even though it matches my search more closely. Also i would like the ability to do search carrots -apples which will only get me 3. I am not sure what

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

▼魔方 西西 提交于 2019-11-28 02:48:30
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 Tim Santeford acts_as_taggable_on and rails3-jquery-autocomplete work nicely together to make a SO like tagging system see example below. I don't think a suitable all in one option exists yet for rails. Follow

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

泄露秘密 提交于 2019-11-27 19:11:31
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. Build up a matrix: The columns are some documents from the database (the more the better?), the rows

Rails 3 Order By Count on has_many :through

怎甘沉沦 提交于 2019-11-27 16:24:50
问题 I have an application where I can list Items and add tags to each Item. The models Items and Tags are associated like this: class Item < ActiveRecord::Base has_many :taggings has_many :tags, :through => :taggings end class Tagging < ActiveRecord::Base belongs_to :item belongs_to :tag end class Tag < ActiveRecord::Base has_many :taggings has_many :items, :through => :taggings end So, this many-to-many relationship allows me to set n tags for each Item, and the same tag can be used several