-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
0
-
3
-
Using our API search endpoints does not allow for exact/literal string matches on text fields. The CQL text search only allows the ~ & !~ contains/does not contain operators as indicated in our CQL Field Reference for text:
GET /rest/api/content/search?cql=text~"example exact search string" GET /rest/api/search?cql=text~"example exact search string"
Please note this is using an internal API that is not directly supported and may be subject to change. For our public REST API please refer to: https://docs.atlassian.com/ConfluenceServer/rest/7.11.0/
You can perform a exact search in the Confluence UI Advanced search as per normal and grab the internal API used for the search from the browser developer tools, for example:
<baseURL>/rest/searchv3/1.0/cqlSearch?cql=siteSearch+~+%22%5C%22<SEARCH>+<TERMS>+<HERE>%5C%22%22+and+type+in+(%22space%22%2C%22user%22%2C%22page%22%2C%22blogpost%22%2C%22comment%22)
As in the example screenshot with the text This exact sentence.
# I Removed the start and end of the command above just to make it easier to read what needs updating. ...siteSearch+~+%22%5C%22this+exact+sentence%5C%22%22... "start": 0, "limit": 25, "size": 1, "totalSize": 1, "cqlQuery": "siteSearch ~ \"\\\"this exact sentence\\\"\" and type in (\"space\",\"user\",\"page\",\"blogpost\",\"comment\")",
also "results": [], "start": 0, "limit": 25, "size": 0, "totalSize": 0, "cqlQuery": "siteSearch ~ "\"this sentence exact\"" and type in ("space","user","page","blogpost","comment")",
So it is currently possible to still replicate the UI results but there is no native way without a workaround.