Neo4j full text search - common node

I need to find one common node for FTS results. enter image description here

I have created fts index on TRANSLATION node type on "text" property. Now I have keywords “home” and “house” and want to search for BOX node that have something in common with those words. So query should return node BOX with id “b1” because it has DETAILs that have TRANSLATION that contains “home” and “house”.

BOX node with id "b2" should not be returned because it contains only "house" keyword but not "home".

How to achieve that? Is it possible with fts? Maybe I have to index it another way? One thing that comes to mind is to call FTS two (or x) times for every keyword and then get nodes that appeared in both (x) results.

If you pass in the keywords as list to construct your FTS query, you can aggregate and collect all the translation nodes per box and see if the number of translation nodes matches the number of keywords.

You could also additionally check if each keyword is at least once contained in one box node.

WITH ["home","house"] as keywords
CALL db.index.fulltext.queryNodes('index', apoc.text.join(keywords, " ")) yield node
MATCH (node)<-[:HAS_TRANSLATION]-()<-[:HAS_DETAILS]-(b:Box)
WITH keywords, b, collect(node) as nodes
WHERE size(keywords) = size(nodes)
AND ALL(kw in keywords WHERE any(n IN nodes WHERE n.text contains kw))
RETURN b