Installing and Running Solr 1.4 on Windows / Tomcat

Installing and Running Solr 1.4 on your local machine for testing is as easy as pie.

Here I am going cover the steps needed to get Solr running on Tomcat 6.0 on a Windows machine. In our production environment we run Solr on Ubuntu 9.10 Server Edition in Tomcat as the servlet container, but that’s a story for another day.

(1) What is Solr
Solr is an enterprise search server based in the open source community. Out of the box it offers features such as a convenient HTTP/XML interface, keyword search highlighting, faceted navigation (like categories), spell correction, auto-suggest queries and an admin interface to manage your index. Under the hood, Solr relies on Apaches’ Lucene text search engine library. Lucene is “the bomb”, but Solr is definitely the delivery mechanism.

Let’s say for instance you had a database with millions of records properly normalized as a good database should be. Searching such a behemoth could be challenging, not to mention taxing on the server itself. Databases were “made to query”, but sometimes we have to weigh up the cost of performance implications in running ad hoc queries against a transactional database searching and joining multiple tables. Searching a pharmaceutical database for let’s say the word “headache” would yield thousands of records – everything from symptoms to side effects etc.

Indexing such data to a dedicated search repository would be ideal. The data is actually updated very infrequently as opposed to it being queried thousands of times a day by users. This would ease the load on your database and provide a better user experience to the end user. we are trying to create solutions, not create more headaches.

(2) Installing Tomcat
Go to http://tomcat.apache.org/ and download Tomcat 6.x, choose the Windows Service Installer under “Binary Distributions”. If you already have Tomcat installed, good for you. Apache rules.

Double click the downloaded file and follow the installation instructions. Normally Tomcat would install by default on port 8080. Once the installation is complete, open a new browser window, and go to http://127.0.0.1:8080/

Tomcat should be running screaming fast as always. Ok, now stop it by finding the little “Play” button with a feather in the taskbar. Right click it and select “Stop Service”.

(3) Deploying Solr 1.4
Go to: http://lucene.apache.org/solr/ and find the download link for Solr 1.4. Download the apache-solr-1.4.0.zip file, and unzip it to any location on your system. In the “apache-solr-1.4.0/dist” folder, make a copy of the “apache-solr-1.4.0.war” file and rename it to “solr.zip”. Unzip it in the current location.

(3.1) Setting “solr/home”
Open the web.xml file in Notepad located in the Solr/WEB-INF folder. At the top of the file, find the <env-entry> section. It should be commented out by default. Make a copy of it, and move it to the bottom of the file:

<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>C:\solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>

Set the <env-entry-value> to C:\solr and close the file. Your solr/home is now now set.

Move back to the root of the solr folder, and select all the files and folders e.g. admin, META-INF, WEB-INF, favicon.ico and index.jsp – and zip them back into a file calles solr.zip. Rename this file to solr.war.

Copy the solr.war file to Tomcats’ “webapps” directory.

Again, from the “apache-solr-1.4.0/example” folder, copy the “solr” folder as a template for your solr home. Past it into you c:\ drive e.g. C:\solr.

At this point, Tomcat is still stopped, now Start it again. This will cause the servlet container (Tomcat) to deploy the .war file as a web application within Tomcat, pointing to C:\solr as the solr/home.

Open a new browser window and go to: http://127.0.0.1:8080/solr. If everything went as planned, you’ll get the “Welcome to Solr!” page, with a hyperlink just below it “Solr Admin”.

If not, inspect Tomcats’ log files under Tomcat 6.0/logs/catalina.2010-01-19.log. The datepart should be the current date.log. Scroll to the bottom of the file and read the SEVERE messages carefully. Usually the solr/home isn’t properly set or the JAVA_HOME is missing, but you should have picked this up if  Tomcat never started successfully.

Congratulations, solr is running. Click the “Solr Admin” link to go to the Admin interface. Probably the most important thing here is the [SCHEMA BROWSER] link. The FIELDS section is what you current index schema looks like.

Be sure to check out http://wiki.apache.org/solr/FrontPage

The Solr wiki has excellent examples to help you along.

