You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-commits@lucene.apache.org by ro...@apache.org on 2005/06/01 05:58:38 UTC
svn commit: r179346 - in /incubator/lucene4c/branches/gcj-backend:
include/lcn_index_writer.h src/index/writer.cxx
Author: rooneg
Date: Tue May 31 20:58:36 2005
New Revision: 179346
URL: http://svn.apache.org/viewcvs?rev=179346&view=rev
Log:
Implement lcn_index_writer_optimize.
* include/lcn_index_writer.h
(lcn_index_writer_optimize): new declaration.
* src/index/writer.cxx
(index_writer_optimize_internal,
lcn_index_writer_optimize): new functions.
Submitted By: Paul Querna
Modified:
incubator/lucene4c/branches/gcj-backend/include/lcn_index_writer.h
incubator/lucene4c/branches/gcj-backend/src/index/writer.cxx
Modified: incubator/lucene4c/branches/gcj-backend/include/lcn_index_writer.h
URL: http://svn.apache.org/viewcvs/incubator/lucene4c/branches/gcj-backend/include/lcn_index_writer.h?rev=179346&r1=179345&r2=179346&view=diff
==============================================================================
--- incubator/lucene4c/branches/gcj-backend/include/lcn_index_writer.h (original)
+++ incubator/lucene4c/branches/gcj-backend/include/lcn_index_writer.h Tue May 31 20:58:36 2005
@@ -50,6 +50,12 @@
lcn_document_t *document,
apr_pool_t *pool);
+/** Optimize @a writer.
+ * Merges all segments together into a single segment, optimizing an index
+ * for search. */
+lcn_error_t *
+lcn_index_writer_optimize (lcn_index_writer_t *writer);
+
/** Close @a writer.
*
* Strictly speaking, this is not needed, as it will be closed when the pool
Modified: incubator/lucene4c/branches/gcj-backend/src/index/writer.cxx
URL: http://svn.apache.org/viewcvs/incubator/lucene4c/branches/gcj-backend/src/index/writer.cxx?rev=179346&r1=179345&r2=179346&view=diff
==============================================================================
--- incubator/lucene4c/branches/gcj-backend/src/index/writer.cxx (original)
+++ incubator/lucene4c/branches/gcj-backend/src/index/writer.cxx Tue May 31 20:58:36 2005
@@ -137,6 +137,20 @@
}
static void
+index_writer_optimize_internal (void *b)
+{
+ lcn_index_writer_t *writer = static_cast<lcn_index_writer_t *>(b);
+
+ writer->impl->optimize ();
+}
+
+lcn_error_t *
+lcn_index_writer_optimize (lcn_index_writer_t *writer)
+{
+ return lcn__swallow_exception (index_writer_optimize_internal, writer);
+}
+
+static void
index_writer_close_internal (void *b)
{
lcn_index_writer_t *writer = static_cast<lcn_index_writer_t *>(b);