For any index usage you need the label AND a property

Only with the label, none of your two indexes will be used, but an internal 
label -> nodes index.

Your index is only used if you do this:

> MATCH (n:Person {name:"Philip"}) RETURN n.name, n.job

or this
> MATCH (n:Person) WHERE n.name = "Philip" RETURN n.name, n.job


Am 19.01.2014 um 11:24 schrieb Sylvain Roussy <[email protected]>:

> Hi all,
> 
> I'm trying the use of index with Cypher and I have a doubt about the USING 
> INDEX clause usage :
> 
> Consider three nodes :
> 
> :Person {name:"Sylvain", job:"Developper"}
> 
> :Person {name:"Philip", job:"Developper"}
> 
> :Person {name:"Chritopher"}
> 
> With two indexes :
> 
> ON :Person(name) ONLINE  
> ON :Person(job) ONLINE  
> How is resolved this query ? :
> 
> MATCH (n:Person) RETURN n.name, n.job
> 
> With or without index use ?
> 
> But if I try the following query :
> 
> MATCH (n:Person) USING INDEX n:Person(job) RETURN n.name
> 
> I obtain the following result : 
> 
> Cannot use index hint in this context. The label and property comparison must 
> be specified on a non-optional node
> Label: `Person`
> Property name: `job`
> 
> I thought the response must be all persons hint by the index (just Sylvain 
> and Philip) but not...
> 
> Someone could explain to me why ?
> 
> Thanks.
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to