SphinxClient::FlushAttributes PHP Method

FlushAttributes() public method

public FlushAttributes ( )
    function FlushAttributes()
    {
        $this->_MBPush();
        if (!($fp = $this->_Connect())) {
            $this->_MBPop();
            return -1;
        }
        $req = pack("nnN", SEARCHD_COMMAND_FLUSHATTRS, VER_COMMAND_FLUSHATTRS, 0);
        // len=0
        if (!$this->_Send($fp, $req, 8) || !($response = $this->_GetResponse($fp, VER_COMMAND_FLUSHATTRS))) {
            $this->_MBPop();
            return -1;
        }
        $tag = -1;
        if (strlen($response) == 4) {
            list(, $tag) = unpack("N*", $response);
        } else {
            $this->_error = "unexpected response length";
        }
        $this->_MBPop();
        return $tag;
    }

Usage Example

Esempio n. 1
0
<?php

require "spec/fixtures/sphinxapi.php";
$cl = new SphinxClient();
$cl->FlushAttributes();