Reputation: 2966
In my situation I've a bunch of nodes that represent the users and they have relation to books they read.
This user have a property that says where they are from, and I added them to an index, based on their country.
So I would like to search in the index for users from one country, and list the books that people from there read more, some sorting by grouping.
could any one give me a help how to do this? I'm having some trouble getting users from the index, and doing the query
Upvotes: 0
Views: 156
Reputation: 39915
Couple of assumptions based on your descriptions:
country
property, it contains e.g. France
as valueusers
and you store the user node's country
property thereREAD
title
propertyBased on these assumptions the cypher query would look like:
start user=node:users(country='France')
match user-[:READ]->book
return book.title, count(*) as rank
order by rank desc
limit 20
side note: best approach to ask this kind of questions is to create a sample graph on http://console.neo4j.org and share your setup on SO.
Upvotes: 1