PART 1: SETTING UP SOLR with TOMCAT
Step 1: Download Solr. It's just a zip file.
Step 2: Copy from your SOLR_HOME_DIR/dist/apache-solr-1.3.0.war to your tomcat webapps directory: $CATALINA_HOME/webapps/solr.war – Note the war file name change. That’s important.
Step 3: Create your solr home directory at a location of your choosing. This is where the configuration for that solr install resides. The easiest way to do this is to copy the SOLR_HOME_DIR/examples/solr directory to wherever it is you want your solr home container to be. Say place it in C:\solr.
Step 4: Hope you have set your environment variables, if not then please set JAVA_HOME, JRE_HOME, CATALINA_OPTS, CATALINA_HOME. Note that CATALINA_HOME refers to your Tomcat directory & CATALINA_OPTS refers to the amount of heap memory you want to give to your Solr.
Step 5: Start tomcat. Note this is only necessary to allow tomcat to unpack your war file. If you look under $CATALINA_HOME/webapps there should now be a solr directory.
Step 6: Stop tomcat
Step 7: Go into that solr directory and edit WEB-INF/web.xml. Scroll down until you see an entry that looks like this:
<!-- People who want to hardcode their "Solr Home" directly into the
WAR File can set the JNDI property here...
-->
<!--
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>/Path/To/My/solr/Home/solr/</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
-->
Set your Solr home (for example: C:\solr) and uncomment the env entry.
Step 8: Start Tomcat again, and things should be going splendidly. You should be able to verify that solr is running by trying the url http://localhost:8080/solr/admin/.
PART 2: CONFIGURE SOLR PLUGIN ON LIFERAY
Once the Solr instance is set, install the Solr plug-in in the portal. How does it work? The following is a sample which could bring the plugin Solr into the portal.
Step 1: Download required WAR file ${solr.web.war}.
Step 2: Drop the WAR file ${solr.web.war} to the folder $LIFERAY_HOME/deploy when the portal is running
After deploying successfully, you should shut down the portal and Solr instance, and moreover, configure the Solr instance with the Solr plugin as follows.
Step 3: Open $AS_WEB_APP_HOME/solr-web/WEB-INF/classes/META-INF/solr-spring.xml and update Solr instance settings as follows
<bean id=”solrServer” class=”com.liferay.portal.search.solr.server.BasicAuthSolrServer”>
<constructor-arg type=”java.lang.String” value=” http://${solr.host.domain}:$ {solr.port.number}/solr” />
</bean>
<bean id="com.liferay.portal.search.solr.SolrSearchEngineImpl"
class="com.liferay.portal.kernel.search.BaseSearchEngine">
<property name="clusteredWrite" value="false" />
<property name="indexSearcher"
ref="com.liferay.portal.search.solr.SolrIndexSearcherImpl" />
<property name="indexWriter" ref="com.liferay.portal.search.solr.SolrIndexWriterImpl" />
<property name="luceneBased" value="true" />
<property name="vendor" value="SOLR" />
</bean>
<!-- Configurator -->
<bean id="searchEngineConfigurator.solr"
class="com.liferay.portal.kernel.search.PluginSearchEngineConfigurator">
<property name="searchEngines">
<map key-type="java.lang.String" value-
type="com.liferay.portal.kernel.search.SearchEngine">
<entry key="SYSTEM_ENGINE_ID">
<ref bean="com.liferay.portal.search.solr.SolrSearchEngineImpl" />
</entry>
</map>
</property>
<property name="defaultSearchEngineId" value="SYSTEM_ENGINE_ID" />
</bean>
Step 4: Drop the schema file schema.xml from $AS_WEB_APP_HOME/solr-web/WEB-INF/conf to $SOLR_HOME/example/solr/conf in the domain ${solr.host.domain} – replacing the exiting the schema file schema.xml; and restart Solr instance and the portal

