Get searchable column indexes

@return array
161195
public function searchableColumnIndex()
    {
        $searchable = [];
        for ($i = 0, $c = count($this->get('columns')); $i < $c; $i++) {
            if ($this->isColumnSearchable($i, false)) {
                $searchable[] = $i;
            }
        }

        return $searchable;
    }
390800
protected function getColumns()
    {
        if (array_key_exists('columns', $this->searchable)) {
            $driver = $this->getDatabaseDriver();
            $prefix = Config::get("database.connections.$driver.prefix");
            $columns = [];
            foreach($this->searchable['columns'] as $column => $priority){
                $columns[$prefix . $column] = $priority;
            }
            return $columns;
        } else {
            return DB::connection()->getSchemaBuilder()->getColumnListing($this->table);
        }
    }
116124
public function getColumns()
    {
        $session = request()->session();
        $key     = $this->key();
        if (!$session->has($key)) {
            return $this->columns;
        }
        $config = $session->get($key);
        foreach ($this->columns as $index => $column) {
            if (!isset($config[$index])) {
                continue;
            }
            $column->visible = $config[$index];
        }

        return $this->columns;
    }
192317
private function getColumns()
    {
        $table = $this->table->connect($this->database, Inflector::tabilize($this->tableName));

        return $table->getColumns();
    }
534654
public function getSearchableRules(): array
    {
        return [
            'roles:[]' => function (Builder $query, array $roles) {
                return $query->whereHas('roles', function (Builder $query) use ($roles) {
                    return $query->whereIn(Role::column('name'), $roles);
                });
            },
        ];
    }
1248294
protected function getColumns()
    {
        $availableColumns = array_map('strtolower', $this->headers);

        if ($this->option('compact')) {
            return array_intersect($availableColumns, $this->compactColumns);
        }

        if ($columns = $this->option('columns')) {
            return array_intersect($availableColumns, $columns);
        }

        return $availableColumns;
    }
1160072
private function getSavedSearchWidgets(): array
    {
        $table = TableRegistry::get('Search.SavedSearches');

        $query = $table->find('all')
            ->where([
                'SavedSearches.name IS NOT' => null,
                'SavedSearches.name !=' => '',
                'SavedSearches.system' => false
            ])
            ->enableHydration(false)
            ->indexBy('id');

        if ($query->isEmpty()) {
            return [];
        }

        return [
            ['type' => 'saved_search', 'data' => $query->toArray()]
        ];
    }
872427
public function getIndexes($columnName = null) {
        if (!$this->indexes) {
            $this->indexes = array();
        }
        return ($columnName) ? $this->indexes[$columnName] : $this->indexes;
    }
94862
public function getIndexDefinition()
    {
        return [
            'tag_keywords' => new Search\FieldType\MultipleStringField(),
            'parent_tag_ids' => new Search\FieldType\MultipleIntegerField(),
            'tag_ids' => new Search\FieldType\MultipleIntegerField(),
            'tag_text' => new Search\FieldType\TextField(),
            'fulltext' => new Search\FieldType\FullTextField(),
        ];
    }
1140001
public function getSearchFields()
    {
        $searchFields = array();

        // return false if nothing is specified
        if (!isset($this->entitySearchFields) and !isset($this->suppliedSearchFields)) {
            return false;
        }

        // list supplied first so it will get overwritten by entity
        $sources = array(
            'suppliedSearchFields',
            'entitySearchFields'
        );

        foreach ($sources as $source) {
            if (isset($this->$source)) {
                foreach ($this->$source as $key => $value) {
                    $searchFields[$key] = $value;
                }
            }
        }

        return $searchFields;
    }
168390
public function columns(): array
    {
        $columns = $this->columns ?: [];

        if ( ! count($columns)) {
            $columns = $this->getGroupContentColumns();
        }

        // If columns are set, fill them out if they don't fit the grid
        if ($remainder = $this->getRemainderForColumns($columns)) {
            $columns[ count($columns) - 1 ] += $remainder;
        }

        return $columns;
    }
515727
public function getColumnNames()
    {
        $columns = array();
        foreach ($this->childs as $column) {
            $columns[] = $column->getColumnName();
        }

        return $columns;
    }
1328499
final public static function getColumns()
    {
        $result = [];
        foreach (static::COLUMNS as $column) {
            $result[] = trim(explode('[', $column, 2)[0]);
        }
        return $result;
    }
1122212
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'], true)) {
                    $weight = 100;
                } else {
                    $weight = 50;
                }

                if (!$this->isInvisible($type)) {
                    $this->searchableTypes[$type][$field] = ['weight' => $weight];
                } else {
                    $this->invisibleTypes[$type][$field] = ['weight' => $weight];
                }
            }
        }
    }
576991
public function getVisibleColumns()
    {
        $definitions = $this->defineListColumns();
        $columns = [];

        /*
         * Supplied column list
         */
        if ($this->columnOverride === null) {
            $this->columnOverride = $this->getSession('visible', null);
        }

        if ($this->columnOverride && is_array($this->columnOverride)) {

            $invalidColumns = array_diff($this->columnOverride, array_keys($definitions));
            if (!count($definitions)) {
                throw new ApplicationException(Lang::get(
                    'backend::lang.list.missing_column',
                    ['columns'=>implode(',', $invalidColumns)]
                ));
            }

            $availableColumns = array_intersect($this->columnOverride, array_keys($definitions));
            foreach ($availableColumns as $columnName) {
                $definitions[$columnName]->invisible = false;
                $columns[$columnName] = $definitions[$columnName];
            }
        }
        /*
         * Use default column list
         */
        else {
            foreach ($definitions as $columnName => $column) {
                if ($column->invisible) {
                    continue;
                }

                $columns[$columnName] = $definitions[$columnName];
            }
        }

        return $this->visibleColumns = $columns;
    }
404253
public function getColumns(): array
    {
        $tSelects = isset($this->statements['selects']) === true ? $this->statements['selects'] : [];
        $tColumns = [];
        foreach ($tSelects as $key => $value) {
            if (\is_string($value)) {
                if (\is_int($key)) {
                    $tElements = explode('.', $value);
                    if (!\in_array('*', $tElements, true)) {
                        $tColumns[$tElements[1] ?? $tElements[0]] = $value;
                    }
                } elseif (\is_string($key)) {
                    $tColumns[$value] = $key;
                }
            }
        }
        return $tColumns;
    }
380961
public function findIndexable()
    {
        return $this->createQueryBuilder('c')
            ->where('c.indexable = :indexable')
            ->Andwhere('c.active = :active')
            ->Andwhere('c.layout = :layout')
            ->setParameters([
                'active' => true,
                'layout' => false,
                'indexable' => true
            ])
            ->orderBy('c.slug', 'ASC')
            ->getQuery()
            ->getResult();
    }