Prerequisites for this exercise:
• Apache Solr 1.4.1 ( or some other release)
• Eclipse WTP
• Apache Tomcat 6.x
Steps are:
1. Extract Solr-1.4.1 release into C:\ Drive. For my example, directory is C:\apache-solr-1.4.1
2. Launch Eclipse and create a workspace, say solr-workspace
3. Import apache-solr-1.4.1.war file in your workspace by clicking on FIle -> Import,
Select Web --> War as the Import Source.
WAR File: C:\apache-solr-1.4.1\dist\apache-solr-1.4.1.war
Web Project: apache-solr-1.4.1
Click on Finish.
4. Create a folder called solr in the project and create another folder called conf inside solr as shown below:
5. Copy files from C:\apache-solr-1.4.1\client\ruby\solr-ruby\solr\conf into /solr/conf folder.
You can define your schema in schema.xml
6. Create a Tomcat Server using server wizard. Defaults would work fine.
7. Add project apache-solr-1.4.1 to your server as shown below
8. Edit server.xml to let tomcat know where are solr config files are:
<Context docBase="apache-solr-1.4.1" path="/apache-solr-1.4.1"
reloadable="true" source="org.eclipse.jst.j2ee.server:apache-solr-1.4.1">
<Environment name="solr/home" type="java.lang.String"
value="C:\myworkspaces\solr-workspace\apache-solr-1.4.1\solr" override="true"/>
</Context>
9. Start Server and you should see following
INFO: Using JNDI solr.home: C:\myworkspaces\solr-workspace\apache-solr-1.4.1\solr
INFO: Solr home set to 'C:\myworkspaces\solr-workspace\apache-solr-1.4.1\solr\'
Troubleshooting Tips
If your installation is showing errors that solr home is not found then do following
• ensure that server.xml is having right entry
• solr directory exists and has conf as child folder and all the files are there
• clean tomcat-server and clean tomcat work directory
7 comments:
Hey, thanks for that.
I have been struggling with Solr-Tomcat-Eclipse combo for the past 3,4 days!! Now, I can atleast see a solr instance working on my system!!! :)
But, where can I see the Solr Server's logs? I dont see anything in Eclipse's tomcat logs (at .metadata/plugins/org.eclipse.wst.server.core/tmp0/logs) except for single line messages. Any idea where I can see more detailed logs??
@S
You should check your log4j.properties settings.
By default, Solr will dump INFO level messages.
You can use following also
# Generic logging configuration.
log4j.rootLogger=INFO, CONSOLE, SERVER
log4j.appender.SERVER=org.apache.log4j.RollingFileAppender
log4j.appender.SERVER.File=C:/server.log
log4j.appender.SERVER.MaxFileSize=10MB
log4j.appender.SERVER.MaxBackupIndex=25
log4j.appender.SERVER.layout=org.apache.log4j.PatternLayout
log4j.appender.SERVER.layout.ConversionPattern=%d %-5r %-5p [%c] (%t:%x) - %m%n
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5r %-5p [%c] (%t:%x) - %m%n
log4j.logger.org.apache.http=DEBUG
log4j.logger.org.apache.http.wire=DEBUG
log4j.logger.org.apache=DEBUG
In solr admin interface, I cant see any collection. how do i enable that? please help
Hey can I get a war file to my mail id : swapna_cse_jntu@yahoo.co.in
I followed ypur steps but I am getting " java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in classpath" Erro
In solr admin can we able to search the autocomplete and spellcheck in User interface.Need help
Post a Comment