Web Software Architecture and Engineering – Life on the Bleeding Edge

Previously, in Part 3 of this series, I blogged about some difficulties in working with Solr. I am following up with some more lessons learned.
This is a big one. Upgrading to the latest Solr. The Solr that comes with Adobe ColdFusion 9.0.1 is a slightly customized (from what I can tell) version of a Solr pre-1.4.0 release. It’s almost a year old!
I was having some trouble with some of my custom enhancements, so i decided to upgrade to Solr 1.4.1.
Before I dive into details, I have to give a shout to Vinu Kumar and Kunal Saini (Adobe Engineers) who confirmed some details and pointed me in the right direction.

  1. Shut down the Solr Search Service (obvious)
  2. You’ll notice in your $coldfusionSolrInstalldirwebapps dir, there is a WAR file called solr.war. Back this file up somewhere outside this directory.
  3. Download latest Solr zip. Go to apache-solr-1.4.1dist. Notice that apache-solr-1.4.1.war file? Copy to the above directory and rename to solr.war.
  4. Delete all files in the $coldfusionSolrInstalldirwork directory. I believe this is where it expands the WAR’s files.
  5. Start the Solr Search service.

That’s it! You should see new files in the $coldfusionSolrInstalldirwork directory now. But there has to be a catch, right?
Yes there is, but its a small one. Creating new Solr collections via CFAdmin will fail. Why? Because its looking for those tweaks. Is there a workaround? Yes!
And I believe the following work around is reasonable, as most people will not be creating collections all the time. Usually they are created, and its set.
So, all you must do is the following:

  1. Think of a new collection name. Easy. 🙂
  2. When you create a Solr collection (or a Verity one), CFAdmin asks for a “path”. Note that path.
  3. Copy $coldfusionSolrInstalldirmulticore emplateconf*.* to <path><new collection name>conf*.*
  4. Now go to CFAdmin, point it to path=<path> with name=<new collection name>, and voila!

Essentially what happens here, is that once it notices a conf directory exists (which has the CF customization) it no longer freaks out.
That’s it. I’m running Solr 1.4.1 on Windows 2008 R2 64-bit! This is so awesome since I didn’t need to make any other changes, such as JVM settings, and other tweaks, they all carried over!

Advertisements

Comments on: "Lessons Learned: Moving from Verity to Solr (Part 4)" (13)

  1. Very interesting, Sami. What problems has installing the latest Solr version solved for you exactly?

    Also, I wonder why creating collections would fail. I’ve been working with the template/conf files a lot and it seems they get copied to the new collection path anyway when you create one. It’s important to me to be able to create collections via cfcollection rather than manually as per your workaround.

  2. Tom Chiverton said:

    @Julian Halliwell you could just write your own wrapper around cfcollection that automates the copy for you.

    PS Failed the captcha 3 times. It’s too hard.

  3. @Tom, sure, but I was just wondering why that would be necessary since it seems the template folders are copied anyway for each new collection. I would assume this is general Solr behaviour rather than CF-specific but I could be wrong.

    In other words I’d like to understand what it is about upgrading the Solr install that is causing adding new collections to fail. Will try and do some testing of my own later on.

  4. Julian,

    Yeah, I really wasn’t given an explanation why it would fail. Maybe the WAR ignores the /conf template and wants to use its own. I wasn’t really given an explanation why, I was just excited that upgrading wasn’t a big headache.

    Tom,

    Agree, a wrapper to move the conf and use cfcollection seems reasonable.

    As for the captcha, I’ll try to ease it a bit.

  5. Just to confirm, after upgrading to 1.4.1 (great instructions, thanks), creating a collection also fails using cfcollection. The new directory is created but the conf files are not.

    So I added a function to my wrapper cfc (fortunately I was already using one) to create the directory and copy the conf template into it before invoking cfcollection and it appears to work ok.

    So, Sami, could you post on what problems upgrading has solved for you?

  6. Julian,

    Great job.

    And to answer your question, if you look at the difference between Solr 1.4, and 1.4.1, its huge – first off, 1.4.1 uses Lucene 2.9.3 (which has its own list of bug fixes), and then Solr 1.4.1 fixes many of its own.

    I wasn’t satisfied with the results I was getting, and for some reason moving to Solr 1.4.1 did help.

    I would boil it down to two reasons: a number of fixes pertained to memory leaks (a big concern for me), and that I want to be on the latest version so that I can move to replication, and other advanced Solr features.

  7. This was very useful! We found for our collection, the searching accuracy went up with the 1.4.1 version. Thanks so much!

    I am curious, have you tried upgrading it with the later (3.x) release of Solr as well?

  8. […] followed these instructions, where you will also find useful information in the comments. The author has apparently upgraded to […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: