2
votes

Is there any way to do index based search on sub-graph in neo4j?

In Cypher we first select nodes from index and then match with the graph relationships or properties, I want something like first I select a sub-graph(based on relationships) and then search in index for that subgraph nodes(sub index of the original index).

1
I don't understand what you want to do. Do you think you can give a concrete example of what you need?Andres
E.g I have a network, I have 100 persons(1..100) and 100 connected people of each, so that 100x100 relationships. Now lets say I want to search for a name "John" in person1's network my query should be start a=(nameindex,'name:*John*'), b=(1) match (b) - [:REL^1..3] - (a) return a. But, this takes a lot of time. What I want is a subgraph of person1 and then on that sub-graph I search using on nameindex.wakeup

1 Answers

0
votes

There is no way to do this. The index has no way of limiting your search to a particular subgraph. You're probably better off putting a regular expression in your where clause for your John query.