For regularly indexing Hippo CMS content into Solr.
Git and Maven (> 2.2) must be installed on your machine.
git clone [email protected]:mickaeltr/Hippo-Solr-indexer.git
cd Hippo-Solr-indexer
mvn install
To be able to define the content to be indexed, you will add the addon-repository to the content module POM:
<dependency>
<groupId>org.onehippo.forge.solr.indexer</groupId>
<artifactId>solr-indexer-addon-repository</artifactId>
<version>${hippo.solr-indexer.version}</version>
</dependency>
A Solr indexer webapp must then be deployed in the same container as CMS and site webapps...
If you want to play with the provided Webapp example, create a new Maven module, packaged as WAR, deployed on Cargo, with the following in the POM:
<dependencies>
<dependency>
<groupId>org.onehippo.forge.solr.indexer</groupId>
<artifactId>solr-indexer-webapp-example</artifactId>
<version>${hippo.solr-indexer.version}</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<finalName>solr</finalName>
</build>
After you run your project, the Solr application will be available at http://localhost:8080/solr/.
When you get more serious and want to customize the webapp, you need to mimic the Webapp example in your project. You may then configure:
- Spring applicationContext (see Spring documentation for the IoC container)
- Solr schema (see Solr documentation for SchemaXml)
- Solr config (see Solr documentation for SolrConfigXml)
In order to setup which document types and fields will be indexed, a configuration node must be created via the CMS console, under /content/:
[solr:configuration]
- solr:node (string) multiple
- solr:property (string) multiple
Set up which (inherited) primary types will be indexed. Example: hippo:document
Set up which (nested) properties will be indexed as dynamic fields. Example: ns:title, ns:html/hippostd:content