| Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Gerrit Code Review - /Documentation/ REST API |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 2 | |
| 3 | This page describes the documentation search related REST endpoints. |
| 4 | Please also take note of the general information on the |
| 5 | link:rest-api.html[REST API]. |
| 6 | |
| 7 | Please note that this feature is only usable with documentation built-in. |
| 8 | You'll need to |
| David Ostrovsky | fdbfcad | 2016-11-15 06:35:29 -0800 | [diff] [blame] | 9 | `bazel build withdocs` |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 10 | or |
| David Ostrovsky | fdbfcad | 2016-11-15 06:35:29 -0800 | [diff] [blame] | 11 | `bazel build release` |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 12 | to test this feature. |
| 13 | |
| 14 | [[documentation-endpoints]] |
| Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 15 | == Documentation Search Endpoints |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 16 | |
| 17 | [[search-documentation]] |
| Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 18 | === Search Documentation |
| Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 19 | -- |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 20 | 'GET /Documentation/' |
| Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 21 | -- |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 22 | |
| 23 | With `q` parameter, search our documentation index for the terms. |
| 24 | |
| 25 | A list of link:#doc-result[DocResult] entities is returned describing the |
| 26 | results. |
| 27 | |
| 28 | .Request |
| 29 | ---- |
| 30 | GET /Documentation/?q=test HTTP/1.0 |
| 31 | ---- |
| 32 | |
| 33 | .Response |
| 34 | ---- |
| 35 | HTTP/1.1 200 OK |
| 36 | Content-Disposition: attachment |
| 37 | Content-Type: application/json; charset=UTF-8 |
| 38 | |
| 39 | )]}' |
| 40 | [ |
| 41 | { |
| 42 | "title": "Gerrit Code Review - REST API Developers\u0027 Notes", |
| 43 | "url": "Documentation/dev-rest-api.html" |
| 44 | }, |
| 45 | { |
| 46 | "title": "Gerrit Code Review - REST API", |
| 47 | "url": "Documentation/rest-api.html" |
| 48 | }, |
| 49 | { |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 50 | "title": "Gerrit Code Review - /plugins/ REST API", |
| 51 | "url": "Documentation/rest-api-plugins.html" |
| 52 | }, |
| 53 | { |
| 54 | "title": "Gerrit Code Review - /config/ REST API", |
| 55 | "url": "Documentation/rest-api-config.html" |
| 56 | }, |
| 57 | { |
| 58 | "title": "Gerrit Code Review for Git", |
| 59 | "url": "Documentation/index.html" |
| 60 | }, |
| 61 | { |
| 62 | "title": "Gerrit Code Review - /access/ REST API", |
| 63 | "url": "Documentation/rest-api-access.html" |
| 64 | }, |
| 65 | { |
| Ben Rohlfs | da0a62b | 2021-04-26 17:02:19 +0200 | [diff] [blame] | 66 | "title": "Gerrit Code Review - Java Plugin Development", |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 67 | "url": "Documentation/dev-plugins.html" |
| 68 | }, |
| 69 | { |
| Ben Rohlfs | da0a62b | 2021-04-26 17:02:19 +0200 | [diff] [blame] | 70 | "title": "Gerrit Code Review - JavaScript Plugin Development and API", |
| 71 | "url": "Documentation/pg-plugin-dev.html" |
| 72 | }, |
| 73 | { |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 74 | "title": "Gerrit Code Review - Developer Setup", |
| 75 | "url": "Documentation/dev-readme.html" |
| 76 | }, |
| 77 | { |
| 78 | "title": "Gerrit Code Review - Hooks", |
| 79 | "url": "Documentation/config-hooks.html" |
| 80 | }, |
| 81 | { |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 82 | "title": "Gerrit Code Review - /groups/ REST API", |
| 83 | "url": "Documentation/rest-api-groups.html" |
| 84 | }, |
| 85 | { |
| 86 | "title": "Gerrit Code Review - /accounts/ REST API", |
| 87 | "url": "Documentation/rest-api-accounts.html" |
| 88 | }, |
| 89 | { |
| 90 | "title": "Gerrit Code Review - /projects/ REST API", |
| 91 | "url": "Documentation/rest-api-documentation.html" |
| 92 | }, |
| 93 | { |
| 94 | "title": "Gerrit Code Review - /projects/ REST API", |
| 95 | "url": "Documentation/rest-api-projects.html" |
| 96 | }, |
| 97 | { |
| 98 | "title": "Gerrit Code Review - Prolog Submit Rules Cookbook", |
| 99 | "url": "Documentation/prolog-cookbook.html" |
| 100 | }, |
| 101 | { |
| 102 | "title": "Gerrit Code Review - /changes/ REST API", |
| 103 | "url": "Documentation/rest-api-changes.html" |
| 104 | }, |
| 105 | { |
| 106 | "title": "Gerrit Code Review - Configuration", |
| 107 | "url": "Documentation/config-gerrit.html" |
| 108 | }, |
| 109 | { |
| 110 | "title": "Gerrit Code Review - Access Controls", |
| 111 | "url": "Documentation/access-control.html" |
| 112 | }, |
| 113 | { |
| 114 | "title": "Gerrit Code Review - Licenses", |
| 115 | "url": "Documentation/licenses.html" |
| 116 | } |
| 117 | ] |
| 118 | ---- |
| 119 | |
| 120 | .Query documentation |
| 121 | **** |
| 122 | get::/Documentation/?q=keyword |
| 123 | **** |
| 124 | |
| 125 | |
| 126 | [[json-entities]] |
| Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 127 | == JSON Entities |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 128 | |
| 129 | [[doc-result]] |
| Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 130 | === DocResult |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 131 | The `DocResult` entity contains information about a document. |
| 132 | |
| David Pursehouse | ae36719 | 2014-11-25 17:24:47 +0900 | [diff] [blame] | 133 | [options="header",cols="1,^2,4"] |
| Yuxuan 'fishy' Wang | ec4b06a | 2013-10-14 12:39:30 -0700 | [diff] [blame] | 134 | |========================= |
| 135 | |Field Name ||Description |
| 136 | |`title` ||The title of the document. |
| 137 | |`url` ||The URL of the document. |
| 138 | |========================= |
| 139 | |
| 140 | |
| 141 | GERRIT |
| 142 | ------ |
| 143 | Part of link:index.html[Gerrit Code Review] |
| Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 144 | |
| 145 | SEARCHBOX |
| 146 | --------- |