public function omnisearch(Request $request)
    {
        $query = $request->query->get('q', '');
        $records = [];
        $others = [];

        if (strlen($query) >= 3) {
            foreach ($this->app['omnisearch']->query($query, true) as $result) {
                if (isset($result['slug'])) {
                    $records[$result['slug']][] = $result;
                } elseif ($result['priority'] !== Omnisearch::OMNISEARCH_LANDINGPAGE) {
                    $others[] = $result;
                }
            }
        }

        $context = [
            'query'   => $query,
            'records' => $records,
            'others'  => $others,
        ];

        return $this->render('@bolt/omnisearch/omnisearch.twig', $context);
    }
public function omnisearch(Request $request)
    {
        $query = $request->query->get('q', '');
        $records = [];
        $others = [];

        if (strlen($query) >= 3) {
            foreach ($this->app['omnisearch']->query($query, true) as $result) {
                if (isset($result['slug'])) {
                    $records[$result['slug']][] = $result;
                } elseif ($result['priority'] !== Omnisearch::OMNISEARCH_LANDINGPAGE) {
                    $others[] = $result;
                }
            }
        }

        $context = [
            'query'   => $query,
            'records' => $records,
            'others'  => $others,
        ];

        return $this->render('@bolt/omnisearch/omnisearch.twig', $context);
    }
public function omnisearch ( Request $ request ) { $ query = $ request -> query -> get ( 'q' , '' ) ; $ records = [ ] ; $ others = [ ] ; if ( strlen ( $ query ) >= 3 ) { foreach ( $ this -> app [ 'omnisearch' ] -> query ( $ query , true ) as $ result ) { if ( isset ( $ result [ 'slug' ] ) ) { $ records [ $ result [ 'slug' ] ] [ ] = $ result ; } elseif ( $ result [ 'priority' ] !== Omnisearch :: OMNISEARCH_LANDINGPAGE ) { $ others [ ] = $ result ; } } } $ context = [ 'query' => $ query , 'records' => $ records , 'others' => $ others , ] ; return $ this -> render ( '@bolt/omnisearch/omnisearch.twig' , $ context ) ; }
Show the Omnisearch results.

@param Request $request The Symfony Request

@return \Bolt\Response\TemplateResponse
Show the Omnisearch results .