cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Hello, How can I go through the paths of a query in different ways?

jggomez
Graph Voyager

Hello, How can I go through the paths of a query in different ways?
random the paths, because neo4j always returns the same paths

Thanks

2 REPLIES 2

can you share the query you're using?

In general:

match path = (p:Person {name:"Juan"})-[:KNOWS*5]-() 
where rand() > 0.5
return path limit 10

I have many nodes (100000 nodes) with videos so the user writes a word and the system returns videos with this word but the query always returns de same and is slow to collect and shuffle it. I want that the query result for example 50.000 nodes to select random

The query is large, the following is a part

MATCH (interest:INTEREST) - [:HAS_CONTENT] -> (content:CONTENT) - [has_word:HAS_WORD] -> (word:WORD)-[:HAS_LEMMA]->(:LEMMA{text:lemma})
......

the previous can have many paths but I limit it to 20, it always returns the same nodes.

.....