Command/IndexCommand.php
/**
     * Start a consumer that retrieved documents that have to be saved to the index.
     *
     * @param \Symfony\Component\Console\Input\InputInterface   $input
     * @param \Symfony\Component\Console\Output\OutputInterface $output
     *
     * @return integer
     */
Start a consumer that retrieved documents that have to be saved to the index.

@return integer
Start a consumer that retrieved documents that have to be saved to the index . @return integer
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->queue->listen(function ($message) {
            if (strlen($message->body) == 0) {
                $this->queue->rejectMessage($message);
                return;
            }
            $data = json_decode($message->body, true);
            $this->indexer->prepareDocument($message);
            $this->queue->acknowledge($message);
        });
        return 1;
    }
protected function execute ( InputInterface $ input , OutputInterface $ output ) { $ this -> queue -> listen ( function ( $ message ) { if ( strlen ( $ message -> body ) == 0 ) { $ this -> queue -> rejectMessage ( $ message ) ; return ; } $ data = json_decode ( $ message -> body , true ) ; $ this -> indexer -> prepareDocument ( $ message ) ; $ this -> queue -> acknowledge ( $ message ) ; } ) ; return 1 ; }
Start a consumer that retrieved documents that have to be saved to the index.
Start a consumer that retrieved documents that have to be saved to the index .