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