아틀라시안 컴플루언스 rest Api 페이지 검색
2018.07.31 16:59
[A] Advanced Search with Confluence CQL Error [closed]
I am looking for a order function in confluence CQL.
I want to order by TYPE (page, comment, etc) How is it possible?
I tried this, but it doenst work: https://myconfluence.site/rest/api/content/search?cql=text~%22apos%22&type=page&expand=body.storage&filter=order+by+asc
Thanks for your help!
[A]
It seems you mixed things up a bit :)
This query works for me and orders by id
/rest/api/content/search?cql=type=page+and+text~"apos"+order+by+id+asc&expand=body.storage
Lets see the problems one by one:
- filter=order+by+asc This does not work, as it is part of the cql syntax
- order+by+asc You have to tell which field should be ordered by (e.g. id or type)
- text~%22apos%22&type=page Do not separate with "&", as it is interpreted as 2 query params and not as single cql command. You have to write the key-word "and" to combine several terms.
I hope this solves your issue. Ordering by type would not have any affect in your example as you only search for pages.
Find further information here:
[출처] https://stackoverflow.com/questions/36154567/advanced-search-with-confluence-cql-error
http://...confluence.com../rest/api/content/search?cql=type=page+and+text~"인공지능"+order+by+id+asc&expand=body.storage,history,space
|
final RestTemplate restTemplate = new RestTemplate(); String url = "https://www.confluence.com/rest/api/content/search?cql=type=page+and+text~\" + keyword + "\"+order+by+id+asc&expand=body.storage,history,space"; String response = restTemplate.getForObject(url, String.class); // jsonp 다른 도메인 호출 예? byte[] bytes = response.getBytes("8859_1"); // 한글 깨짐 방지 String results = new String(bytes, "UTF-8"); // 한글 깨짐 방지 return results; |
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.