On Wed, Sep 7, 2011 at 5:21 PM, Linan Wang <tali.w...@gmail.com> wrote: > hi, > I don't quite understand RelationshipIndex and RelationshipExpander. > say I have a supernode city (beijing), it has 10 m users links to > through relationship LIVES_IN. so how should I index? should be > something like: > RelationshipIndex idx = db.index().forRelationships("CITY_LIVES_IN"); > idx.add(rel, "LIVES_IN", "Beijing"); > if so, what's the advantage over this? > Index<Node> idx = db.index().forNodes("CITY_LIVES_IN"); > idx.add(user, "LIVES_IN", "beijing"); > (I read source code of LuceneIndex.java, found out that the > implementation of the add method is shared between Index<node> and > RelationshipIndex.) ok, i answer my own question: RelationshipIndex has the function query which takes startNode and endNode as extra parameters. so if traverse only depth 1, it could be faster than using Traverser. am i right here? (please say yes!) then the question is how to take advantage of it for more than 1?
> > about RelationshipExpander. i don't see how RelationshipIndex could > help combining with RelationshipExpander, when use > GraphAlgoFactory.shortestPath(RelationshipExpander expander, int > maxDepth)? > > thanks for help! > > -- > Best regards > > Linan Wang > -- Best regards Linan Wang _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user