Monday, December 14, 2009

Installing LocalSolr onto Solr 1.4 Server (Step by Step)


I created this guide, so you don't have to go through the 2 days of hell I had to go through. Mainly trawling countless websites that all seemed to contradict them selves.. However this is how i managed to get LocalSolr working on my Solr Server. Enjoy


Before you start using LocalSolr, you'll need to install solr. You can following my guide on installing Solr 1.4 on windows here


  • Download LocalSolr from here
I took a backup of the solr-example.tgz when i wrote this blog in case they remove the link or update the files inside
  • Extract to a temporary folder
  • Next you'll have to update your solrconfig.xml file
  • Add the following code to your solrconfig.xml file

      <processor class="">
        <str name="latField">lat</str>
        <str name="lngField">lng</str>
  <int name="startTier">4</int>
        <int name="endTier">25</int>
   <processor class="solr.RunUpdateProcessorFactory" />    
   <processor class="solr.LogUpdateProcessorFactory" /> 

<searchComponent name="localsolr" class="" />

<requestHandler name="geo" class="org.apache.solr.handler.component.SearchHandler">
 <!-- default values for query parameters -->
     <lst name="defaults">
       <str name="echoParams">explicit</str>
       <int name="rows">10</int>
       <str name="fl">*</str>
       <str name="version">2.1</str>
    <arr name="components">

Here you can see where I added the lines to the existing file (Click image to see large version).

  • Next you'll have to update your schema
  • Add the following code to your schema.xml file

<field name="lat" type="tdouble" indexed="true" stored="true"/>
<field name="lng" type="tdouble" indexed="true" stored="true"/>
<field name="geo_distance" type="tdouble"/>
<dynamicfield name="_local*" type="tdouble" indexed="true" stored="true"/>

  • Stop Apache TomCat Service
  • Delete contents of the Data Folder
  • Copy 2 files from the extract folder
  • to your solr\lib folder
  • Start Apache TomCat Service
  • Perform a solr Geo Search

  • Check normal searches still work*%3A*&version=2.2&start=0&rows=10&indent=on

  • Try adding some data to Solr and Re-doing both searches
  • Remember that the geo search also requires a text query. So make sure you include text that's indexed.

I used the following reference sites when creating this guide:


  1. References can be found:

  2. i did a fresh 1.4 install and tested it, worked fine. then changed config and schema as above but now get:

    "java.lang.NoClassDefFoundError: org/apache/solr/handler/component/SearchComponent"

    i am on linux, not windows. if anyone has any ideas that'd be great.

  3. Thanks for the post, could you comment on the reason to use triedouble vs sortabledouble fields for the lat and lng?


  4. i was thinking about creating a blog too and your post has helped me where to look. i just hope it gets closer to as good as yours then i am all set

  5. Thanks for the post, could you comment on the reason to use triedouble vs sortabledouble fields for the lat and lng?
    Eyelash extensions las vegas

  6. Very nice article to know more about the Karatbars go the website

  7. was propelled in 2018 and has a very decent reach to the individuals. Time by time it is being famous among the clients around the world. There are numerous explanations behind this.