public function findConceptsBulk(array $terms, $lang = null, $filter = null, $strict = false)
    {
        $this->logger->debug(sprintf('Finding linked concepts in bulk for %d terms', count($terms)));

        // We use the same filter for all terms when a single one is given
        $filters = is_array($filter)
            ? $filter
            : array_fill_keys(array_keys($terms), $filter);
        if (array_diff_key($terms, $filters)) {
            throw new InvalidArgumentException('Filters list must contain a filter for each term');
        }

        // TODO Use bulk queries for performance
        $concepts = array();
        foreach ($terms as $index => $term) {
            $strict |= ($term instanceof AST\TermNode);      // a "term" node is [strict group of words]
            $concepts[] = $this->findConcepts($term, $lang, $filters[$index], $strict);
        }

        return $concepts;
    }
public function findConceptsBulk(array $terms, $lang = null, $filter = null, $strict = false)
    {
        $this->logger->debug(sprintf('Finding linked concepts in bulk for %d terms', count($terms)));

        // We use the same filter for all terms when a single one is given
        $filters = is_array($filter)
            ? $filter
            : array_fill_keys(array_keys($terms), $filter);
        if (array_diff_key($terms, $filters)) {
            throw new InvalidArgumentException('Filters list must contain a filter for each term');
        }

        // TODO Use bulk queries for performance
        $concepts = array();
        foreach ($terms as $index => $term) {
            $strict |= ($term instanceof AST\TermNode);      // a "term" node is [strict group of words]
            $concepts[] = $this->findConcepts($term, $lang, $filters[$index], $strict);
        }

        return $concepts;
    }
public function findConceptsBulk ( array $ terms , $ lang = null , $ filter = null , $ strict = false ) { $ this -> logger -> debug ( sprintf ( 'Finding linked concepts in bulk for %d terms' , count ( $ terms ) ) ) ; // We use the same filter for all terms when a single one is given $ filters = is_array ( $ filter ) ? $ filter : array_fill_keys ( array_keys ( $ terms ) , $ filter ) ; if ( array_diff_key ( $ terms , $ filters ) ) { throw new InvalidArgumentException ( 'Filters list must contain a filter for each term' ) ; } // TODO Use bulk queries for performance $ concepts = array ( ) ; foreach ( $ terms as $ index => $ term ) { $ strict |= ( $ term instanceof AST \ TermNode ) ; // a "term" node is [strict group of words] $ concepts [ ] = $ this -> findConcepts ( $ term , $ lang , $ filters [ $ index ] , $ strict ) ; } return $ concepts ; }
Find concepts linked to a bulk of Terms

@param  Term[]|string[]      $terms  Term objects or strings
@param  string|null          $lang   Input language
@param  Filter[]|Filter|null $filter Single filter or a filter for each term
@param  boolean              $strict Strict mode matching
@return Concept[][]                  List of matching concepts for each term
Find concepts linked to a bulk of Terms