indexing tags using Thinking Sphinx #276

sabernar opened this Issue Aug 14, 2012 · 5 comments


None yet
3 participants

Is there a way to get an object's tags indexed with the object when using Thinking Sphinx as the search engine?

hello? anyone home?

This is exactly what I'm trying to do. According to rails casts you should be able to search using associations via a construct similar to:

define_index do
     # associated_model.attribute in this case tag model name field
     indexes, as: :upload_tags

But that doesn't seem to work. The reason it doesn't work might be because Name is a reserved method name but I can't say for sure.

Sabernar, I recommend you check out the sunspot_rails gem. The syntax isn't too far off from Sphynx and unlike Sphynx it automatically indexes new records. Sunspot also seems to cater to a lot more search options and had no problem at all searching my Upload model's tags. If you check it out let me know if you're having trouble and I can give you a hand.

As you might be able to see between the time stamps of this post and my last one it took me less than a couple of hours to get all setup. I recommend checking out the sunspot rails cast if you're interested.

The problem with using sunspot is that my production server is Heroku and I was looking for a hosted search solution, which Flying Sphinx is. I know that Heroku has a Solr add-on, but I believe that it is something that you have to administer yourself, which I'd prefer not to do at this time.

Thanks for the recommendation!


tilsammans commented Apr 10, 2013

@sabernar @jpeters98 I assume there is a way to get the tags into a full-text search engine, but it is not an issue with this plugin. You should be able to reach into your tag_list, or if that fails into the tags directly.

If you feel I can be of any help, do let me know!

@tilsammans tilsammans closed this Apr 10, 2013

@SeTeM SeTeM referenced this issue in pat/thinking-sphinx Jul 21, 2014


TSv3 + acts_as_taggable_on #802

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment