-
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.
[CONFSERVER-61268] Allow for exact text string matches using the REST API CQL search endpoint
Support reference count | New: 3 |
UIS | Original: 1 | New: 0 |
UIS | Original: 0 | New: 1 |
UIS | Original: 1 | New: 0 |
Workflow | Original: JAC Suggestion Workflow 4 [ 4065631 ] | New: JAC Suggestion Workflow 3 [ 4339899 ] |
UIS | New: 1 |
Description |
Original:
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|https://developer.atlassian.com/server/confluence/cql-field-reference/#text]:
{noformat:title=Example: This will find any page with those words in any order} GET /rest/api/content/search?cql=text~"example exact search string" GET /rest/api/search?cql=text~"example exact search string"{noformat} * Example page: !Screenshot 2021-02-17 at 15.10.58-1.png|thumbnail! * From the UI you can perform a literal search by enclosing your search term in quotes: !Screenshot 2021-02-22 at 14.28.55.png|thumbnail! !Screenshot 2021-02-22 at 14.43.13.png|thumbnail! h2. Workaround {panel} (!) 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/{panel} You can perform a literal 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: {noformat} <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) {noformat} As in the example screenshot with the text +This exact sentence+. {noformat:title=Seaching "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\")",{noformat} {noformat:title=Zero match when search term is not exact and does NOT work in the UI} also "results": [], "start": 0, "limit": 25, "size": 0, "totalSize": 0, "cqlQuery": "siteSearch ~ "\"this sentence exact\"" and type in ("space","user","page","blogpost","comment")", {noformat} So it is _currently_ possible to still replicate the UI results but there is no native way without a workaround. |
New:
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|https://developer.atlassian.com/server/confluence/cql-field-reference/#text]:
{noformat:title=Example: This will find any page with those words in any order} GET /rest/api/content/search?cql=text~"example exact search string" GET /rest/api/search?cql=text~"example exact search string"{noformat} * Example page: !Screenshot 2021-02-17 at 15.10.58-1.png|thumbnail! * From the UI you can perform a exact search by enclosing your search term in quotes: !Screenshot 2021-02-22 at 14.28.55.png|thumbnail! !Screenshot 2021-02-22 at 14.43.13.png|thumbnail! h2. Workaround {panel} (!) 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/{panel} 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: {noformat} <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) {noformat} As in the example screenshot with the text +This exact sentence+. {noformat:title=Seaching "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\")",{noformat} {noformat:title=Zero match when search term is not exact and does NOT work in the UI} also "results": [], "start": 0, "limit": 25, "size": 0, "totalSize": 0, "cqlQuery": "siteSearch ~ "\"this sentence exact\"" and type in ("space","user","page","blogpost","comment")", {noformat} So it is _currently_ possible to still replicate the UI results but there is no native way without a workaround. |
Summary | Original: Allow for literal text-string matches using the REST API CQL search endpoint | New: Allow for exact text string matches using the REST API CQL search endpoint |
Description |
Original:
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|https://developer.atlassian.com/server/confluence/cql-field-reference/#text]:
{noformat:title=Example: This will find any page with those words in any order} GET /rest/api/content/search?cql=text~"example exact search string" GET /rest/api/search?cql=text~"example exact search string"{noformat} * Example page: !Screenshot 2021-02-17 at 15.10.58-1.png|thumbnail! * From the UI you can perform a literal search by enclosing your search term in quotes: !Screenshot 2021-02-22 at 14.28.55.png!|thumbnail! !Screenshot 2021-02-22 at 14.43.13.png|thumbnail! h2. Workaround {panel} (!) 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/{panel} You can perform a literal 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: {noformat} <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) {noformat} As in the example screenshot with the text +This exact sentence+. {noformat:title=Seaching "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\")",{noformat} {noformat:title=Zero match when search term is not exact and does NOT work in the UI} also "results": [], "start": 0, "limit": 25, "size": 0, "totalSize": 0, "cqlQuery": "siteSearch ~ "\"this sentence exact\"" and type in ("space","user","page","blogpost","comment")", {noformat} So it is _currently_ possible to still replicate the UI results but there is no native way without a workaround. |
New:
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|https://developer.atlassian.com/server/confluence/cql-field-reference/#text]:
{noformat:title=Example: This will find any page with those words in any order} GET /rest/api/content/search?cql=text~"example exact search string" GET /rest/api/search?cql=text~"example exact search string"{noformat} * Example page: !Screenshot 2021-02-17 at 15.10.58-1.png|thumbnail! * From the UI you can perform a literal search by enclosing your search term in quotes: !Screenshot 2021-02-22 at 14.28.55.png|thumbnail! !Screenshot 2021-02-22 at 14.43.13.png|thumbnail! h2. Workaround {panel} (!) 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/{panel} You can perform a literal 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: {noformat} <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) {noformat} As in the example screenshot with the text +This exact sentence+. {noformat:title=Seaching "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\")",{noformat} {noformat:title=Zero match when search term is not exact and does NOT work in the UI} also "results": [], "start": 0, "limit": 25, "size": 0, "totalSize": 0, "cqlQuery": "siteSearch ~ "\"this sentence exact\"" and type in ("space","user","page","blogpost","comment")", {noformat} So it is _currently_ possible to still replicate the UI results but there is no native way without a workaround. |
Description |
Original:
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|https://developer.atlassian.com/server/confluence/cql-field-reference/#text]:
{noformat:title=Example: This will find any page with those words in any order} GET /rest/api/content/search?cql=text~"example exact search string" GET /rest/api/search?cql=text~"example exact search string"{noformat} * Example page: !Screenshot 2021-02-17 at 15.10.58-1.png!|thumbnail! * From the UI you can perform a literal search by enclosing your search term in quotes: !Screenshot 2021-02-22 at 14.28.55.png!|thumbnail! !Screenshot 2021-02-22 at 14.43.13.png|thumbnail! h2. Workaround {panel} (!) 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/{panel} You can perform a literal 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: {noformat} <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) {noformat} As in the example screenshot with the text +This exact sentence+. {noformat:title=Seaching "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\")",{noformat} {noformat:title=Zero match when search term is not exact and does NOT work in the UI} also "results": [], "start": 0, "limit": 25, "size": 0, "totalSize": 0, "cqlQuery": "siteSearch ~ "\"this sentence exact\"" and type in ("space","user","page","blogpost","comment")", {noformat} So it is _currently_ possible to still replicate the UI results but there is no native way without a workaround. |
New:
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|https://developer.atlassian.com/server/confluence/cql-field-reference/#text]:
{noformat:title=Example: This will find any page with those words in any order} GET /rest/api/content/search?cql=text~"example exact search string" GET /rest/api/search?cql=text~"example exact search string"{noformat} * Example page: !Screenshot 2021-02-17 at 15.10.58-1.png|thumbnail! * From the UI you can perform a literal search by enclosing your search term in quotes: !Screenshot 2021-02-22 at 14.28.55.png!|thumbnail! !Screenshot 2021-02-22 at 14.43.13.png|thumbnail! h2. Workaround {panel} (!) 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/{panel} You can perform a literal 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: {noformat} <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) {noformat} As in the example screenshot with the text +This exact sentence+. {noformat:title=Seaching "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\")",{noformat} {noformat:title=Zero match when search term is not exact and does NOT work in the UI} also "results": [], "start": 0, "limit": 25, "size": 0, "totalSize": 0, "cqlQuery": "siteSearch ~ "\"this sentence exact\"" and type in ("space","user","page","blogpost","comment")", {noformat} So it is _currently_ possible to still replicate the UI results but there is no native way without a workaround. |