private function buildArray(array $fieldProperties = [])
    {
        $baseProperties = [ ];

        if ($this->type !== self::TYPE_OBJECT) {
            $baseProperties['type'] = $this->type;
        } else {
            $baseProperties['properties'] = [];
        }

        if (! $this->indexed) {
            $baseProperties['index'] = 'no';
        } elseif ($this->raw) {
            $baseProperties['index'] = 'not_analyzed';
        }

        if (! $this->enabled) {
            $baseProperties['enabled'] = false;
        }

        return array_replace($baseProperties, $fieldProperties);
    }