<chapter id="administration">
- <!-- $Id: administration.xml,v 1.16 2002-12-30 12:56:07 adam Exp $ -->
+ <!-- $Id: administration.xml,v 1.17 2004-01-22 16:23:23 heikki Exp $ -->
<title>Administrating Zebra</title>
<!-- ### It's a bit daft that this chapter (which describes half of
the configuration-file formats) is separated from
Specifies <replaceable>size</replaceable> of internal memory
to use for the zebraidx program.
The amount is given in megabytes - default is 4 (4 MB).
+ The more memory, the faster large updates happen, up to about
+ half the free memory available on the computer.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>tempfiles: <replaceable>Yes/Auto/No</replaceable></term>
+ <listitem>
+ <para>
+ Tells zebra if it should use temporary files when indexing. The
+ default is Auto, in which case zebra uses temporary files only
+ if it would need more that <replaceable>memMax</replaceable>
+ megabytes of memory. This should be good for most uses.
</para>
</listitem>
</varlistentry>
-/* $Id: extract.c,v 1.149 2004-01-22 15:40:25 heikki Exp $
+/* $Id: extract.c,v 1.150 2004-01-22 16:23:23 heikki Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
qsort (zh->reg->key_buf + zh->reg->ptr_top - ptr_i, ptr_i,
sizeof(char*), key_qsort_compare);
- /* Case 1: always use temp files (old way) */
- /* Case 2: use temp files, if more than one (auto) */
- /* = if this is both the last and the first */
- /* Case 3: never bother with temp files (new) */
- temp_policy=2;
- /* FIXME - will come from config file into zh */
+ /* zebra.cfg: tempfiles:
+ /* Y: always use temp files (old way) */
+ /* A: use temp files, if more than one (auto) */
+ /* = if this is both the last and the first */
+ /* N: never bother with temp files (new) */
- if ( ( temp_policy ==3 ) || /* always from memory */
- ( ( temp_policy ==2 ) && /* automatic */
+ temp_policy=toupper(res_get_def(zh->res,"tempfiles","auto")[0]);
+ if (temp_policy != 'Y' && temp_policy != 'N' && temp_policy != 'A') {
+ logf (LOG_WARN, "Illegal tempfiles setting '%c'. using 'Auto' ",
+ temp_policy);
+ temp_policy='A';
+ }
+
+ if ( ( temp_policy =='N' ) || /* always from memory */
+ ( ( temp_policy =='A' ) && /* automatic */
(zh->reg->key_file_no == 1) && /* this is first time */
(final) ) ) /* and last (=only) time */
{ /* go directly from memory */
zebra_index_merge(zh);
zh->reg->ptr_i = 0;
zh->reg->key_buf_used = 0;
- return; /*!*/
+ return;
}
/* Not doing directly from memory, write into a temp file */