Author: woonsan
Date: Mon Apr 18 22:14:39 2011
New Revision: 1094794
URL: http://svn.apache.org/viewvc?rev=1094794&view=rev
Log:
JS2-1246: Adding documentation on Solr-based search engine component
Added:
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/resources/images/application-details.png
(with props)
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/resources/images/registry-applications-list.png
(with props)
Modified:
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/guide-search.xml
Added:
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/resources/images/application-details.png
URL:
http://svn.apache.org/viewvc/portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/resources/images/application-details.png?rev=1094794&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/resources/images/application-details.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/resources/images/registry-applications-list.png
URL:
http://svn.apache.org/viewvc/portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/resources/images/registry-applications-list.png?rev=1094794&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/resources/images/registry-applications-list.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified:
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/guide-search.xml
URL:
http://svn.apache.org/viewvc/portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/guide-search.xml?rev=1094794&r1=1094793&r2=1094794&view=diff
==============================================================================
---
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/guide-search.xml
(original)
+++
portals/site/jetspeed/jetspeed-2.2/jetspeed-guide-deploy/src/site/xdoc/guide-search.xml
Mon Apr 18 22:14:39 2011
@@ -26,30 +26,205 @@
<body>
<section name="Search">
<p>
- Jetspeed-2 provides an integration with the
popular Apache
- Lucene search engine, a high-performance,
full-featured
- text search engine library written entirely in
Java; a
- technology suitable for nearly any application
that requires
- full-text search, especially cross-platform.
+ Jetspeed-2 provides an integration with the
popular Apache Lucene search engine
+ and Apache Solr search engine,
high-performance, full-featured text search engine libraries;
+ technologies suitable for nearly any
application that requires full-text search, especially cross-platform.
+ You can either embed Solr based search engine
component in Jetspeed-2 or connect to an external Solr engine via http
connection.
+ By default, Apache Lucene based search engine
component is used, but you can switch to
+ Solr based search engine component easily by
copying one of alternate Spring xml confiugration files.
</p>
<p>
By default, Jetspeed-2 indexes all registry
information: portlet
instances and portlet definitions as searchable
entities.
</p>
- <p>Configuration for the Search Engine is in the Spring
configuration file <code>search.xml</code>
- You can configure the location of your search indices
in this Spring configuration file.
- Note you may want to move the location of your indices
outside the Jetspeed web application
- </p>
+ <subsection name="Default Lucene based search engine
configuration">
+ <p>Configuration for the Search Engine is in
the Spring configuration file <code>search.xml</code>
+ You can configure the location of your search
indices in this Spring configuration file.
+ Note you may want to move the location of your
indices outside the Jetspeed web application
+ </p>
<source><![CDATA[
<bean id="org.apache.jetspeed.search.SearchEngine"
class="org.apache.jetspeed.search.lucene.SearchEngineImpl"
>
<constructor-arg
index="0"><value>${applicationRoot}/WEB-INF/search_index</value></constructor-arg>
....
-]]></source>
- <p>
- <img src="images/search.jpg"
border="0"/><br/><br/>
- </p>
+]]></source>
+ </subsection>
+ <subsection name="Embedded Solr based search engine configuration">
+ <p>
+ If you copy
/WEB-INF/assembly/alternate/search-embedded-solr-override.xml
+ to /WEB-INF/assembly/override/ folder, you can switch to
an embedded Solr based search engine component
+ instead of the default Lucene based one.
+ </p>
+<source><![CDATA[
+ ....
+
+ <bean id="org.apache.solr.core.CoreContainer"
class="org.apache.solr.core.CoreContainer" destroy-method="shutdown">
+ <meta key="j2:cat" value="default or search" />
+ <constructor-arg value="${search.embedded.solr.solr.home}" />
+ <constructor-arg>
+ <bean class="java.io.File">
+ <meta key="j2:cat" value="default or search" />
+ <constructor-arg value="${search.embedded.solr.solr.home}/solr.xml" />
+ </bean>
+ </constructor-arg>
+ </bean>
+
+ <bean id="org.apache.solr.client.solrj.SolrServer"
class="org.apache.solr.client.solrj.embedded.EmbeddedSolrServer"
depends-on="_embeddedSolrDataDirPropSetter">
+ <meta key="j2:cat" value="default or search" />
+ <constructor-arg ref="org.apache.solr.core.CoreContainer" />
+ <constructor-arg value="js" />
+ </bean>
+
+ <bean id="org.apache.jetspeed.search.SearchEngine"
class="org.apache.jetspeed.search.solr.SolrSearchEngineImpl">
+ <meta key="j2:cat" value="default or search" />
+ <constructor-arg ref="org.apache.solr.client.solrj.SolrServer" />
+ <constructor-arg type="boolean"
value="${search.index.optimizeAfterUpdate}" />
+ <constructor-arg ref="org.apache.jetspeed.search.HandlerFactory" />
+ </bean>
+]]></source>
+ <p>
+ In the example configuration above, the embedded Solr
based search engine component will
+ initialize search index as configured by properties in
/WEB-INF/conf/jetspeed.properties:
+<source><![CDATA[
+# Optionally you can configure embedded solr home and data dir paths
+# if you enable embedded solr instead of the default lucene
+search.embedded.solr.solr.home=${applicationRoot}/WEB-INF/solr
+search.embedded.solr.data.dir=${applicationRoot}/WEB-INF/solr/data
+]]></source>
+ </p>
+ <p>
+ The Solr configurations are located in /WEB-INF/solr
directory.
+ For more extensibility, it is provided as multi-core setup
as follows:
+<source><![CDATA[
+<solr persistent="true">
+ <cores adminPath="/admin/cores">
+ <core name="js" instanceDir="js"></core>
+ </cores>
+</solr>
+]]></source>
+ </p>
+ </subsection>
+ <subsection name="External Solr based search engine configuration">
+ <p>
+ If you copy
/WEB-INF/assembly/alternate/search-http-solr-override.xml
+ to /WEB-INF/assembly/override/ folder, you can switch to
an external Solr based search engine component
+ instead of the default Lucene based one.
+ </p>
+<source><![CDATA[
+ ....
+
+ <bean id="org.apache.solr.client.solrj.SolrServer"
class="org.apache.solr.client.solrj.impl.CommonsHttpSolrServer">
+ <meta key="j2:cat" value="default or search" />
+ <constructor-arg value="${search.http.solr.url}" />
+ <property name="soTimeout" value="1000" />
+ <property name="connectionTimeout" value="100" />
+ <property name="defaultMaxConnectionsPerHost" value="100" />
+ <property name="maxTotalConnections" value="100" />
+ <property name="followRedirects" value="false" />
+ <property name="allowCompression" value="true" />
+ <property name="maxRetries" value="1" />
+ <property name="parser">
+ <bean class="org.apache.solr.client.solrj.impl.XMLResponseParser">
+ <meta key="j2:cat" value="default or search" />
+ </bean>
+ </property>
+ </bean>
+
+ <bean id="org.apache.jetspeed.search.SearchEngine"
class="org.apache.jetspeed.search.solr.SolrSearchEngineImpl">
+ <meta key="j2:cat" value="default or search" />
+ <constructor-arg ref="org.apache.solr.client.solrj.SolrServer" />
+ <constructor-arg type="boolean"
value="${search.index.optimizeAfterUpdate}" />
+ <constructor-arg ref="org.apache.jetspeed.search.HandlerFactory" />
+ </bean>
+
+ ....
+]]></source>
+ <p>
+ In the example configuration above, the Solr based search
engine component will
+ connect to the external Solr engine as configured by
properties in /WEB-INF/conf/jetspeed.properties:
+<source><![CDATA[
+# Optionally you can configure external solr http(s) url
+# Note: If you have multi-core setup, you should put the core name at the end.
e.g., '/js'.
+search.http.solr.url=http://localhost:8983/solr/js
+]]></source>
+ </p>
+ <p>
+
+ </p>
+ </subsection>
+ <subsection name="Solr based search schema confiugration">
+ <p>
+ An example schema configuration for Jetspeed-2 can be
found in /WEB-INF/solr/js/conf/schema.xml.
+ Jetspeed-2 requires the following fields at least:
+<source><![CDATA[
+ <!-- Core Search Fields -->
+ <field name="fieldname.key" type="string" indexed="true" stored="true"
required="true" />
+ <field name="fieldname.type" type="text" indexed="true" stored="true"
required="false" />
+ <field name="fieldname.content" type="text" indexed="true" stored="false"
required="false" />
+ <field name="fieldname.description" type="text" indexed="true"
stored="true" multiValued="true" required="false" />
+ <field name="fieldname.title" type="text" indexed="true" stored="true"
multiValued="true" required="false" />
+ <field name="fieldname.language" type="text" indexed="true" stored="true"
multiValued="true" required="false" />
+ <field name="fieldname.fields" type="text" indexed="true" stored="false"
multiValued="true" required="false" />
+ <field name="fieldname.keywords" type="string" indexed="true" stored="true"
multiValued="true" required="false" />
+ <field name="fieldname.url" type="text" indexed="true" stored="true"
multiValued="true" required="false" />
+ <field name="fieldname.score" type="text" indexed="true" stored="false"
required="false" />
+ <field name="fieldname.className" type="text" indexed="true" stored="true"
required="false" />
+ <field name="fieldname.synthetic" type="text" indexed="true" stored="false"
required="false" />
+ <!-- Metadata Search Fields -->
+ <field name="ID" type="string" indexed="true" stored="true"
required="false" />
+ <field name="url" type="text" indexed="true" stored="true" required="false"
/>
+ <field name="portlet" type="string" indexed="true" stored="true"
required="false" />
+ <field name="portlet_application" type="string" indexed="true"
stored="true" required="false" />
+ <field name="title" type="string" indexed="true" stored="false"
multiValued="true" required="false" />
+ <field name="description" type="string" indexed="true" stored="false"
multiValued="true" required="false" />
+ <field name="subject" type="string" indexed="true" stored="false"
multiValued="true" required="false" />
+ <field name="creator" type="string" indexed="true" stored="false"
multiValued="true" required="false" />
+ <field name="publisher" type="string" indexed="true" stored="false"
multiValued="true" required="false" />
+ <field name="contributor" type="string" indexed="true" stored="false"
multiValued="true" required="false" />
+]]></source>
+ Therefore, please be sure that the schema should be
configured properly like the example above
+ when you want to use an external Solr search engine.
+ </p>
+ <p>
+ If you want easy steps to test an external Solr based
search engine component, here are simple ones as an example:
+ <ol>
+ <li>Copy
/WEB-INF/assembly/alternate/search-http-solr-override.xml to
/WEB-INF/assembly/override/ folder.</li>
+ <li>Instal Solr war file onto a servlet container. For
example, copy solr.war to $CATALINA_HOME/webapps/.</li>
+ <li>
+ Copy the example Solr home and data directory to
somewhere you want to keep the search index.
+ For example, copy /jetspeed/WEB-INF/solr/
directory to /tmp/solr/.
+ </li>
+ <li>
+ Start the servlet container with specifying Solr
home and data directory.
+ <br/>
+ <br/>
+ $ export CATALINA_OPTS="-Xmx256m
-XX:MaxPermSize=128m -Dsolr.solr.home=/tmp/solr -Dsolr.data.dir=/tmp/solr/data"
+ <br/>
+ </li>
+ <li>
+ If you didn't deploy portlet applications again
and the search index was not refreshed, then
+ redeploy all the portlet applications or refresh
the search index for each portlet application
+ in the Portlet Application Manager portlet.
+ </li>
+ </ol>
+ </p>
+ </subsection>
+ <subsection name="Search UIs">
+ <h4>Registry Applications List Portlet in Portlet Application
Manager Page</h4>
+ <p>
+ <img
src="images/registry-applications-list.png" border="0"/>
+ <br/>
+ </p>
+ <br/>
+ <h4>Application Details Portlet in Portlet Application Manager
Page</h4>
+ <p>
+ <img src="images/application-details.png" border="0"/>
+ <br/>
+ <br/>
+ <em>You can refresh search index for each application.</em>
+ </p>
+ </subsection>
</section>
</body>
</document>