2009-10-03 04:50:06 +00:00
<?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>
2009-11-23 10:51:08 +00:00
<refpurpose > Finalizes all add/deletes made to the index</refpurpose>
2009-10-03 04:50:06 +00:00
</refnamediv>
<refsect1 role= "description" >
&reftitle.description;
<methodsynopsis >
<modifier > public</modifier> <type > SolrUpdateResponse</type> <methodname > SolrClient::commit</methodname>
2018-01-25 19:11:34 +00:00
<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>
2009-10-03 04:50:06 +00:00
</methodsynopsis>
<para >
This method finalizes all add/deletes made to the index.
</para>
</refsect1>
<refsect1 role= "parameters" >
&reftitle.parameters;
<para >
<variablelist >
2014-02-28 23:14:02 +00:00
<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.
2009-10-03 04:50:06 +00:00
</para>
</listitem>
</varlistentry>
<varlistentry >
2014-03-16 21:56:01 +00:00
<term > <parameter > waitSearcher</parameter> </term>
2009-10-03 04:50:06 +00:00
<listitem >
<para >
2014-03-16 21:56:01 +00:00
block until a new searcher is opened and registered as the main query searcher, making the changes visible.
2009-10-03 04:50:06 +00:00
</para>
</listitem>
</varlistentry>
<varlistentry >
2014-02-28 23:14:02 +00:00
<term > <parameter > expungeDeletes</parameter> </term>
2009-10-03 04:50:06 +00:00
<listitem >
<para >
2014-02-28 23:14:02 +00:00
Merge segments with deletes away. (Solr1.4+)
2009-10-03 04:50:06 +00:00
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role= "returnvalues" >
&reftitle.returnvalues;
<para >
2014-07-04 15:48:38 +00:00
Returns a <classname > SolrUpdateResponse</classname> object on success or throws an exception on failure.
2009-10-03 04:50:06 +00:00
</para>
</refsect1>
2014-07-04 15:48:38 +00:00
<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>
2014-03-16 21:56:01 +00:00
<refsect1 role= "changelog" >
&reftitle.changelog;
<para >
<informaltable >
<tgroup cols= "2" >
<thead >
<row >
<entry > &Version; </entry>
<entry > &Description; </entry>
</row>
</thead>
<tbody >
<row >
2020-10-25 15:11:56 +00:00
<entry > PECL solr 1.1.0, 2.0.0</entry>
2014-07-04 15:48:38 +00:00
<entry >
$maxSegments removed
</entry>
</row>
<row >
2020-10-25 15:11:56 +00:00
<entry > PECL solr 2.0.0b</entry>
2014-03-16 21:56:01 +00:00
<entry >
2014-03-17 02:09:49 +00:00
API Changed: SolrClient::commit ([ int $maxSegments = 0 [, bool $softCommit = false [, bool $waitSearcher = true[, bool $expungeDeletes = false ]]] )
2014-03-16 21:56:01 +00:00
</entry>
</row>
2014-03-17 02:09:49 +00:00
2014-03-16 21:56:01 +00:00
<row >
2020-10-25 15:11:56 +00:00
<entry > PECL solr 0.9.2</entry>
2014-03-16 21:56:01 +00:00
<entry >
2014-03-17 02:09:49 +00:00
Signature: SolrClient::commit ([ int $maxSegments = 1 [, bool $waitFlush = true [, bool $waitSearcher = true ]]] ).
$waitFlush: Block until index changes are flushed to disk.
2014-03-16 21:56:01 +00:00
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
2014-02-28 23:14:02 +00:00
<refsect1 role= "notes" >
&reftitle.notes;
<warning >
<para >
PECL Solr > = 2.0 only supports Solr Server > = 4.0
</para>
</warning>
</refsect1>
2009-10-03 04:50:06 +00:00
<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
2010-02-03 13:10:56 +00:00
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
2009-10-03 04:50:06 +00:00
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
-->