src/Searchable.php
public static function Results($classname, $columns, $keywords, $limit = 0)
     {
        $cols_string = implode('","', $columns);
        $custom_filters = Searchable::config()->custom_filters;
        $results = ArrayList::create();

        $filter = [];

        foreach ($columns as $col) {
            $filter["{$col}:PartialMatch"] = $keywords;
        }

        $search = $classname::get()
            ->filterAny($filter);

        if (is_array($custom_filters) && array_key_exists($classname, $custom_filters) && is_array($custom_filters[$classname])) {
            $search = $search->filter($custom_filters[$classname]);
        }

        $searchable = Searchable::create();

        if ($searchable->hasMethod('filterResultsByCallback')) {
            $search = $searchable->filterResultsByCallback($search, $classname);
        }

        if ($limit) {
            $search = $search->limit($limit);
        }

        foreach ($search as $result) {
            if ($result->canView() || (isset($result->ShowInSearch) && $result->ShowInSearch)) {
                $results->add($result);
            }
        }

        return $results;
     }
public static function Results($classname, $columns, $keywords, $limit = 0)
     {
        $cols_string = implode('","', $columns);
        $custom_filters = Searchable::config()->custom_filters;
        $results = ArrayList::create();

        $filter = [];

        foreach ($columns as $col) {
            $filter["{$col}:PartialMatch"] = $keywords;
        }

        $search = $classname::get()
            ->filterAny($filter);

        if (is_array($custom_filters) && array_key_exists($classname, $custom_filters) && is_array($custom_filters[$classname])) {
            $search = $search->filter($custom_filters[$classname]);
        }

        $searchable = Searchable::create();

        if ($searchable->hasMethod('filterResultsByCallback')) {
            $search = $searchable->filterResultsByCallback($search, $classname);
        }

        if ($limit) {
            $search = $search->limit($limit);
        }

        foreach ($search as $result) {
            if ($result->canView() || (isset($result->ShowInSearch) && $result->ShowInSearch)) {
                $results->add($result);
            }
        }

        return $results;
     }
Return DataList of the results using $_REQUEST to get search info
Wraps around {@link searchEngine()}.

Results also checks to see if there is a custom filter set in
configuration and adds it.

@param $classname Name of the object we will be filtering
@param $columns an array of the column names we will be sorting
@param $query the current search query

@return SS_List