protected function indexItem(Item $item, $language = 0)
    {
        $itemIndexed = false;
        $documents = [];

        $itemDocument = $this->itemToDocument($item, $language);
        if (is_null($itemDocument)) {
            /*
             * If there is no itemDocument, this means there was no translation
             * for this record. This should not stop the current item to count as
             * being valid because not-indexing not-translated items is perfectly
             * fine.
             */
            return true;
        }

        $documents[] = $itemDocument;
        $documents = array_merge($documents, $this->getAdditionalDocuments($item, $language, $itemDocument));
        $documents = $this->processDocuments($item, $documents);
        $documents = $this->preAddModifyDocuments($item, $language, $documents);

        try {
            $response = $this->solr->getWriteService()->addDocuments($documents);
            if ($response->getHttpStatus() == 200) {
                $itemIndexed = true;
            }
        } catch (HttpException $e) {
            $response = new ResponseAdapter($e->getBody(), $httpStatus = 500, $e->getStatusMessage());
        }

        $this->log($item, $documents, $response);

        return $itemIndexed;
    }
protected function indexItem(Item $item, $language = 0)
    {
        $itemIndexed = false;
        $documents = [];

        $itemDocument = $this->itemToDocument($item, $language);
        if (is_null($itemDocument)) {
            /*
             * If there is no itemDocument, this means there was no translation
             * for this record. This should not stop the current item to count as
             * being valid because not-indexing not-translated items is perfectly
             * fine.
             */
            return true;
        }

        $documents[] = $itemDocument;
        $documents = array_merge($documents, $this->getAdditionalDocuments($item, $language, $itemDocument));
        $documents = $this->processDocuments($item, $documents);
        $documents = $this->preAddModifyDocuments($item, $language, $documents);

        try {
            $response = $this->solr->getWriteService()->addDocuments($documents);
            if ($response->getHttpStatus() == 200) {
                $itemIndexed = true;
            }
        } catch (HttpException $e) {
            $response = new ResponseAdapter($e->getBody(), $httpStatus = 500, $e->getStatusMessage());
        }

        $this->log($item, $documents, $response);

        return $itemIndexed;
    }
protected function indexItem ( Item $ item , $ language = 0 ) { $ itemIndexed = false ; $ documents = [ ] ; $ itemDocument = $ this -> itemToDocument ( $ item , $ language ) ; if ( is_null ( $ itemDocument ) ) { /*
             * If there is no itemDocument, this means there was no translation
             * for this record. This should not stop the current item to count as
             * being valid because not-indexing not-translated items is perfectly
             * fine.
             */ return true ; } $ documents [ ] = $ itemDocument ; $ documents = array_merge ( $ documents , $ this -> getAdditionalDocuments ( $ item , $ language , $ itemDocument ) ) ; $ documents = $ this -> processDocuments ( $ item , $ documents ) ; $ documents = $ this -> preAddModifyDocuments ( $ item , $ language , $ documents ) ; try { $ response = $ this -> solr -> getWriteService ( ) -> addDocuments ( $ documents ) ; if ( $ response -> getHttpStatus ( ) == 200 ) { $ itemIndexed = true ; } } catch ( HttpException $ e ) { $ response = new ResponseAdapter ( $ e -> getBody ( ) , $ httpStatus = 500 , $ e -> getStatusMessage ( ) ) ; } $ this -> log ( $ item , $ documents , $ response ) ; return $ itemIndexed ; }
Creates a single Solr Document for an item in a specific language.

@param Item $item An index queue item to index.
@param int $language The language to use.
@return bool TRUE if item was indexed successfully, FALSE on failure
Creates a single Solr Document for an item in a specific language .