php-doc-en/reference/solr/solrclient/commit.xml
Christoph Michael Becker af5f2f87b3 Add PECL in front of version numbers in changelogs
Patch contributed by Benjamin Morel <benjamin.morel@gmail.com>.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350988 c90b9560-bf6c-de11-be94-00142212c4b1
2020-10-25 15:11:56 +00:00

154 lines
4.6 KiB
XML

<?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, 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 &gt;= 2.0 only supports Solr Server &gt;= 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
-->