Sorry 1 more question is it possible to put it all in one list?
You mean the result of both part?
Yea basically merge the result into one?
What do you get currently?
Right now it is two separate, so is it possible to use some map projection.
Show me a screenshot of what you have at the moment and write a short example of what you expect please
You have already the node
in assetdata
so you can remove the node
in the return?
CALL db.index.fulltext.queryNodes('livesearch', '*t*')
YIELD node
MATCH (g:Group)-[:GROUPS]->(node)<-[:ON]-(:Deploy)<-[:SCHEDULED]-(d:Device)
RETURN DISTINCT collect({device:d.sigfox_id, asset:node, group:g}) AS assetdata
UNION
CALL db.index.fulltext.queryNodes('livesearch', '*t*')
YIELD node
MATCH (node)-[:GROUPS]->(a:Asset)<-[:ON]-(:Deployment)<-[:SCHEDULED]-(d:Device)
RETURN DISTINCT collect({device:d.sigfox_id, asset:a, group:node}) AS assetdata
Otherwise you can get a list of dict like this:
CALL {
CALL db.index.fulltext.queryNodes('livesearch', '*t*')
YIELD node
MATCH (g:Group)-[:GROUPS]->(node)<-[:ON]-(:Deploy)<-[:SCHEDULED]-(d:Device)
RETURN DISTINCT collect({device:d.sigfox_id, asset:node, group:g}) AS assetdata, node
UNION
CALL db.index.fulltext.queryNodes('livesearch', '*t*')
YIELD node
MATCH (node)-[:GROUPS]->(a:Asset)<-[:ON]-(:Deployment)<-[:SCHEDULED]-(d:Device)
RETURN DISTINCT collect({device:d.sigfox_id, asset:a, group:node}) AS assetdata, node
} RETURN collect({assetdata: assetdata, node: node})
1 Like