1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="solrclient.commit" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>SolrClient::commit</refname>
<refpurpose>Finalizes all add/deletes made to the index</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>SolrUpdateResponse</type><methodname>SolrClient::commit</methodname>
<methodparam choice="opt"><type>bool</type><parameter>softCommit</parameter><initializer>&false;</initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>waitSearcher</parameter><initializer>&true;</initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>expungeDeletes</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
<para>
This method finalizes all add/deletes made to the index.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>softCommit</parameter></term>
<listitem>
<para>
This will refresh the 'view' of the index in a more performant manner, but without "on-disk" guarantees. (Solr4.0+)
</para>
<para>
A soft commit is much faster since it only makes index changes visible and does not fsync index files or write a new index descriptor.
If the JVM crashes or there is a loss of power, changes that occurred after the last hard commit will be lost.
Search collections that have near-real-time requirements (that want index changes to be quickly visible to searches) will want to soft commit often but hard commit less frequently.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>waitSearcher</parameter></term>
<listitem>
<para>
block until a new searcher is opened and registered as the main query searcher, making the changes visible.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>expungeDeletes</parameter></term>
<listitem>
<para>
Merge segments with deletes away. (Solr1.4+)
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a <classname>SolrUpdateResponse</classname> object on success or throws an exception on failure.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws <classname>SolrClientException</classname> if the client had failed, or there was a connection issue.
</para>
<para>
Throws <classname>SolrServerException</classname> if the Solr Server had failed to process the request.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>PECL solr 1.1.0, PECL solr 2.0.0</entry>
<entry>
$maxSegments removed
</entry>
</row>
<row>
<entry>PECL solr 2.0.0b</entry>
<entry>
API Changed: SolrClient::commit ([ int $maxSegments = 0 [, bool $softCommit = false [, bool $waitSearcher = true[, bool $expungeDeletes = false ]]] )
</entry>
</row>
<row>
<entry>PECL solr 0.9.2</entry>
<entry>
Signature: SolrClient::commit ([ int $maxSegments = 1 [, bool $waitFlush = true [, bool $waitSearcher = true ]]] ).
$waitFlush: Block until index changes are flushed to disk.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<warning>
<para>
PECL Solr >= 2.0 only supports Solr Server >= 4.0
</para>
</warning>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>SolrClient::optimize</methodname></member>
<member><methodname>SolrClient::rollback</methodname></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|