Search code examples
solrtomcat7solrj

How to configure apache solr with existing spring mvc 4 hibernate 4 application?


How to configure and run apache solr with spring mvc in tomcat7 server? Will apache solr run only by specifying dependency in maven or do I have to install apache solr in local machine?


Solution

  • You need to have Solr service running in your system or in any server instance, only then you will be able to connect and do some operation on Solr.

    Specifying dependency in maven will be useful only to get connected to Solr and do read/write operation on Solr service.

    For instance if we compare this with any database system, then your database server is running some where and you use any jdbc driver in your application to perform CRUD operation on that RDBMS.

    You can follow the below steps to install and run Solr

    1. Make sure you have installed Java
    2. Download Solr from http://lucene.apache.org/solr/
    3. Extract Solr distribution archive to a directory
    4. Start Solr server by issuing following command:

      -- if you are in linux distribution then 
      $ bin/solr start
      
      -- if you are in windows then
      bin\solr.cmd start
      
    5. Once Solr server is running, use a Web browser to see the Admin Console at http://localhost:8983/solr/

    For more detailed instructions follow these links

    https://cwiki.apache.org/confluence/display/solr/Installing+Solr https://cwiki.apache.org/confluence/display/solr/Running+Solr