Bolt\Storage\Query\SearchConfig::getSearchableColumns PHP Method

getSearchableColumns() protected method

Determine what columns are searchable for a given ContentType.
protected getSearchableColumns ( string $type ) : void
$type string
return void
    protected function getSearchableColumns($type)
    {
        $fields = $this->config->get('contenttypes/' . $type . '/fields');
        foreach ($fields as $field => $options) {
            if (in_array($options['type'], ['text', 'textarea', 'html', 'markdown']) || isset($options['searchable']) && $options['searchable'] === true) {
                if (isset($options['searchweight'])) {
                    $weight = (int) $options['searchweight'];
                } elseif (isset($fields['slug']['uses']) && in_array($field, (array) $fields['slug']['uses'])) {
                    $weight = 100;
                } else {
                    $weight = 50;
                }
                $this->searchableTypes[$type][$field] = ['weight' => $weight];
            }
        }
    }