1,282 Comments to “Installing and Running Solr 1.4 on Windows / Tomcat”

  1. Immobilier locatif Bretagne 22 August 2011 at 10:31 pm #

    Hello There. I found your blog using msn. This is a very well written article. I will make sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll definitely comeback.

  2. Scellier Bretagne 23 August 2011 at 12:11 am #

    I would like to point out my respect for your generosity giving support to people who must have assistance with this important study. Your real commitment to getting the solution along ended up being rather insightful and have without exception permitted most people much like me to reach their desired goals. Your useful hints and tips can mean a whole lot a person like me and especially to my mates. Best wishes; from all of us.

  3. london digital agency 23 August 2011 at 1:02 am #

    Magnificent beat ! I would like to apprentice while you amend your site, how could i subscribe for a blog website? The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear concept

  4. Investir Bretagne 23 August 2011 at 2:45 am #

    I want to show some appreciation to this writer just for bailing me out of this instance. After exploring through the internet and seeing views which were not pleasant, I believed my entire life was over. Existing without the answers to the difficulties you have solved by way of your main guide is a serious case, as well as the kind which may have negatively damaged my entire career if I had not come across your website. Your personal skills and kindness in taking care of a lot of things was important. I don’t know what I would’ve done if I had not come upon such a thing like this. It’s possible to now look ahead to my future. Thank you so much for your specialized and results-oriented help. I will not be reluctant to recommend your site to any person who needs and wants guidelines about this subject.

  5. Investissement Bretagne 23 August 2011 at 2:51 am #

    Hello, i think that i saw you visited my site thus i came to “return the favor”.I am trying to find things to improve my web site!I suppose its ok to use some of your ideas!!

  6. lingnarence 23 August 2011 at 5:25 am #

    And how it to paraphrase?
    [b][url=http://scianki-biurowe.com/przedsiebiorcoprowadz-firme-w-biurze/2011/06/12/]biura łódź[/url][/b]

  7. מתקין מזגנים 23 August 2011 at 6:26 am #

    היי קבלו אתר עם שירות ללקוחות פרטיים ועסקיים . מזגנים מפוצלים, עיליים, מיני מרכזי, תעשייתים,קירור מים (WATER SOURCE). שלט למזגן, טכנאי מזגנים, מזגן מרכזי ועוד…

  8. outdoor wall fountain…

    [...]the time to read or visit the content or sites we have linked to below the[...]…

  9. כסאות בר 23 August 2011 at 8:09 am #

    what are you People I want reporter segment very interesting I enjoyed very , should read it important to mention direct on Site Teertoali of Hanutperama name Status deals promotion projects of office furniture Design office modern . addition to Support personal we store Great central Israel niche This .

  10. Investir Bretagne 23 August 2011 at 8:50 am #

    Heya I’m for the first time here. I found this board and I find It really useful & it helped me out much. I hope to give something back and help others like you helped me.

  11. Investissement Bretagne 23 August 2011 at 9:05 am #

    I think this is one of the most important information for me. And i am glad reading your article. But should remark on some general things, The web site style is perfect, the articles is really excellent : D. Good job, cheers

  12. Défiscalisation Bretagne 23 August 2011 at 9:09 am #

    Hello.This post was really interesting, particularly because I was searching for thoughts on this matter last Wednesday.

  13. מיזוג אויר 23 August 2011 at 4:18 pm #

    היי קבלו אתר עם שירות ללקוחות פרטיים ועסקיים . מזגנים מפוצלים, עיליים, מיני מרכזי, תעשייתים,קירור מים (WATER SOURCE). מיזוג אוויר, מזגן מרכזי, טכנאי מזגנים ועוד…

  14. scrapebox list 23 August 2011 at 5:44 pm #

    As a Newbie, I am permanently browsing online for articles that can be of assistance to me. Thank you

  15. BETHANY BEACH REALTORS 23 August 2011 at 5:45 pm #

    I agree that theres a risk, but if hed been on the field against the Giants, we wouldnt have lost

  16. Tommy Zachar 23 August 2011 at 7:55 pm #

    Hello Web Admin, I noticed that your On-Page SEO is not that great, for one you do not use all three H tags in your post, also I notice that you are not using bold or italics properly in your SEO optimization. On-Page SEO means more now than ever since the new Google update: Panda. No longer are backlinks and simply pinging or sending out a RSS feed the key to getting Google PageRank or Alexa Rankings, You now NEED On-Page SEO. So what is good On-Page SEO?First your keyword must appear in the title.Then it must appear in the URL.You have to optimize your keyword and make sure that it has a nice keyword density of 3-5% in your article with relevant LSI (Latent Semantic Indexing). Then you should spread all H1,H2,H3 tags in your article.Your Keyword should appear in your first paragraph and in the last sentence of the page. You should have relevant usage of Bold and italics of your keyword.There should be one internal link to a page on your blog and you should have one image with an alt tag that has your keyword….wait there’s even more Now what if i told you there was a simple WordPress plugin that does all the On-Page SEO, and automatically for you? That’s right AUTOMATICALLY, just watch this 4minute video for more information at. WordPress Seo Plugin

  17. Real estate dover de 23 August 2011 at 7:57 pm #

    Tonights game was rough, but hey thats football and a lot of time its the team with the most to prove or the most to lose that come up the biggest in games like these. The Giants would have probably been done for the season if they dropped one more game, and they played this one like it mattered. All in all, Im not too upset with this game, there was a defensive collapse of sorts and Special Teams could have performed better but nothing I saw said it cant be fixed. Offense still did a pretty good job and thats something to talk about. Tony Romo didnt cost us the game either.

  18. rick perry august 13 time announcement 23 August 2011 at 8:18 pm #

    Pretty solid post. I just came across your site and wanted to inform that I possess actually appreciated reading through your notions. Anyway I’ll be coming back and i also hope you post over again soon.

  19. מזגן מיני מרכזי 23 August 2011 at 8:51 pm #

    היי קבלו אתר עם שירות ללקוחות פרטיים ועסקיים . מזגנים מפוצלים, עיליים, מיני מרכזי, תעשייתים,קירור מים (WATER SOURCE). התקנת מזגן, שלט למזגן, גז מזגנים ועוד…

  20. karty 24 August 2011 at 12:26 am #

    Excellent post. I was checking continuously this blog and I am impressed! Extremely useful info specifically the last part :) I care for such info a lot. I was looking for this particular info for a long time. Thank you and best of luck.

  21. שולחן משרדי 24 August 2011 at 1:03 am #

    Good Morning Forum Members I want connected Article best Hot I enjoyed very , desirable watch it important to mention also recommend on Site Teertoali of office furniture import company Status specialized promotion in of office furniture Planning optimized contemporary. also Help excellent we company professional State of Israel niche the office furniture .

  22. Zäune 24 August 2011 at 1:32 am #

    Metallzäune

  23. התקנת מזגן 24 August 2011 at 1:44 am #

    היי קבלו אתר עם שירות ללקוחות פרטיים ועסקיים . מזגנים מפוצלים, עיליים, מיני מרכזי, תעשייתים,קירור מים (WATER SOURCE). טכנאי מזגנים, שירות מזגנים, גז מזגנים ועוד…

  24. Zach Miller Jersey 24 August 2011 at 3:23 am #

    I study your placement regularly and I ethical thought I’d announce ‘ keep up the salubrious work!

  25. Juan Cimo 24 August 2011 at 10:43 am #

    I like this post, enjoyed this one appreciate it for posting.

  26. OffifeSop 24 August 2011 at 10:44 am #

    naturally like your web-site but you need to check the spelling on quite a few of your posts. A number of them are rife with spelling problems and I find it very troublesome to tell the truth nevertheless I will certainly come back again.
    [b][url=http://palletplast.eu/granit-idealny-surowiec-do-wykonania-podlg-i-schodw/]granit [/url][/b]

  27. Cheap@Generic.Advair.25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg” rel=”nofollow”>…

    Buygeneric drugs mby…

  28. John1225 24 August 2011 at 10:22 pm #

    Hello!
    kamagra , vimax , buy generic pills online , viagra , buy cialis ,

  29. John1225 24 August 2011 at 10:28 pm #

    Hello!
    online licensed drugstore , acheter viagra , compra cialis , accutane , adipex ,

  30. arb 25 August 2011 at 8:45 am #

    It is vital, subsequently, in order that whatever untrusted articles and other content in which creates part of a web site always be located even on a numerous origin rather than any fragile content and articles regarding of which online site. Untrusted content can easily spoof every other internet page for a passing fancy foundation, read details by in which beginning, contribute to scripts in that , location of creation in order to carryout, publish creates so that you can and even with who beginnings even if there’re preserved right from cross-site get forgery problems from unique tokens, plus utilise whatever third-party means come across or maybe the law issued to that beginnings

  31. apolunes 25 August 2011 at 9:02 am #

    It is important, subsequently, in order that virtually any untrusted content material in which varieties element of an affiliate site get located using a diverse source in comparison with any specific receptive subject matter concerning which usually website. Untrusted content and articles in many cases can spoof all other website about the same foundation, read through info by of which starting point, reason scripts because decent that will execute, put in styles to and additionally from that will decent even though they are simply secured right from cross-site demand forgery episodes simply by exceptional tokens, and also benefit from every third-party methods subjected to or perhaps protection under the law given to this beginning

  32. khantisari666 25 August 2011 at 9:49 am #

    Bejubel Market place Terbaik Indonesia


Leave a Reply