I have a graph db with about 10000 docs (:jurt) and about 12000 terms (t:Term) from a vocabulary. There are about 1.2M relationships of type (j:jurt)-[:HAS_TERM]->(t:Term)
To find out which documents are similar to a given document, based on a count of common terms, I use this query match (j1:jurt)-[:HAS_TERM]->(t:Term)<-[:HAS_TERM]-(j2:jurt) where NOT (id(j1)=id(j2)) AND j1.jurt_id = 'J75312' with j1,j2,count(t) as commonterms return j1.jurt_id,j2.jurt_id,commonterms order by commonterms desc limit 3 What I notice is that the first time the query is run, the results are different from the next times... from the second time onwards, the results are the same. In between, there are no other processes running.. Whether I run the queries from the browser, the shell or the REST API, they all show the same phenomenon. neo4j-sh (?)$ match (j1:jurt)-[:HAS_TERM]->(t:Term)<-[:HAS_TERM]-(j2:jurt) where NOT (id(j1)=id(j2)) AND j1.jurt_id = 'J72887' with j1,j2,count(t) as commonterms return j1.jurt_id,j2.jurt_id,commonterms order by commonterms desc limit 3; +---------------------------------------+ | j1.jurt_id | j2.jurt_id | commonterms | +---------------------------------------+ | "J72887" | "J70059" | 226 | | "J72887" | "J75312" | 220 | | "J72887" | "J77444" | 215 | +---------------------------------------+ 3 rows 6288 ms neo4j-sh (?)$ match (j1:jurt)-[:HAS_TERM]->(t:Term)<-[:HAS_TERM]-(j2:jurt) where NOT (id(j1)=id(j2)) AND j1.jurt_id = 'J72887' with j1,j2,count(t) as commonterms return j1.jurt_id,j2.jurt_id,commonterms order by commonterms desc limit 3; +---------------------------------------+ | j1.jurt_id | j2.jurt_id | commonterms | +---------------------------------------+ | "J72887" | "J70059" | 227 | | "J72887" | "J75312" | 220 | | "J72887" | "J77444" | 219 | +---------------------------------------+ 3 rows 6299 ms neo4j-sh (?)$ match (j1:jurt)-[:HAS_TERM]->(t:Term)<-[:HAS_TERM]-(j2:jurt) where NOT (id(j1)=id(j2)) AND j1.jurt_id = 'J72887' with j1,j2,count(t) as commonterms return j1.jurt_id,j2.jurt_id,commonterms order by commonterms desc limit 3; +---------------------------------------+ | j1.jurt_id | j2.jurt_id | commonterms | +---------------------------------------+ | "J72887" | "J70059" | 227 | | "J72887" | "J75312" | 220 | | "J72887" | "J77444" | 219 | +---------------------------------------+ 3 rows 6354 ms neo4j-sh (?)$ match (j1:jurt)-[:HAS_TERM]->(t:Term)<-[:HAS_TERM]-(j2:jurt) where NOT (id(j1)=id(j2)) AND j1.jurt_id = 'J72887' with j1,j2,count(t) as commonterms return j1.jurt_id,j2.jurt_id,commonterms order by commonterms desc limit 3; +---------------------------------------+ | j1.jurt_id | j2.jurt_id | commonterms | +---------------------------------------+ | "J72887" | "J70059" | 227 | | "J72887" | "J75312" | 220 | | "J72887" | "J77444" | 219 | +---------------------------------------+ 3 rows 6108 ms What may cause this ? -- 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 neo4j+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.