Yes, you're right, didn't read that piece of code [ graphdb.index("cities") ]

it is graphDb.index().forNodes("cities").add/get

you add the "name" field to the index as otherwise there wouldn't be a 
distinction where "New York" appears (e.g. you have a name field and a 
destination that both can contain "New York" but you just want to get("name", 
"New York" and not those
containing it in the "destination" field. That's the way the Neo4j index API 
was designed. You also need the property names if you want to do querying as 
you have to be able to address the individual properties when comparing them to 
your search values.

Michael

Am 10.02.2011 um 13:28 schrieb Tom Smith:

> 
> On 10 Feb 2011, at 12:11, Michael Hunger wrote:
> 
>> so for your example it would look like:
>> 
>>> curl -Haccept:application/json -HContent-Type:application/json -X POST -d 
>>> '"http://localhost:7474/db/data/node/123";'http://localhost:7474/db/data/index/node/nodes/name/New%20York
>> 
>> Sorry, I thought someone updated the wiki, we had the discussion before. 
>> Will do it now.
> 
> Cheers.. but wouldn't it be...
> 
> curl -Haccept:application/json -HContent-Type:application/json -X POST -d 
> '"http://localhost:7474/db/data/node/123";'http://localhost:7474/db/data/index/node/cities/name/New%20York
> 
> ... if my index name was "cities"?
> 
> I'm slightly unsure why I'd have to specify /name/ too... something that in 
> the python api I don't do to add an item I would just...
> 
> cities[ "New York" ] = new_york_node
> 
> I don't mind giving an index value a "name" but just want to be sure I'm 
> doing it right...
> 
> thanks again
> 
> Tom
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to