Permalink
Browse files

HSEARCH-1268 Document how to use a custom MassIndexer

  • Loading branch information...
1 parent cf03b71 commit e5dd9ca5260308cdb99673b218fffcc47bbdd909 @DavideD DavideD committed with Sanne Feb 4, 2013
Showing with 34 additions and 0 deletions.
  1. +34 −0 hibernate-search-documentation/src/main/docbook/en-US/modules/batchindex.xml
@@ -287,6 +287,40 @@ transaction.commit();</programlisting>
able to find results and the system load might be too high
anyway.</para>
</note>
+
+ <section id="search-batchindex-custommassindexer">
+ <title>Custom</title>
+ <para>It is possible to use a custom implementation of the <classname>MassIndexer</classname> instead of using the one shipped with Hibernate Search.
+ The steps to follow are:</para>
+
+ <orderedlist>
+ <listitem>
+ <para>create an implementation of the <classname>org.hibernate.search.spi.MassIndexerFactory</classname> interface;</para>
+ </listitem>
+ <listitem>
+ <para>set the property <code>hibernate.search.massindexer.factoryclass</code> with the qualified class name of the factory implementation.</para>
+ </listitem>
+ </orderedlist>
+
+ <example>
+ <title>Custom <code>MassIndexerFactory</code> example</title>
+ <programlisting language="JAVA" role="JAVA">package org.myproject
+import org.hibernate.search.spi.MassIndexerFactory
+[...]
+
+public class CustomIndexerFactory implements MassIndexerFactory {
+
+ public void initialize(Properties properties) {
+ }
+
+ public MassIndexer createMassIndexer(...) {
+ return new CustomIndexer();
+ }
+
+} </programlisting>
+ <programlisting>hibernate.search.massindexer.factoryclass = org.myproject.CustomIndexerFactory</programlisting>
+ </example>
+ </section>
</section>
<section>

0 comments on commit e5dd9ca

Please sign in to comment.