original_string: public function indexSearch($searchText, $maxResults)
      {
          // split the phrase into words
          $words = SearchAnalyser::analyse($searchText);
          if (!$words) {
              return [];
          }
  
          $query = $this->_em->createQueryBuilder()
              ->select('o')
              ->from($this->_entityName, 'o')
              ->setMaxResults($maxResults);
  
          $parameters = [];
          foreach ($words as $k => $word) {
              $subquery = $this->_em->createQueryBuilder()
                  ->select("i$k.keyword")
                  ->from($this->getSearchIndexClass(), "i$k")
                  ->where("i$k.object = o")
                  ->andWhere("i$k.keyword ILIKE :search$k");
              $query->andWhere($query->expr()->exists($subquery->getDql()));
              $parameters["search$k"] = '%' . $word . '%';
          }
          $query->setParameters($parameters);
  
          $results = $query->getQuery()->execute();
  
          return $results;
      }
code: public function indexSearch($searchText, $maxResults)
      {
          // split the phrase into words
          $words = SearchAnalyser::analyse($searchText);
          if (!$words) {
              return [];
          }
  
          $query = $this->_em->createQueryBuilder()
              ->select('o')
              ->from($this->_entityName, 'o')
              ->setMaxResults($maxResults);
  
          $parameters = [];
          foreach ($words as $k => $word) {
              $subquery = $this->_em->createQueryBuilder()
                  ->select("i$k.keyword")
                  ->from($this->getSearchIndexClass(), "i$k")
                  ->where("i$k.object = o")
                  ->andWhere("i$k.keyword ILIKE :search$k");
              $query->andWhere($query->expr()->exists($subquery->getDql()));
              $parameters["search$k"] = '%' . $word . '%';
          }
          $query->setParameters($parameters);
  
          $results = $query->getQuery()->execute();
  
          return $results;
      }
code_tokens: public function indexSearch ( $ searchText , $ maxResults ) { // split the phrase into words $ words = SearchAnalyser :: analyse ( $ searchText ) ; if ( ! $ words ) { return [ ] ; } $ query = $ this -> _em -> createQueryBuilder ( ) -> select ( 'o' ) -> from ( $ this -> _entityName , 'o' ) -> setMaxResults ( $ maxResults ) ; $ parameters = [ ] ; foreach ( $ words as $ k => $ word ) { $ subquery = $ this -> _em -> createQueryBuilder ( ) -> select ( "i$k.keyword" ) -> from ( $ this -> getSearchIndexClass ( ) , "i$k" ) -> where ( "i$k.object = o" ) -> andWhere ( "i$k.keyword ILIKE :search$k" ) ; $ query -> andWhere ( $ query -> expr ( ) -> exists ( $ subquery -> getDql ( ) ) ) ; $ parameters [ "search$k" ] = '%' . $ word . '%' ; } $ query -> setParameters ( $ parameters ) ; $ results = $ query -> getQuery ( ) -> execute ( ) ; return $ results ; }
docstring: Find the entities that have the appropriate keywords in their searchIndex.
  
  @param string $searchText
  @param int    $maxResults
  
  @return Collection found entities
docstring_tokens: Find the entities that have the appropriate keywords in their searchIndex .