[SOLVED] NodeSearchService

Hi,

does anybody know how to search for properties type reference with

//this one results in NULL
$nodes = $this->nodeSearchService->findByProperties(['attributes' => $nodeIdentifier], [$pageNodeType], $context);

//this one results as expected
$nodes = $this->nodeSearchService->findByProperties(['title' => 'Test'], [$pageNodeType], $context);

NodeTypes.Yaml

properties:
  attributes:
    type: references
    ui:
      label: i18n
      reloadIfChanged: TRUE
      inspector:
        group: 'filters'
        position: 20
        editorOptions:
          nodeTypes: ['My.Package:AttributeItem']

Thanks for advice!

Ok, found a solution. I added a class like:

Added my properties in getPropertyPath and then use FlowQuery to get selected properties …

$context = $this->contextFactory->create([]);
$rootNode = $context->getRootNode();
$flowQuery = new \TYPO3\Eel\FlowQuery\FlowQuery(array($rootNode));
$nodes = $flowQuery->find('[instanceof My.Package:Product]')->filter('[attributes *= "' .$nodeIdentifier. '"]')->get();

Inspired by http://git.obis-concept.de/obisconcept/neos-products-plugin

Dont know if its the best way but it works :smiley:

And i also can use OR operations for other properties …

Thanks!