h3.Introduction
The Webspace server is bundled with Lucene as the default search indexer. However, the Lucene does not scale for production deployments. The recommended search engine for production deployments is Apache Solr (http://lucene.apache.org/solr/) which more robust and runs on a centralized server. The Webspace Server has a Solr plugin which works with the Solr server deployed.
The procedure described in this document is for example purposes. Please refer to the documentation for Solr for more information on Installation and Configuration of the server.
h3.Architecture
Essentially, the Solr will be running on a GlassFish server potentially on an independent machine and the Webspace server(s) will be configured (by installing the solr-web plugin) to work with Solr server.
!Solr_Search.png|align=center!
h3.Installation of Solr Server to GlassFish Server
This procedure assumes that the GlassFish server is already installed and a domain is configured.
* Download the Apache Solr server from http://lucene.apache.org/solr/
* Unzip into a Directory. (For example, /opt/apache-solr)
* Deploy the solr.war to GlassFish domain. Assuming the the GlassFish server installed under /opt/wsynergy/glassfih
{code}
/opt/wsynergy/glassfish/bin/asadmin deploy --user=admin --contextroot=solr /opt/wsynergy/Install/apache-solr/example/webapps/solr.war
{code}
* Configure the domain.xml of the GlassFish to include the solr.solr.home parameter.
{code}
/opt/wsynergy/glassfish/bin/asadmin create-jvm-options --user admin --port 4848 --target server -- "-Dsolr.solr.home=/opt/wsynergy/Install/apache-solr/example/solr"
{code}
h3.Installation and Configuration of Solr plugin to Webspace Server
Steps involved.
# Obtain the plugin (WAR file)
# Update the WAR file with configurations pertaining to the site
# Repack the WAR
# Hotdeploy to the Webspace Server
- Download [^solr-web-5.2.0.1.war] file.
- Unpack the WAR file into a temporary directory (For example, /tmp/solr-plugin).
{code}
$ cd /tmp/solr-plugin
$ jar xf solr-web-5.2.0.1.war
{code}
- Copy the schem.xml file which describes how the fields will be indexed to the Solr index and it should be located in the /tmp/solr-plugin/WEB-INF/conf folder. Copy this file to /opt/wsynergy/Install/apache-solr/example/solr/conf directory located on the Solr Server.
- Start the Solr Search Engine server.
After successful deployment of the WAR file, the Solr admin page can be accessed via http://server.name:8080/solr
- Update the /tmp/solr-plugin/WEB-INF/classes/META-INF/solr-spring.xml file. Edit the entry for solrServer with the URL of the Solr Search Engine Server.
{code}
<bean id="solrServer" class="org.apache.solr.client.solrj.impl.CommonsHttpSolrServer">
<constructor-arg type="java.lang.String" value="http://SolrServerHost:8080/solr" />
</bean>
{code}
- Repack the Solr Plugin War
{code}
$ jar cf solr-web-5.2.0.1.war *
{code}
- Copy the file solr-web-5.2.0.1.war to the Webspace Server's hot deploy directory located under <INSTALL_ROOT>/var/webspace/deploy
- Reindex all Search Indexes
{code}
Go to "Control Panel → Server Administration → Resources " click the "Execute" button next to "Reindex all search indexes."
{code}
h3.References
Pluggable Enterprise Search with Solr at http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Pluggable+Enterprise+Search+with+Solr
The Webspace server is bundled with Lucene as the default search indexer. However, the Lucene does not scale for production deployments. The recommended search engine for production deployments is Apache Solr (http://lucene.apache.org/solr/) which more robust and runs on a centralized server. The Webspace Server has a Solr plugin which works with the Solr server deployed.
The procedure described in this document is for example purposes. Please refer to the documentation for Solr for more information on Installation and Configuration of the server.
h3.Architecture
Essentially, the Solr will be running on a GlassFish server potentially on an independent machine and the Webspace server(s) will be configured (by installing the solr-web plugin) to work with Solr server.
!Solr_Search.png|align=center!
h3.Installation of Solr Server to GlassFish Server
This procedure assumes that the GlassFish server is already installed and a domain is configured.
* Download the Apache Solr server from http://lucene.apache.org/solr/
* Unzip into a Directory. (For example, /opt/apache-solr)
* Deploy the solr.war to GlassFish domain. Assuming the the GlassFish server installed under /opt/wsynergy/glassfih
{code}
/opt/wsynergy/glassfish/bin/asadmin deploy --user=admin --contextroot=solr /opt/wsynergy/Install/apache-solr/example/webapps/solr.war
{code}
* Configure the domain.xml of the GlassFish to include the solr.solr.home parameter.
{code}
/opt/wsynergy/glassfish/bin/asadmin create-jvm-options --user admin --port 4848 --target server -- "-Dsolr.solr.home=/opt/wsynergy/Install/apache-solr/example/solr"
{code}
h3.Installation and Configuration of Solr plugin to Webspace Server
Steps involved.
# Obtain the plugin (WAR file)
# Update the WAR file with configurations pertaining to the site
# Repack the WAR
# Hotdeploy to the Webspace Server
- Download [^solr-web-5.2.0.1.war] file.
- Unpack the WAR file into a temporary directory (For example, /tmp/solr-plugin).
{code}
$ cd /tmp/solr-plugin
$ jar xf solr-web-5.2.0.1.war
{code}
- Copy the schem.xml file which describes how the fields will be indexed to the Solr index and it should be located in the /tmp/solr-plugin/WEB-INF/conf folder. Copy this file to /opt/wsynergy/Install/apache-solr/example/solr/conf directory located on the Solr Server.
- Start the Solr Search Engine server.
After successful deployment of the WAR file, the Solr admin page can be accessed via http://server.name:8080/solr
- Update the /tmp/solr-plugin/WEB-INF/classes/META-INF/solr-spring.xml file. Edit the entry for solrServer with the URL of the Solr Search Engine Server.
{code}
<bean id="solrServer" class="org.apache.solr.client.solrj.impl.CommonsHttpSolrServer">
<constructor-arg type="java.lang.String" value="http://SolrServerHost:8080/solr" />
</bean>
{code}
- Repack the Solr Plugin War
{code}
$ jar cf solr-web-5.2.0.1.war *
{code}
- Copy the file solr-web-5.2.0.1.war to the Webspace Server's hot deploy directory located under <INSTALL_ROOT>/var/webspace/deploy
- Reindex all Search Indexes
{code}
Go to "Control Panel → Server Administration → Resources " click the "Execute" button next to "Reindex all search indexes."
{code}
h3.References
Pluggable Enterprise Search with Solr at http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Pluggable+Enterprise+Search+with+Solr