1818use Doctrine \ORM \EntityManagerInterface ;
1919use Doctrine \ORM \Internal \Hydration \IterableResult ;
2020use Doctrine \ORM \QueryBuilder ;
21+ use Flowpack \ElasticSearch \ContentRepositoryAdaptor \Service \NodeTypeIndexingConfiguration ;
2122use Neos \ContentRepository \Domain \Model \NodeData ;
2223use Neos \Flow \Annotations as Flow ;
2324use Neos \Flow \Persistence \Repository ;
@@ -29,6 +30,12 @@ class NodeDataRepository extends Repository
2930{
3031 public const ENTITY_CLASSNAME = NodeData::class;
3132
33+ /**
34+ * @Flow\Inject
35+ * @var NodeTypeIndexingConfiguration
36+ */
37+ protected $ nodeTypeIndexingConfiguration ;
38+
3239 /**
3340 * @Flow\Inject
3441 * @var EntityManagerInterface
@@ -40,15 +47,21 @@ class NodeDataRepository extends Repository
4047 * @param integer $firstResult
4148 * @param integer $maxResults
4249 * @return IterableResult
50+ * @throws \Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception
4351 */
4452 public function findAllBySiteAndWorkspace ($ workspaceName , $ firstResult = 0 , $ maxResults = 1000 ): IterableResult
4553 {
4654 /** @var QueryBuilder $queryBuilder */
4755 $ queryBuilder = $ this ->entityManager ->createQueryBuilder ();
4856
57+ $ excludedNodeTypes = array_keys (array_filter ($ this ->nodeTypeIndexingConfiguration ->getIndexableConfiguration (), static function ($ value ) {
58+ return !$ value ;
59+ }));
60+
4961 $ queryBuilder ->select ('n.Persistence_Object_Identifier persistenceObjectIdentifier, n.identifier identifier, n.dimensionValues dimensions, n.nodeType nodeType, n.path path ' )
5062 ->from (NodeData::class, 'n ' )
51- ->where ("n.workspace = :workspace AND n.removed = :removed AND n.movedTo IS NULL " )
63+ ->where ('n.workspace = :workspace AND n.removed = :removed AND n.movedTo IS NULL ' )
64+ ->andWhere ($ queryBuilder ->expr ()->notIn ('n.nodeType ' , $ excludedNodeTypes ))
5265 ->setFirstResult ((integer )$ firstResult )
5366 ->setMaxResults ((integer )$ maxResults )
5467 ->setParameters ([
0 commit comments