veeseekay
veeseekay

Reputation: 59

spring data neo4j inconsistent query results

I am trying to build a recommendation engine using neo4j and use spring-data-neo4j as the persistence layer. i find that the cypher query executed by spring data gives results but with duplicate objects, the same query executed on the neo4j browser with the same data set produces the expected results.

Here is the query that gets executed (I got this by enabling the debug) MATCH (u:User)-[r:RATED]-(m:Movie)-[:HAS_MOVIE]-(g:Genre)-[:HAS_MOVIE]-(reco:Movie) where u.login="mickey" and r.stars >= 4 return reco order by reco.stars desc SKIP 0 LIMIT 21

I know a lot depends on my data, etc. But since I see different results for same query on neo4j browser vs spring-data-neo4j, my first suspicion is spring-data.

Has anyone else seen this behaviour, is there any other way I can confirm spring-data-neo4j is returning incorrect results?

thanks

Upvotes: 2

Views: 303

Answers (1)

FylmTM
FylmTM

Reputation: 1997

Your question requires a bit more clarification on what you are trying to achieve.

But, there is some things that you can check:

1) Neo4j browser has "autocomplete" function. This function automatically gets additional data to build nice-looking graph.
How to disable:

  • Run any query in your browser
  • Toggle button in bottom-right corner of results pane

After rerun your query and check what you receive as output. Also - check how tabular data looks like. Maybe there is actual duplication in tabular representation?

2) Make manual request to Cypher REST endpoint and explore JSON output. Are duplicate results presented there?

Manual request can be executed from command line using curl or httpie.

SDN uses JSON REST API, so, if there are duplications in raw JSON output - then duplication should be in SDN results also.

3) Verify your SDN4 setup. Nothing special there, just to be sure that there is no glitch in your code.

Upvotes: 1

Related Questions