Hey guys,

I'm pretty new to Neo4j, especially the indexing stuff.

Here's my situation. I want to be able to get nodes via one of their
properties; in this case let's say the Nodes represent a user & I want
to be able to grab a User's node via their username.

So, my initial attempt may be naive (no batching etc) but I've been
reading thru a a large text file (CSV format: username, userid),
creating a node for each of these lines & indexing the username
component.

Now this needs to be unique (given that usernames are unique) so I've
been using the SingleValueIndex and have run into a problem: It looks
like the SingleValueIndex actually does allow multiple values for a
given lookup (ex: username = phatduckk) however when trying to fetch a
Node from the index that has multiples (ie: username=phatduckk was
indexed twice) I get a NotFoundException with "More than one
relationship xxxx" as the message.

I have posted a skeleton piece of code that surfaces this problem over
at: http://gist.github.com/253553
This code does not make sure that the Node being indexed for a key is
always the same - it actually does the opposite: it tries to index
username=phatduckk w/ a different node each time.

The bit of code at http://gist.github.com/253569 does the opposite: i
tries to index the same node for the index username=phatduckk each
time.

I also have a few random questions sprinkled in the code as comments
which illustrate my noobiness =)

Honestly, I'm not claiming this is a bug - I may be completely
misusing and misunderstanding the indexing functionality but with my
limited experience it doesn't seem that SingleValueIndex is "single"
at all (hopefully - i'm just wrong and made a dumb mistake).

Thanks for the help guys,
Arin
_______________________________________________
Neo mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to