Closed bunkat closed 9 years ago
It works for me:
:POST /db/data/transaction/commit {"statements":[{"statement":"planner rule match n return n limit 1"}]}
:POST /db/data/transaction/commit {"statements":[{"statement":"planner rule match n return n limit 1"}]}
{
"results": [
{
"columns": [
"n"
],
"data": [
{
"row": [
{
"fileName": "/Users/mh/java/software/jqassistant/distribution/target/distribution/plugins"
}
]
}
]
}
],
"errors": []
}
Otherwise can you try to use CYPHER 2.2 PLANNER RULE ....
Neither PLANNER RULE nor CYPHER 2.2 PLANNER RULE are working for me. I posted my raw query at https://gist.github.com/bunkat/d7b4fb691d6f609989c5. I double checked and am hitting the correct URL with the correct POST operation. Is there a setting somewhere I might need to change?
And the correct Neo4j version I presume? (2.2+)
I thought it was related to your prepended \n
but even that works for me:
:POST /db/data/transaction/commit {"statements":[{"statement":"\n planner rule match n return n limit 1"}]}
even with curl
curl -H accept:application/json -H content-type:application/json -d'{"statements":[{"statement":"\n planner rule match n return n limit 1"}]}' http://localhost:7474/db/data/transaction/commit
{"results":[{"columns":["n"],"data":[{"row":[{"fileName":"/Users/mh/java/software/jqassistant/distribution/target/distribution/plugins"}]}]}],"errors":[]}
Yep, I'm running 2.2.0 currently. Is this something that was fixed in 2.2.1?
Your curl statement fails for me:
curl -H accept:application/json -H content-type:application/json -d'{"statements":[{"statement":"\n planner rule match n return n limit 1"}]}' http://localhost:7474/db/data/transaction/commit
{"results":[],"errors":[{"code":"Neo.ClientError.Statement.InvalidSyntax","message":"Invalid input 'p': expected
(line 1, column 1 (offset: 0))\n\"planner rule match n return n limit 1\"\n ^"}]}
Oh yes, sorry I am running 2.2.1
Confirmed that this is resolved in 2.2.1.
Due to issues with the COST planner, I tried to force the RULE planner for queries that are executed as part of a transaction (as my application normally does vs testing in the web interface).
In the web interface, this works as expected:
But when attempted within a transaction that hits the HTTP Cypher query transaction endpoint, I get this instead:
Based on a comment in another issue, I have to do this instead which seems to force the query planner to use the RULE planner.