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

        if (strlen($query) < 3) {
            return $this->json([]);
        }

        $options = $this->app['omnisearch']->query($query);

        return $this->json($options);
    }
public function omnisearch(Request $request)
    {
        $query = $request->query->get('q', '');

        if (strlen($query) < 3) {
            return $this->json([]);
        }

        $options = $this->app['omnisearch']->query($query);

        return $this->json($options);
    }
public function omnisearch ( Request $ request ) { $ query = $ request -> query -> get ( 'q' , '' ) ; if ( strlen ( $ query ) < 3 ) { return $ this -> json ( [ ] ) ; } $ options = $ this -> app [ 'omnisearch' ] -> query ( $ query ) ; return $ this -> json ( $ options ) ; }
Perform an OmniSearch search and return the results.

@param Request $request

@return \Symfony\Component\HttpFoundation\JsonResponse
Perform an OmniSearch search and return the results .