Installing and Running Apache Solr

From this presentation “Introduction to Apache Solr”
How to Install & Run Apache Solr

  1. Download the latest code archive from  Note: on Windows I found the latest would not extract and had to go back one release
  2. Extract this archive with zip or tar
  3. Navigate to example/ folder and type “java –jar start.jar”
  4. Voila, your own completely empty Solr server will be up and running at, you can get to the administrative interface at
  5. To index the example documents so you have something to practice searching, navigate to /example/exampledocs/ and type “java –jar post.jar *.xml”

How to add documents to Solr from a MySql database
Just in case anyone comes especially looking for this, I took it out of my talk

  1. You will need to find and download into the /lib/ directory of your Solr home the MySQL jdbc driver .jar file.
  2. Solr’s Data Import Handler jar file is also not included by default, so you hav to add this to the top of your solrconfig.xml:

<lib dir=”../../../../dist/” regex=”solr-dataimporthandler-.*\.jar” />

  1. Add your update handler to solrconfig.xml and define the configuration file for it:

<requestHandler name=”/dataimport” class=”org.apache.solr.handler.dataimport.DataImportHandler”>
<lst name=”defaults”>
<str name=”config”>db-data-config.xml</str>

  1. Now you need to create your db-data-config.xml in the same directory as solrconfig.xml and schema.xml, here is an example:

•Solr in Action

Leave a Reply

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