neo4j / cypher-dsl

A Java DSL (Builder) for the Cypher Query Language
http://neo4j.github.io/cypher-dsl
Apache License 2.0
192 stars 62 forks source link

Allow MATCH after YIELD #193

Closed alxxyz closed 3 years ago

alxxyz commented 3 years ago

At the moment it is not possible to call match after yield The use case

CALL db.index.fulltext.queryNodes('livesearch', '*a*')
YIELD node
MATCH (g:Group)-[:GROUPS]->(a:Asset)<-[:ON]-(:Deploy)<-[:SCHEDULED]-(d:Device)
WHERE a.asset_id = node.asset_id
WITH DISTINCT collect(d{.sigfox_id,a}) as assetdata

https://community.neo4j.com/t/full-text-search-on-nodes-that-have-existing-relationships-efficiently/20476/7

michael-simons commented 3 years ago

Hi! I'll consult opencypher.org if this is always aloud. As. workaround, you could use an additional with

CALL db.index.fulltext.queryNodes('livesearch', '*a*')
YIELD node 
WITH node
MATCH (g:Group)-[:GROUPS]->(a:Asset)<-[:ON]-(:Deploy)<-[:SCHEDULED]-(d:Device)
WHERE a.asset_id = node.asset_id
WITH DISTINCT collect(d{.sigfox_id,a}) as assetdata
RETURN assetdata
michael-simons commented 3 years ago

Thanks, will be in the next release.