I ran similarity algo (GDS) on a memory graph, this gives me this result (showing the result in the table format):
If I want to return the top similarity pair, I can use limit 1 instead of 3 to get the top result. (Result with the maximum similarity).
But I want to only return the third most similar similarity pair, how can I do that?
Basically, my result should be something like this:
Cobra
(Cobra)
June 3, 2021, 9:58am
2
Hello @abhishekjayant1
You should have a look at SKIP , in your case:
ORDER BY similarity DESC SKIP 2 LIMIT 1
Regards,
Cobra
Hi @Cobra , thanks for helping out again . This is exactly what I wanted.
However, can you also tell me how to exclude the duplicate similarity pair when I run the node similarity algo. I've shown the duplicate pairs below:
I get these duplicate pairs, how can I get rid of these?
PS: I do now want to use write mode, only want to use stream.
Cobra
(Cobra)
June 3, 2021, 11:44am
4
You can modify your WHERE clause like this:
WHERE n1:Adverse_Event
AND n2:Adverse_Event
AND id(n1) > id(n2)
Solved the problem. Thank you so much!