public function index($dataObject, $stage=null, $fieldBoost = array()) {

		$document = $this->convertObjectToDocument($dataObject, $stage, $fieldBoost);

		if ($document) {
			try {
				$this->getSolr()->addDocument($document);
				$this->getSolr()->commit();
				
				// optimize every so often
				if (mt_rand(0, 100) == 42) {
					$this->getSolr()->optimize();
				}
			} catch (Exception $ie) {
				SS_Log::log($ie, SS_Log::ERR);
			}
		}
	}
public function index($dataObject, $stage=null, $fieldBoost = array()) {

		$document = $this->convertObjectToDocument($dataObject, $stage, $fieldBoost);

		if ($document) {
			try {
				$this->getSolr()->addDocument($document);
				$this->getSolr()->commit();
				
				// optimize every so often
				if (mt_rand(0, 100) == 42) {
					$this->getSolr()->optimize();
				}
			} catch (Exception $ie) {
				SS_Log::log($ie, SS_Log::ERR);
			}
		}
	}
public function index ( $ dataObject , $ stage = null , $ fieldBoost = array ( ) ) { $ document = $ this -> convertObjectToDocument ( $ dataObject , $ stage , $ fieldBoost ) ; if ( $ document ) { try { $ this -> getSolr ( ) -> addDocument ( $ document ) ; $ this -> getSolr ( ) -> commit ( ) ; // optimize every so often if ( mt_rand ( 0 , 100 ) == 42 ) { $ this -> getSolr ( ) -> optimize ( ) ; } } catch ( Exception $ ie ) { SS_Log :: log ( $ ie , SS_Log :: ERR ) ; } } }
Assuming here that we're indexing a stdClass object
with an ID field that is a unique identifier

Note that the structur eof the object array must be

array(
'FieldName' => array(
'Type' => 'Fieldtype (eg date, string, int)',
'Value' => 'Actualvalue'
)
)

You should include a field named 'ID' that dictates the
ID of the object, and a field named 'ClassName' that is the
name of the document's type

@param DataObject $object
The object being indexed
@param String $stage
If we're indexing for a particular stage or not.
Assuming here that we re indexing a stdClass object with an ID field that is a unique identifier