getQueryParams()['q']); $liveSearch = GeneralUtility::makeInstance(LiveSearch::class); $queryParser = GeneralUtility::makeInstance(QueryParser::class); $searchResults = []; $liveSearch->setQueryString($queryString); // Jump & edit - find page and retrieve an edit link (this is only for pages if ($queryParser->isValidPageJump($queryString)) { $commandQuery = $queryParser->getCommandForPageJump($queryString); if ($commandQuery) { $queryString = $commandQuery; } } // Search through the database and find records who match to the given search string $resultArray = $liveSearch->find($queryString); foreach ($resultArray as $resultFromTable) { foreach ($resultFromTable as $item) { $searchResults[] = $item; } } return (new JsonResponse())->setPayload($searchResults); } }