private function getFieldWeights()
    {
        // This could be more configurable
        // (see also Storage->searchSingleContentType)
        $searchableTypes = ['text', 'textarea', 'html', 'markdown'];

        $fields = [];
        $slugFields = [];

        // The field(s) that are used by the slug need to be bumped, unless configured explicitly
        foreach ($this->contenttype['fields'] as $config) {
            if ($config['type'] === 'slug' && isset($config['uses'])) {
                $slugFields = (array) $config['uses'];
            }
        }

        // Set the searchweights to the configured value, otherwise default to '50' or '100'
        foreach ($this->contenttype['fields'] as $key => $config) {
            if (in_array($config['type'], $searchableTypes)) {
                $defaultValue = in_array($key, $slugFields) ? 100 : 50;
                $fields[$key] = isset($config['searchweight']) ? $config['searchweight'] : $defaultValue;
            }
        }

        return $fields;
    }
private function getFieldWeights()
    {
        // This could be more configurable
        // (see also Storage->searchSingleContentType)
        $searchableTypes = ['text', 'textarea', 'html', 'markdown'];

        $fields = [];
        $slugFields = [];

        // The field(s) that are used by the slug need to be bumped, unless configured explicitly
        foreach ($this->contenttype['fields'] as $config) {
            if ($config['type'] === 'slug' && isset($config['uses'])) {
                $slugFields = (array) $config['uses'];
            }
        }

        // Set the searchweights to the configured value, otherwise default to '50' or '100'
        foreach ($this->contenttype['fields'] as $key => $config) {
            if (in_array($config['type'], $searchableTypes)) {
                $defaultValue = in_array($key, $slugFields) ? 100 : 50;
                $fields[$key] = isset($config['searchweight']) ? $config['searchweight'] : $defaultValue;
            }
        }

        return $fields;
    }
private function getFieldWeights ( ) { // This could be more configurable // (see also Storage->searchSingleContentType) $ searchableTypes = [ 'text' , 'textarea' , 'html' , 'markdown' ] ; $ fields = [ ] ; $ slugFields = [ ] ; // The field(s) that are used by the slug need to be bumped, unless configured explicitly foreach ( $ this -> contenttype [ 'fields' ] as $ config ) { if ( $ config [ 'type' ] === 'slug' && isset ( $ config [ 'uses' ] ) ) { $ slugFields = ( array ) $ config [ 'uses' ] ; } } // Set the searchweights to the configured value, otherwise default to '50' or '100' foreach ( $ this -> contenttype [ 'fields' ] as $ key => $ config ) { if ( in_array ( $ config [ 'type' ] , $ searchableTypes ) ) { $ defaultValue = in_array ( $ key , $ slugFields ) ? 100 : 50 ; $ fields [ $ key ] = isset ( $ config [ 'searchweight' ] ) ? $ config [ 'searchweight' ] : $ defaultValue ; } } return $ fields ; }
Calculate the default field weights.

This gives more weight to the 'slug pointer fields'.

@return array
Calculate the default field weights .