Hi guys,
Wanted to run this issue that I am facing by you. I have the following java instruction:
cluster.query(
"SELECT RAW META().id FROM bucket123 WHERE stateId = $stateId AND docType = $docType ",
QueryOptions.queryOptions().parameters(
JsonObject.create().put("docType", "notes").put("stateId", "ddbacbc1-a950-4d38-afc8-3a2eb58db89b")
)
).get();
which when its executed ends up in failure:
com.couchbase.client.core.error.PlanningFailureException: The server failed planning the query {"completed":true,"coreId":"0x9b378d9e00000001","errors":[{"code":4000,"message":"No index available on keyspace bucket123 that matches your query. Use CREATE INDEX or CREATE PRIMARY INDEX to create an index, or check that your expected index is online.","retry":false}],"httpStatus":404,"idempotent":false,"lastDispatchedFrom":"10.77.25.54:55635","lastDispatchedTo":"host","requestId":9766,"requestType":"QueryRequest","retried":0,"service":{"operationId":"ddbacbc1-a950-4d38-afc8-3a2eb58db89b","statement":"SELECT RAW META().id FROM bucket123 WHERE stateId = $stateId AND docType = $docType ","type":"query"},"timeoutMs":60000,"timings":{"dispatchMicros":107332,"totalDispatchMicros":107332,"totalMicros":1244477}}
meanwhile if I run this the query executes with no errors:
cluster.query(
"SELECT RAW META().id FROM bucket123 WHERE stateId = \"ddbacbc1-a950-4d38-afc8-3a2eb58db89b\" AND docType = \"notes\""
).get();
So this clearly indicates that the index is fine, as I can also run the query with all the parameters substituted in the couchbase UI.
Not sure what I am doing wrong with this one, this should technically work with no issues.
I am running the java SDK 3.2.6
and the couchbase server is on Enterprise Edition 6.6.2 build 9588
Any help would be greatly appreciated.