-
Type:
Bug
-
Resolution: Answered
-
Priority:
Low
-
None
-
Affects Version/s: 6.9.3
-
Component/s: Search - Core
-
None
-
1
-
Severity 2 - Major
-
1
Summary
Searching for a Space with name that has numbers at the beginning will throw an error in CQL.
Environment
Confluence 6.9.3
Steps to Reproduce
- Create spaces with names: 1TES, 1, TEST, T1E, TE1
- In terminal execute command to retrive CQL results:
curl -u admin:admin http://localhost:6693/c693/rest/api/content/search?cql=space=1TES | python -m json.tool
Expected Results
Result will be retrived, like in this case where name is TEST
curl -u admin:admin http://localhost:6693/c693/rest/api/content/search?cql=space=TEST | python -m json.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 616 0 616 0 0 13424 0 --:--:-- --:--:-- --:--:-- 13688 { "_links": { "base": "http://localhost:6693/c693", "context": "/c693", "self": "http://localhost:6693/c693/rest/api/content/search?cql=space=TEST" }, "limit": 25, "results": [ { "_expandable": { "ancestors": "", "body": "", "children": "", "container": "", "descendants": "", "extensions": "", "history": "/rest/api/content/327704/history", "metadata": "", "operations": "", "space": "/rest/api/space/TEST", "version": "" }, "_links": { "self": "http://localhost:6693/c693/rest/api/content/327704", "tinyui": "/x/GAAF", "webui": "/display/TEST/test+Home" }, "id": "327704", "restrictions": {}, "status": "current", "title": "test Home", "type": "page" } ], "size": 1, "start": 0 }
Actual Results
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 183 0 183 0 0 4478 0 --:--:-- --:--:-- --:--:-- 4575
{
"data": {
"allowedInReadOnlyMode": true,
"authorized": false,
"errors": [],
"successful": false,
"valid": true
},
"message": "Unrecognised clause at : TES",
"reason": "Bad Request",
"statusCode": 400
}
Notes
Other combinations work (1, T1E, TEST, TE1)
Resolution
Put quotes around the space key for CQL to consider it a string. e.g. instead of space=1TES, use space="1TES"