Reputation: 1186
We are utilizing sunspot's Solr gem for a while in development mode. The application is now needs to be moved to production environment.
Are there any cons of setting up solr in production environment using the bundled sunspot gem ?
I generally like tomcat + solr idea but it's more complex to set up.
Sunspot bundled gem is easy. Provided that we have 1 rails project in 3 stages (staging,production,QA), 2 app servers and one db/solr server one has to :
Above is applicable for X instances of production/staging solrs.
Tomcat6 + Sunspot is not so easy and time/result effective. As I understand (fix me) one has to :
Upvotes: 4
Views: 724
Reputation: 5651
I did something similar lately and had to answer the same questions. My problem space looked like having two languages (so preferably two cores and maybe more for other search options in future), having to index data over several table and search/count facets, partly in hierarchical structures like product groups and hierarchical tags like car_brand/model/type/build_year.
As far as I have seen sunspot works best (only) if you have relative 'flat' data, at best simply have to define for a single model which fields to use. The moment you need to combine several models into a single document for facets, it becomes difficult. (But since I didn't use Sunspot I can't really tell for sure). You can (and should) still use the rsolr gem for the communication with Solr. But if you use Sunspot in development, it is most likely working for you anyway.
For your details about the tomcat thing:
yes, some work but can be handled
I used multi core. It's not really difficult to set up. You are better off learning a bit about Solr configuration anyway. Largest part of multi core is just having two sub directories that contain essentially the same set of XML config files.
have to do this anyway :)
Yes, write a few scripts. Alternately you could have a git repo that contains the tomcat/solr folders and Rails project folder or symlink those folders. I haven't found a good solution yet and have to copy a bit stuff once in a while.
yep, a few symlinks can help to keep things easy
Only if the deploy actually changes anything related to your search. Have a few scripts. There are Rails deployment solutions that would help, but as I do not mind to do a few things manually I didn't bother to install.
All in all I think I have more control and insight into the configuration of Solr and can better use some of it's more complex features like facets with hierarchies. Actually Solr may look a bit complicated at first, but after some time you get into it and then it becomes a great tool.
Upvotes: 3