public function getContentsBySlugsFunction($slugs, $keepOrder = false)
    {
        $search = $this->repository->createSearch();
        $search->addQuery(new TermsQuery('slug', $slugs), 'should');

        $result = $this->repository->execute($search);

        if ($keepOrder) {
            $orderedResult = [];
            foreach ($slugs as $slug) {
                foreach ($result as $document) {
                    if ($document->slug == $slug) {
                        $orderedResult[] = $document;
                    }
                }
            }

            $result = $orderedResult;
        }

        return $result;
    }
public function getContentsBySlugsFunction($slugs, $keepOrder = false)
    {
        $search = $this->repository->createSearch();
        $search->addQuery(new TermsQuery('slug', $slugs), 'should');

        $result = $this->repository->execute($search);

        if ($keepOrder) {
            $orderedResult = [];
            foreach ($slugs as $slug) {
                foreach ($result as $document) {
                    if ($document->slug == $slug) {
                        $orderedResult[] = $document;
                    }
                }
            }

            $result = $orderedResult;
        }

        return $result;
    }
public function getContentsBySlugsFunction ( $ slugs , $ keepOrder = false ) { $ search = $ this -> repository -> createSearch ( ) ; $ search -> addQuery ( new TermsQuery ( 'slug' , $ slugs ) , 'should' ) ; $ result = $ this -> repository -> execute ( $ search ) ; if ( $ keepOrder ) { $ orderedResult = [ ] ; foreach ( $ slugs as $ slug ) { foreach ( $ result as $ document ) { if ( $ document -> slug == $ slug ) { $ orderedResult [ ] = $ document ; } } } $ result = $ orderedResult ; } return $ result ; }
Return an array with content documents filtered by slugs array.

@param array $slugs
@param bool  $keepOrder

@return mixed
Return an array with content documents filtered by slugs array .