public function getElasticaFields() {
		$db = \DataObject::database_fields(get_class($this->owner));
		$fields = $this->owner->searchableFields();
		$result = new \ArrayObject();

		foreach ($fields as $name => $params) {
			$type = null;
			$spec = array();

			if (array_key_exists($name, $db)) {
				$class = $db[$name];

				if (($pos = strpos($class, '('))) {
					$class = substr($class, 0, $pos);
				}

				if (array_key_exists($class, self::$mappings)) {
					$spec['type'] = self::$mappings[$class];
				}
			}

			$result[$name] = $spec;
		}
        
        $result['LastEdited'] = array('type' => 'date');
        $result['Created'] = array('type' => 'date');
        $result['ID']       = array('type' => 'integer');

        $result['ParentID'] = array('type' => 'integer');
        $result['Sort'] = array('type' => 'integer');
        
        $result['Name'] = array('type' => 'string');
        $result['MenuTitle'] = array('type' => 'string');
        $result['ShowInSearch'] = array('type' => 'integer');
        
        $result['ClassName'] = array('type' => 'string');
        $result['ClassNameHierarchy'] = array('type' => 'string');

        $result['SS_Stage'] = array('type' => 'keyword');

        $result['PublicView'] = array('type' => 'boolean');

        if ($this->owner->hasExtension('Hierarchy') || $this->owner->hasField('ParentID')) {
            $result['ParentsHierarchy'] = array('type' => 'long',);
        }

        // fix up dates
        foreach ($result as $field => $spec) {
            if (isset($spec['type']) && ($spec['type'] == 'date')) {
                $spec['format'] = 'yyyy-MM-dd HH:mm:ss';
                $result[$field] = $spec;
            }
        }

        if (isset($result['Content']) && count($result['Content'])) {
            $spec = $result['Content'];
            $spec['store'] = false;
            $result['Content'] = $spec;
        }
        $this->owner->invokeWithExtensions('updateElasticMappings', $result);
        
		return $result->getArrayCopy();
	}
public function getElasticaFields() {
		$db = \DataObject::database_fields(get_class($this->owner));
		$fields = $this->owner->searchableFields();
		$result = new \ArrayObject();

		foreach ($fields as $name => $params) {
			$type = null;
			$spec = array();

			if (array_key_exists($name, $db)) {
				$class = $db[$name];

				if (($pos = strpos($class, '('))) {
					$class = substr($class, 0, $pos);
				}

				if (array_key_exists($class, self::$mappings)) {
					$spec['type'] = self::$mappings[$class];
				}
			}

			$result[$name] = $spec;
		}
        
        $result['LastEdited'] = array('type' => 'date');
        $result['Created'] = array('type' => 'date');
        $result['ID']       = array('type' => 'integer');

        $result['ParentID'] = array('type' => 'integer');
        $result['Sort'] = array('type' => 'integer');
        
        $result['Name'] = array('type' => 'string');
        $result['MenuTitle'] = array('type' => 'string');
        $result['ShowInSearch'] = array('type' => 'integer');
        
        $result['ClassName'] = array('type' => 'string');
        $result['ClassNameHierarchy'] = array('type' => 'string');

        $result['SS_Stage'] = array('type' => 'keyword');

        $result['PublicView'] = array('type' => 'boolean');

        if ($this->owner->hasExtension('Hierarchy') || $this->owner->hasField('ParentID')) {
            $result['ParentsHierarchy'] = array('type' => 'long',);
        }

        // fix up dates
        foreach ($result as $field => $spec) {
            if (isset($spec['type']) && ($spec['type'] == 'date')) {
                $spec['format'] = 'yyyy-MM-dd HH:mm:ss';
                $result[$field] = $spec;
            }
        }

        if (isset($result['Content']) && count($result['Content'])) {
            $spec = $result['Content'];
            $spec['store'] = false;
            $result['Content'] = $spec;
        }
        $this->owner->invokeWithExtensions('updateElasticMappings', $result);
        
		return $result->getArrayCopy();
	}
public function getElasticaFields ( ) { $ db = \ DataObject :: database_fields ( get_class ( $ this -> owner ) ) ; $ fields = $ this -> owner -> searchableFields ( ) ; $ result = new \ ArrayObject ( ) ; foreach ( $ fields as $ name => $ params ) { $ type = null ; $ spec = array ( ) ; if ( array_key_exists ( $ name , $ db ) ) { $ class = $ db [ $ name ] ; if ( ( $ pos = strpos ( $ class , '(' ) ) ) { $ class = substr ( $ class , 0 , $ pos ) ; } if ( array_key_exists ( $ class , self :: $ mappings ) ) { $ spec [ 'type' ] = self :: $ mappings [ $ class ] ; } } $ result [ $ name ] = $ spec ; } $ result [ 'LastEdited' ] = array ( 'type' => 'date' ) ; $ result [ 'Created' ] = array ( 'type' => 'date' ) ; $ result [ 'ID' ] = array ( 'type' => 'integer' ) ; $ result [ 'ParentID' ] = array ( 'type' => 'integer' ) ; $ result [ 'Sort' ] = array ( 'type' => 'integer' ) ; $ result [ 'Name' ] = array ( 'type' => 'string' ) ; $ result [ 'MenuTitle' ] = array ( 'type' => 'string' ) ; $ result [ 'ShowInSearch' ] = array ( 'type' => 'integer' ) ; $ result [ 'ClassName' ] = array ( 'type' => 'string' ) ; $ result [ 'ClassNameHierarchy' ] = array ( 'type' => 'string' ) ; $ result [ 'SS_Stage' ] = array ( 'type' => 'keyword' ) ; $ result [ 'PublicView' ] = array ( 'type' => 'boolean' ) ; if ( $ this -> owner -> hasExtension ( 'Hierarchy' ) || $ this -> owner -> hasField ( 'ParentID' ) ) { $ result [ 'ParentsHierarchy' ] = array ( 'type' => 'long' , ) ; } // fix up dates foreach ( $ result as $ field => $ spec ) { if ( isset ( $ spec [ 'type' ] ) && ( $ spec [ 'type' ] == 'date' ) ) { $ spec [ 'format' ] = 'yyyy-MM-dd HH:mm:ss' ; $ result [ $ field ] = $ spec ; } } if ( isset ( $ result [ 'Content' ] ) && count ( $ result [ 'Content' ] ) ) { $ spec = $ result [ 'Content' ] ; $ spec [ 'store' ] = false ; $ result [ 'Content' ] = $ spec ; } $ this -> owner -> invokeWithExtensions ( 'updateElasticMappings' , $ result ) ; return $ result -> getArrayCopy ( ) ; }
Gets an array of elastic field definitions.

@return array
Gets an array of elastic field definitions .