lib/Elastica/Index/Settings.php
public function get(string $setting = '')
    {
        $requestData = $this->request()->getData();
        $data = \reset($requestData);

        if (empty($data['settings']) || empty($data['settings']['index'])) {
            // should not append, the request should throw a ResponseException
            throw new NotFoundException('Index '.$this->getIndex()->getName().' not found');
        }
        $settings = $data['settings']['index'];

        if (!$setting) {
            // return all array
            return $settings;
        }

        if (isset($settings[$setting])) {
            return $settings[$setting];
        }

        if (false !== \strpos($setting, '.')) {
            // translate old dot-notation settings to nested arrays
            $keys = \explode('.', $setting);
            foreach ($keys as $key) {
                if (isset($settings[$key])) {
                    $settings = $settings[$key];
                } else {
                    return null;
                }
            }

            return $settings;
        }

        return null;
    }
public function get(string $setting = '')
    {
        $requestData = $this->request()->getData();
        $data = \reset($requestData);

        if (empty($data['settings']) || empty($data['settings']['index'])) {
            // should not append, the request should throw a ResponseException
            throw new NotFoundException('Index '.$this->getIndex()->getName().' not found');
        }
        $settings = $data['settings']['index'];

        if (!$setting) {
            // return all array
            return $settings;
        }

        if (isset($settings[$setting])) {
            return $settings[$setting];
        }

        if (false !== \strpos($setting, '.')) {
            // translate old dot-notation settings to nested arrays
            $keys = \explode('.', $setting);
            foreach ($keys as $key) {
                if (isset($settings[$key])) {
                    $settings = $settings[$key];
                } else {
                    return null;
                }
            }

            return $settings;
        }

        return null;
    }
public function get ( string $ setting = '' ) { $ requestData = $ this -> request ( ) -> getData ( ) ; $ data = \ reset ( $ requestData ) ; if ( empty ( $ data [ 'settings' ] ) || empty ( $ data [ 'settings' ] [ 'index' ] ) ) { // should not append, the request should throw a ResponseException throw new NotFoundException ( 'Index ' . $ this -> getIndex ( ) -> getName ( ) . ' not found' ) ; } $ settings = $ data [ 'settings' ] [ 'index' ] ; if ( ! $ setting ) { // return all array return $ settings ; } if ( isset ( $ settings [ $ setting ] ) ) { return $ settings [ $ setting ] ; } if ( false !== \ strpos ( $ setting , '.' ) ) { // translate old dot-notation settings to nested arrays $ keys = \ explode ( '.' , $ setting ) ; foreach ( $ keys as $ key ) { if ( isset ( $ settings [ $ key ] ) ) { $ settings = $ settings [ $ key ] ; } else { return null ; } } return $ settings ; } return null ; }
Returns the current settings of the index.

If param is set, only specified setting is return.
'index.' is added in front of $setting.

@param string $setting OPTIONAL Setting name to return

@return array|string|null Settings data

@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html
Returns the current settings of the index .