public function handleSearch(SS_HTTPRequest $request)
    {

        if ($request->getVar('search') === null) {
            return null;
        }

        $result = array();
        $searchTerm = $request->getVar('search');
        $list = File::get()->filterAny(array(
            'Title:PartialMatch' => $searchTerm,
            'Filename:PartialMatch' => $searchTerm
        ))->limit(100);

        $this->extend('beforeHandleSearch', $list, $searchTerm);

        foreach ($list as $item) {
            if (!$item->canView()) {
                continue;
            }
            $result[] = $item instanceof Folder ? $this->createFolderJson($item) : $this->createFileJson($item);
        }

        $response = new SS_HTTPResponse(
            Convert::array2json($result), 200
        );

        return $response->addHeader('Content-Type', 'application/json');
    }