karmi/tire — Issue #212: Tags strategy with ActiveRecord
Author: amnesia7
Created: 2012-01-21 11:01:31+00:00
State: open

I am just creating an app that uses ActiveRecord and each [let's say] article has many tags.

I want both the article and the associated tags to be searchable.

The easiest implementation of Tire looks to be to have the tags in a field on the Articles db table but ideally I would like to use an autosuggest for tags when a user is adding them to an article to help them use tags that have already been used (match spelling, hyphenating, etc). The autosuggest requirement makes me think that tags should be in their own article_tags db table and linked back to Articles using an article_id. However, this would require the search to use the "load" method (https://github.com/karmi/tire/commit/84f015da749245acc4f1d7bcb5851131c9efb582) between the Articles table and the Tags table.

Does the load method support joining tables if I didn't want to store the same tag, ie Articles, Tags and then a link table (article_id | tag_id)?

I suppose autosuggest may be overkill if ES/Tire can allow a user to search articles for "motorbike" and still find articles with "motorbiking", "motor bikes" or "motor-bike", is this done using fuzzy search & how much it affect search performance?

How does the load method affect the search performance because I will also be 'slowing' the search down by returning articles ordered using geo location?

Can anyone suggest a strategy for applying tags for ActiveModel that would be as straight-forward to implement as possible with ES and Tire and could still offer the option of autosuggest?

I haven't applied tags in any way yet so this section is a blank canvas at the moment...