[hibernate-commits] Hibernate SVN: r11637 - in trunk/HibernateExt/search: doc/reference/en/modules and 1 other directories.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Jun 5 20:39:00 EDT 2007


Author: epbernard
Date: 2007-06-05 20:39:00 -0400 (Tue, 05 Jun 2007)
New Revision: 11637

Modified:
   trunk/HibernateExt/search/doc/reference/en/master.xml
   trunk/HibernateExt/search/doc/reference/en/modules/batchindex.xml
   trunk/HibernateExt/search/doc/reference/en/modules/configuration.xml
   trunk/HibernateExt/search/doc/reference/en/modules/query.xml
   trunk/HibernateExt/search/src/java/org/hibernate/search/Version.java
Log:
Documentation before the release

Modified: trunk/HibernateExt/search/doc/reference/en/master.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/master.xml	2007-06-06 00:08:57 UTC (rev 11636)
+++ trunk/HibernateExt/search/doc/reference/en/master.xml	2007-06-06 00:39:00 UTC (rev 11637)
@@ -6,6 +6,8 @@
 <!ENTITY mapping SYSTEM "modules/mapping.xml">
 <!ENTITY query SYSTEM "modules/query.xml">
 <!ENTITY batchindex SYSTEM "modules/batchindex.xml">
+<!ENTITY optimize SYSTEM "modules/optimize.xml">
+<!ENTITY lucene-native SYSTEM "modules/lucene-native.xml">
 ]>
 <book lang="en">
   <bookinfo>
@@ -15,7 +17,7 @@
 
     <subtitle>Reference Guide</subtitle>
 
-    <releaseinfo>3.0.0.Beta2</releaseinfo>
+    <releaseinfo>3.0.0.Beta3</releaseinfo>
 
     <mediaobject>
       <imageobject>
@@ -54,4 +56,8 @@
   &query;
 
   &batchindex;
+
+  &optimize;
+
+  &lucene-native;
 </book>
\ No newline at end of file

Modified: trunk/HibernateExt/search/doc/reference/en/modules/batchindex.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/batchindex.xml	2007-06-06 00:08:57 UTC (rev 11636)
+++ trunk/HibernateExt/search/doc/reference/en/modules/batchindex.xml	2007-06-06 00:39:00 UTC (rev 11637)
@@ -18,4 +18,38 @@
   and execute them at commit time (Note: you don't need to use
   <classname>org.hibernate.Transaction</classname> in a JTA
   environment).</para>
+
+  <para>If you expect to index a lot of data, you need to be careful about
+  memory consumption: since all documents are kept in a queue until the
+  transaction commit, you can potentially face an OutOfMemoryException.</para>
+
+  <para>To avoid that, you can set up the
+  <literal>hibernate.search.worker.batch_size</literal> property to a
+  sensitive value: all index operations are queued until
+  <literal>batch_size</literal> is reached. Every time
+  <literal>batch_size</literal> is reached (or if the transaction is
+  committed), the queue is processed (freeing memory) and emptied. Be aware
+  that the changes cannot be rollbacked if the number of index elements goes
+  beyond <literal>batch_size</literal>. Be also aware that the queue limits is
+  also applied on regular transparent indexing (and not only when
+  <literal>session.index()</literal> is used). That's why a sensitive
+  <literal>batch_size</literal> value is expected.</para>
+
+  <para>Here is an especially efficient way to index a given class (useful for
+  index (re)initialization):</para>
+
+  <programlisting>transaction = fullTextSession.beginTransaction();
+//Scrollable results will avoid loading too many objects in memory
+ScrollableResults results = fullTextSession.createCriteria( Email.class ).scroll( ScrollMode.FORWARD_ONLY );
+int index = 0;
+while( results.next() ) {
+    index++;
+    fullTextSession.index( results.get(0) ); //index each element
+    if (index % batchSize == 0) s.clear(); //clear every batchSize since the queue is processed
+}
+transaction.commit();</programlisting>
+
+  <para>It is critical that <literal>batchSize</literal> in the previous
+  example matches the <literal>batch_size</literal> value described
+  previously.</para>
 </chapter>
\ No newline at end of file

Modified: trunk/HibernateExt/search/doc/reference/en/modules/configuration.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/configuration.xml	2007-06-06 00:08:57 UTC (rev 11636)
+++ trunk/HibernateExt/search/doc/reference/en/modules/configuration.xml	2007-06-06 00:39:00 UTC (rev 11637)
@@ -234,6 +234,16 @@
               lookup the JMS queue from. The queue will be used to post work
               messages.</entry>
             </row>
+
+            <row>
+              <entry><literal>
+              org.hibernate.worker.batch_size</literal></entry>
+
+              <entry>Defines the maximum number of elements indexed before
+              flushing the transaction-bound queue. Default to 0 (ie no
+              limit). See <xref linkend="search-batchindex" /> for more
+              information.</entry>
+            </row>
           </tbody>
         </tgroup>
       </table>

Modified: trunk/HibernateExt/search/doc/reference/en/modules/query.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/query.xml	2007-06-06 00:08:57 UTC (rev 11636)
+++ trunk/HibernateExt/search/doc/reference/en/modules/query.xml	2007-06-06 00:39:00 UTC (rev 11637)
@@ -289,4 +289,12 @@
       </listitem>
     </itemizedlist>
   </section>
+
+  <section>
+    <title>Native Lucene Queries</title>
+
+    <para>If you wish to use some specific features of Lucene, you can always
+    run Lucene specific queries. Check <xref linkend="search-lucene-native" />
+    for more informations.</para>
+  </section>
 </chapter>
\ No newline at end of file

Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/Version.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/Version.java	2007-06-06 00:08:57 UTC (rev 11636)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/Version.java	2007-06-06 00:39:00 UTC (rev 11637)
@@ -10,7 +10,7 @@
  * @author Emmanuel Bernard
  */
 public class Version {
-	public static final String VERSION = "3.0.0.Beta3SNAPSHOT" + new Date();
+	public static final String VERSION = "3.0.0.Beta3"; //SNAPSHOT" + new Date();
 	private static Log log = LogFactory.getLog( Version.class );
 
 	static {




More information about the hibernate-commits mailing list