From dac13cb136218fc109c9a43823999593a4d75d7d Mon Sep 17 00:00:00 2001 From: Hardy Ferentschik Date: Mon, 7 May 2012 14:45:18 +0200 Subject: [PATCH] HSEARCH-1118 Removing note about hibernate.search.default.worker.batch_size --- .../main/docbook/en-US/modules/batchindex.xml | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/hibernate-search-documentation/src/main/docbook/en-US/modules/batchindex.xml b/hibernate-search-documentation/src/main/docbook/en-US/modules/batchindex.xml index 253e82d7399..115d73cbd15 100755 --- a/hibernate-search-documentation/src/main/docbook/en-US/modules/batchindex.xml +++ b/hibernate-search-documentation/src/main/docbook/en-US/modules/batchindex.xml @@ -65,7 +65,7 @@ tx.commit(); //index only updated at commit time In case you want to add all instances for a type, or for all indexed types, the recommended approach is to use a MassIndexer: see for more details. + linkend="search-batchindex-massindexer"/> for more details.
@@ -79,7 +79,7 @@ tx.commit(); //index only updated at commit time Purging a specific instance of an entity from the index - FullTextSession fullTextSession = Search.getFullTextSession(session); + FullTextSession fullTextSession = Search.getFullTextSession(session); Transaction tx = fullTextSession.beginTransaction(); for (Customer customer : customers) { fullTextSession.purge( Customer.class, customer.getId() ); @@ -98,7 +98,7 @@ tx.commit(); //index is updated at commit time Purging all instances of an entity from the index - FullTextSession fullTextSession = Search.getFullTextSession(session); + FullTextSession fullTextSession = Search.getFullTextSession(session); Transaction tx = fullTextSession.beginTransaction(); fullTextSession.purgeAll( Customer.class ); //optionally optimize the index @@ -194,12 +194,6 @@ while( results.next() ) { transaction.commit(); - - hibernate.search.default.worker.batch_size has been - deprecated in favor of this explicit API which provides better - control - - Try to use a batch size that guarantees that your application will not run out of memory: with a bigger batch size objects are fetched faster from database but more memory is needed. @@ -218,7 +212,7 @@ transaction.commit(); Index rebuilding using a MassIndexer - fullTextSession.createIndexer().startAndWait(); + fullTextSession.createIndexer().startAndWait(); This will rebuild the index, deleting it and then reloading all @@ -228,8 +222,8 @@ transaction.commit(); During the progress of a MassIndexer the content of the index is - undefined! If a query is performed while the MassIndexer is working most - likely some results will be missing. + undefined! If a query is performed while the MassIndexer is working + most likely some results will be missing. @@ -250,11 +244,11 @@ transaction.commit(); and will create 5 parallel threads to load the User instances using batches of 25 objects per query; these loaded User instances are then pipelined to 20 parallel threads to load the attached lazy collections - of User containing some information needed for the index. - The number of threads working on actual index writing is defined by the backend - configuration of each index. - See the option worker.thread_pool.size in . + of User containing some information needed for the index. The number of + threads working on actual index writing is defined by the backend + configuration of each index. See the option + worker.thread_pool.size in . It is recommended to leave cacheMode to CacheMode.IGNORE (the default), as in most reindexing @@ -282,8 +276,8 @@ transaction.commit();
- Other parameters which affect indexing time and memory - consumption are: + Other parameters which affect indexing time and memory consumption + are: @@ -301,19 +295,19 @@ transaction.commit(); hibernate.search.[default|<indexname>].indexwriter.merge_factor - + hibernate.search.[default|<indexname>].indexwriter.merge_min_size - + hibernate.search.[default|<indexname>].indexwriter.merge_max_size - + hibernate.search.[default|<indexname>].indexwriter.merge_max_optimize_size - + hibernate.search.[default|<indexname>].indexwriter.merge_calibrate_by_deletes @@ -326,18 +320,19 @@ transaction.commit(); hibernate.search.[default|<indexname>].indexwriter.term_index_interval - - Previous versions also had a max_field_length but this was removed from Lucene, - it's possible to obtain a similar effect by using a LimitTokenCountAnalyzer. + + Previous versions also had a max_field_length but + this was removed from Lucene, it's possible to obtain a similar effect by + using a LimitTokenCountAnalyzer. All .indexwriter parameters are Lucene specific and Hibernate Search is just passing these parameters through - see for more details. + linkend="lucene-indexing-performance"/> for more details. - The MassIndexer uses a forward only scrollable result to iterate - on the primary keys to be loaded, but MySQL's JDBC driver will load all values in memory; - to avoid this "optimisation" set idFetchSize to + The MassIndexer uses a forward only + scrollable result to iterate on the primary keys to be loaded, but MySQL's + JDBC driver will load all values in memory; to avoid this "optimisation" + set idFetchSize to Integer.MIN_VALUE. -