Search Smith

ColdFusion, SQL queries, and, of course, searching

ColdFusion: Running Solr on Jetty

Posted by David Faber on February 24, 2012

Lucid Imagination has a brief but helpful post on running Solr on Jetty. In ColdFusion 9, Solr runs on Jetty by default (at least under Windows – not sure about Linux or Solaris and I don’t have any information about CF 10). The jetty.xml file can be found under <CF_HOME>/solr/etc/jetty.xml. On a single-instance installation under Windows, then, it would be located under C:\ColdFusion9\solr\etc\jetty.xml.

In order to change the port on which Jetty listens, edit the following (lines 64-78 on the default CF Solr install):

<!-- Use this connector if NIO is not available. -->
<!-- This connector is currently being used for Solr because the
nio.SelectChannelConnector showed poor performance under WindowsXP
from a single client with non-persistent connections (35s vs ~3min)
to complete 10,000 requests)
-->
<Call name="addConnector">
  <Arg>
    <New class="org.mortbay.jetty.bio.SocketConnector">
      <Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
      <Set name="maxIdleTime">50000</Set>
      <Set name="lowResourceMaxIdleTime">1500</Set>
    </New>
  </Arg>
</Call>

Change the value of 8983 to a different port and then restart the ColdFusion Solr service. Solr should now be listening on a different port.

2 Responses to “ColdFusion: Running Solr on Jetty”

  1. Rhys Jones said

    Hi David, thanks for the great posts on Solr/CF. I’m new to the whole Solr universe and am diving into it headfirst with a new search strategy at my company. I am wondering where to look for information regarding updating the Solr engine that CF works with. It is my understanding that it can be done and is highly recommended. Any thoughts/direction would be appreciated.

  2. David Faber said

    Hi Rhys, I’m afraid I don’t have any experience with that. My understanding is that it can be done; but how easy it is I don’t know. I suppose it would be recommended in the sense that the version of Solr installed with CF 9 by default is over 3 years old! I know there are a number of new features in Solr 3.5 & 4 that I would like to be able to use. It might be worthwhile to try and install a standalone version of Solr and use that with your CF application instead.

Leave a Comment

Your email address will not be published. Required fields are marked *