GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
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:
# associated_model.attribute in this case tag model name field
indexes tags.name, 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!
@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!