If you are here it is assumed that you know what Solr is and want to setup your Windows environment so that you can take advantage of its power. The steps are pretty straight foreward and I was able to get a development environment up and running within a few minutes.
If you don't know what Solr is, it is worth the time investigating click here. Just keep in the top of your mind that it doesn't replace your DBMS system; it supplements it by providing a very powerful indexing service that can be easily queried. Where your DBMS will hold normalized table structures Solr is intended to take data, that you might put in denormalized views/tables (to speed up queries), and places it in lighting fast indexes. The data it returns, i.e., primary keys, can be used to query more detailed results from your DBMS.
- Ensure Java is installed and up to date click here
- Ensure the Java SE Runtime Environment is installed click here
- Install the latest version of TomCat click here (I installed the 32bit/64bit Windows Service Installer)
- Tip: use port 8983 during install if you want to be compatible with Solr examples/port
- Click on Start | Programs | Appache Tomcat <version> | run "Configure Tomcat" as administrator and on the General tab click [Stop] button (so we can configure Tomcat)
- Tip: leave window open because we will [Start] it again in step 5.
- Install Solr by downloading the Solr application from the "Get Started" section (I installed 3.1.0) click here
- After you unzip the appache-solr-(version) file, copy the the .war file (there will be only one) to
c:\Program Files\Apache Software Foundation\Tomcat<version>\webapps\solr.war
- From the unzipped contents, copy the \example contents (it will have a start.jar file) to a location on your harddrive, e.g., d:\Tomcat\Solr. This will be your Solr Home folder in Tomcat.
- Configure the Java Options: so that it knows where the Solr home folder is, e.g.,
- Click [Start] button (step 3) - you should be able to access the Solr site by typing in the following: http://localhost.:8983/solr - you will be greeted with a "Welcome to Solr!" page which will have a link that takes you to the Solr Admin page.
- Tip: note that I have a period between localhost and the :8983. This little trick will allow Fiddler to capture events so that you can analyze GET and POST syntax.
- Up to this point all went rather smoothly - the problem I encountered was there was no data to play with and the instructions assumed I was on a Unix or Mac OS system. If you want to play with the sample data and run the tutorials you'll need to download Cygwin click here
- IMPORTANT: when you get to the "Select Packages" page you will need to search for "curl", click [View] and check the checkbox for the Net | curl: Multi-protocol file transfer command-line tool. Without this the post.sh will complain that it cannot find "curl"
- The folder you run cygwin.exe from will become the location for the Unix environment. You will want to go to the <installed path>\cygwin\home\YourLoginName folder and copy the example folder from step 4 to this folder
- Double-click the newly installed cygwin icon and you will see the following prompt:
- Type cd example/exampledocs to change directory the example documentation section
- Type ls -al (comparable to dir command) to see a directory - you should see .xml files
- type in ./post.sh *.xml to import the sample data
Now if you run the tutorials http://lucene.apache.org/solr/tutorial.html you will be able to click on tutorial links and see actual results from your local Solr web application!