| 1 |
|
| 2 |
<!DOCTYPE html> |
| 3 |
|
| 4 |
|
| 5 |
<html lang="ja" data-content_root="../" > |
| 6 |
|
| 7 |
<head> |
| 8 |
<meta charset="utf-8" /> |
| 9 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 10 |
|
| 11 |
<title>8.1. GQTP — Groonga v16.0.9ドキュメント</title> |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
<script data-cfasync="false"> |
| 16 |
document.documentElement.dataset.mode = localStorage.getItem("mode") || ""; |
| 17 |
document.documentElement.dataset.theme = localStorage.getItem("theme") || ""; |
| 18 |
</script> |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
<noscript> |
| 23 |
<style> |
| 24 |
.pst-js-only { display: none !important; } |
| 25 |
|
| 26 |
</style> |
| 27 |
</noscript> |
| 28 |
|
| 29 |
|
| 30 |
<link href="../_static/styles/theme.css?digest=90905a2f556bf617f1a9" rel="stylesheet" /> |
| 31 |
<link href="../_static/styles/pydata-sphinx-theme.css?digest=90905a2f556bf617f1a9" rel="stylesheet" /> |
| 32 |
|
| 33 |
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=8f2a1f02" /> |
| 34 |
|
| 35 |
|
| 36 |
<script defer src="../_static/scripts/fontawesome.js?digest=90905a2f556bf617f1a9"></script> |
| 37 |
|
| 38 |
<link rel="preload" as="script" href="../_static/scripts/bootstrap.js?digest=90905a2f556bf617f1a9" /> |
| 39 |
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=90905a2f556bf617f1a9" /> |
| 40 |
|
| 41 |
<script src="../_static/documentation_options.js?v=1e3c191b"></script> |
| 42 |
<script src="../_static/doctools.js?v=fd6eb6e6"></script> |
| 43 |
<script src="../_static/sphinx_highlight.js?v=6ffebe34"></script> |
| 44 |
<script src="../_static/translations.js?v=4755f45a"></script> |
| 45 |
<script> |
| 46 |
window.dataLayer = window.dataLayer || []; |
| 47 |
function gtag(){ dataLayer.push(arguments); } |
| 48 |
gtag('consent', 'default', { |
| 49 |
'ad_storage': 'denied', |
| 50 |
'ad_user_data': 'denied', |
| 51 |
'ad_personalization': 'denied', |
| 52 |
'analytics_storage': 'denied' |
| 53 |
}); |
| 54 |
</script> |
| 55 |
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-MDK38RHNPW"></script> |
| 56 |
<script> |
| 57 |
window.dataLayer = window.dataLayer || []; |
| 58 |
function gtag(){dataLayer.push(arguments);} |
| 59 |
gtag('js', new Date()); |
| 60 |
gtag('config', 'G-MDK38RHNPW'); |
| 61 |
</script> |
| 62 |
<script>DOCUMENTATION_OPTIONS.pagename = 'spec/gqtp';</script> |
| 63 |
<script> |
| 64 |
DOCUMENTATION_OPTIONS.theme_version = '0.20.0'; |
| 65 |
DOCUMENTATION_OPTIONS.theme_switcher_json_url = 'https://groonga.org/docs/_static/switcher.json'; |
| 66 |
DOCUMENTATION_OPTIONS.theme_switcher_version_match = 'japanese'; |
| 67 |
DOCUMENTATION_OPTIONS.show_version_warning_banner = |
| 68 |
false; |
| 69 |
</script> |
| 70 |
<script>DOCUMENTATION_OPTIONS.search_as_you_type = false;</script> |
| 71 |
<link rel="icon" href="../_static/favicon.ico"/> |
| 72 |
<link rel="index" title="索引" href="../genindex.html" /> |
| 73 |
<link rel="search" title="検索" href="../search.html" /> |
| 74 |
<link rel="next" title="8.2. 検索" href="search.html" /> |
| 75 |
<link rel="prev" title="8. 仕様" href="../spec.html" /> |
| 76 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 77 |
<meta name="docsearch:language" content="ja"/> |
| 78 |
<meta name="docsearch:version" content="16.0.9" /> |
| 79 |
|
| 80 |
|
| 81 |
<script src="../_static/searchtools.js"></script> |
| 82 |
<script src="../_static/language_data.js"></script> |
| 83 |
<script src="../searchindex.js"></script> |
| 84 |
|
| 85 |
</head> |
| 86 |
<body data-default-mode=""> |
| 87 |
|
| 88 |
|
| 89 |
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">本文へスキップ</a></div> |
| 90 |
|
| 91 |
|
| 92 |
<div id="pst-scroll-pixel-helper"></div> |
| 93 |
|
| 94 |
<button type="button" class="btn rounded-pill" id="pst-back-to-top"> |
| 95 |
<i class="fa-solid fa-arrow-up"></i>トップに戻る</button> |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
<dialog id="pst-search-dialog"> |
| 101 |
|
| 102 |
<form class="bd-search d-flex align-items-center" |
| 103 |
action="../search.html" |
| 104 |
method="get"> |
| 105 |
<i class="fa-solid fa-magnifying-glass"></i> |
| 106 |
<input type="search" |
| 107 |
class="form-control" |
| 108 |
name="q" |
| 109 |
placeholder="Search the docs ..." |
| 110 |
aria-label="Search the docs ..." |
| 111 |
autocomplete="off" |
| 112 |
autocorrect="off" |
| 113 |
autocapitalize="off" |
| 114 |
spellcheck="false"/> |
| 115 |
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span> |
| 116 |
</form> |
| 117 |
</dialog> |
| 118 |
|
| 119 |
<div class="pst-async-banner-revealer d-none"> |
| 120 |
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="バージョン警告"></aside> |
| 121 |
</div> |
| 122 |
|
| 123 |
|
| 124 |
<header id="pst-header" class="bd-header navbar navbar-expand-lg bd-navbar d-print-none"> |
| 125 |
<div class="bd-header__inner bd-page-width"> |
| 126 |
<button class="pst-navbar-icon sidebar-toggle primary-toggle" aria-label="サイトナビゲーション"> |
| 127 |
<span class="fa-solid fa-bars"></span> |
| 128 |
</button> |
| 129 |
|
| 130 |
|
| 131 |
<div class="col-lg-3 navbar-header-items__start"> |
| 132 |
|
| 133 |
<div class="navbar-item"> |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
<a class="navbar-brand logo" href="https://groonga.org/ja/"> |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
<img src="../_static/groonga.png" class="logo__image only-light" alt="Groonga v16.0.9ドキュメント - Home"/> |
| 151 |
<img src="../_static/groonga.png" class="logo__image only-dark pst-js-only" alt="Groonga v16.0.9ドキュメント - Home"/> |
| 152 |
|
| 153 |
|
| 154 |
</a></div> |
| 155 |
|
| 156 |
</div> |
| 157 |
|
| 158 |
<div class="col-lg-9 navbar-header-items"> |
| 159 |
|
| 160 |
|
| 161 |
<div class="navbar-header-items__end"> |
| 162 |
|
| 163 |
<div class="navbar-item navbar-persistent--container"> |
| 164 |
|
| 165 |
|
| 166 |
<button class="btn search-button-field search-button__button pst-js-only" title="検索" aria-label="検索" data-bs-placement="bottom" data-bs-toggle="tooltip"> |
| 167 |
<i class="fa-solid fa-magnifying-glass"></i> |
| 168 |
<span class="search-button__default-text">検索</span> |
| 169 |
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span> |
| 170 |
</button> |
| 171 |
</div> |
| 172 |
|
| 173 |
|
| 174 |
<div class="navbar-item"> |
| 175 |
|
| 176 |
<div class="theme-switch-container dropdown pst-js-only" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Color mode"> |
| 177 |
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button dropdown-toggle" aria-label="Color mode" data-bs-toggle="dropdown"> |
| 178 |
<i class="theme-switch fa-solid fa-sun fa-lg fa-fw" data-mode="light" title="ライト"></i> |
| 179 |
<i class="theme-switch fa-solid fa-moon fa-lg fa-fw" data-mode="dark" title="ダーク"></i> |
| 180 |
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="System Settings"></i> |
| 181 |
</button> |
| 182 |
<ul class="dropdown-menu dropdown-menu-end"> |
| 183 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1"></i>System Settings</button></li> |
| 184 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="light"><i class="fa-solid fa-sun fa-lg fa-fw me-1"></i>ライト</button></li> |
| 185 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="dark"><i class="fa-solid fa-moon fa-lg fa-fw me-1"></i>ダーク</button></li> |
| 186 |
</ul> |
| 187 |
</div></div> |
| 188 |
|
| 189 |
<div class="navbar-item"><ul class="navbar-icon-links" |
| 190 |
aria-label="Icon Links"> |
| 191 |
<li class="nav-item"> |
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
<a href="https://github.com/groonga/groonga" title="GitHub" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-github fa-lg" aria-hidden="true"></i><span class="visually-hidden">GitHub</span></a> |
| 201 |
</li> |
| 202 |
<li class="nav-item"> |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
<a href="https://twitter.com/groonga" title="Twitter" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-twitter fa-lg" aria-hidden="true"></i><span class="visually-hidden">Twitter</span></a> |
| 212 |
</li> |
| 213 |
<li class="nav-item"> |
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
<a href="/ja/blog" title="Blog" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fas fa-blog fa-lg" aria-hidden="true"></i><span class="visually-hidden">Blog</span></a> |
| 223 |
</li> |
| 224 |
</ul></div> |
| 225 |
|
| 226 |
<div class="navbar-item"> |
| 227 |
<div class="version-switcher__container dropdown pst-js-only"> |
| 228 |
<button id="pst-version-switcher-button-2" |
| 229 |
type="button" |
| 230 |
class="version-switcher__button btn btn-sm dropdown-toggle" |
| 231 |
data-bs-toggle="dropdown" |
| 232 |
aria-haspopup="listbox" |
| 233 |
aria-controls="pst-version-switcher-list-2" |
| 234 |
aria-label="Version switcher list" |
| 235 |
> |
| 236 |
Choose version |
| 237 |
<span class="caret"></span> |
| 238 |
</button> |
| 239 |
<div id="pst-version-switcher-list-2" |
| 240 |
class="version-switcher__menu dropdown-menu list-group-flush py-0" |
| 241 |
role="listbox" aria-labelledby="pst-version-switcher-button-2"> |
| 242 |
|
| 243 |
</div> |
| 244 |
</div></div> |
| 245 |
|
| 246 |
</div> |
| 247 |
|
| 248 |
</div> |
| 249 |
|
| 250 |
|
| 251 |
<div class="navbar-persistent--mobile"> |
| 252 |
|
| 253 |
<button class="btn search-button-field search-button__button pst-js-only" title="検索" aria-label="検索" data-bs-placement="bottom" data-bs-toggle="tooltip"> |
| 254 |
<i class="fa-solid fa-magnifying-glass"></i> |
| 255 |
<span class="search-button__default-text">検索</span> |
| 256 |
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span> |
| 257 |
</button> |
| 258 |
</div> |
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
<button class="pst-navbar-icon sidebar-toggle secondary-toggle" aria-label="このページでは"> |
| 263 |
<span class="fa-solid fa-outdent"></span> |
| 264 |
</button> |
| 265 |
|
| 266 |
</div> |
| 267 |
|
| 268 |
</header> |
| 269 |
|
| 270 |
|
| 271 |
<div class="bd-container"> |
| 272 |
<div class="bd-container__inner bd-page-width"> |
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
<dialog id="pst-primary-sidebar-modal"></dialog> |
| 277 |
<div id="pst-primary-sidebar" class="bd-sidebar-primary bd-sidebar"> |
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
<div class="sidebar-header-items sidebar-primary__section"> |
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
<div class="sidebar-header-items__end"> |
| 287 |
|
| 288 |
<div class="navbar-item"> |
| 289 |
|
| 290 |
<div class="theme-switch-container dropdown pst-js-only" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Color mode"> |
| 291 |
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button dropdown-toggle" aria-label="Color mode" data-bs-toggle="dropdown"> |
| 292 |
<i class="theme-switch fa-solid fa-sun fa-lg fa-fw" data-mode="light" title="ライト"></i> |
| 293 |
<i class="theme-switch fa-solid fa-moon fa-lg fa-fw" data-mode="dark" title="ダーク"></i> |
| 294 |
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="System Settings"></i> |
| 295 |
</button> |
| 296 |
<ul class="dropdown-menu dropdown-menu-end"> |
| 297 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1"></i>System Settings</button></li> |
| 298 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="light"><i class="fa-solid fa-sun fa-lg fa-fw me-1"></i>ライト</button></li> |
| 299 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="dark"><i class="fa-solid fa-moon fa-lg fa-fw me-1"></i>ダーク</button></li> |
| 300 |
</ul> |
| 301 |
</div></div> |
| 302 |
|
| 303 |
<div class="navbar-item"><ul class="navbar-icon-links" |
| 304 |
aria-label="Icon Links"> |
| 305 |
<li class="nav-item"> |
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
<a href="https://github.com/groonga/groonga" title="GitHub" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-github fa-lg" aria-hidden="true"></i><span class="visually-hidden">GitHub</span></a> |
| 315 |
</li> |
| 316 |
<li class="nav-item"> |
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
<a href="https://twitter.com/groonga" title="Twitter" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-twitter fa-lg" aria-hidden="true"></i><span class="visually-hidden">Twitter</span></a> |
| 326 |
</li> |
| 327 |
<li class="nav-item"> |
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
<a href="/ja/blog" title="Blog" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fas fa-blog fa-lg" aria-hidden="true"></i><span class="visually-hidden">Blog</span></a> |
| 337 |
</li> |
| 338 |
</ul></div> |
| 339 |
|
| 340 |
<div class="navbar-item"> |
| 341 |
<div class="version-switcher__container dropdown pst-js-only"> |
| 342 |
<button id="pst-version-switcher-button-3" |
| 343 |
type="button" |
| 344 |
class="version-switcher__button btn btn-sm dropdown-toggle" |
| 345 |
data-bs-toggle="dropdown" |
| 346 |
aria-haspopup="listbox" |
| 347 |
aria-controls="pst-version-switcher-list-3" |
| 348 |
aria-label="Version switcher list" |
| 349 |
> |
| 350 |
Choose version |
| 351 |
<span class="caret"></span> |
| 352 |
</button> |
| 353 |
<div id="pst-version-switcher-list-3" |
| 354 |
class="version-switcher__menu dropdown-menu list-group-flush py-0" |
| 355 |
role="listbox" aria-labelledby="pst-version-switcher-button-3"> |
| 356 |
|
| 357 |
</div> |
| 358 |
</div></div> |
| 359 |
|
| 360 |
</div> |
| 361 |
|
| 362 |
</div> |
| 363 |
|
| 364 |
<div class="sidebar-primary-items__start sidebar-primary__section"> |
| 365 |
<div class="sidebar-primary-item pst-sidebar-collapse"><button id="pst-collapse-sidebar-button" aria-expanded="true" aria-controls="pst-primary-sidebar"> |
| 366 |
<svg class="pst-icon" role="img" aria-hidden="true" focusable="false" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> |
| 367 |
<path fill="currentColor" d="M3 15.5C2.36232 15.5 1.74874 15.2564 1.28478 14.8189C0.820828 14.3815 0.541576 13.7832 0.504167 13.1467L0.5 13L0.5 3C0.499965 2.36232 0.743605 1.74874 1.18107 1.28478C1.61854 0.820828 2.21676 0.541576 2.85333 0.504167L3 0.5L13 0.5C13.6377 0.499965 14.2513 0.743605 14.7152 1.18107C15.1792 1.61854 15.4584 2.21676 15.4958 2.85333L15.5 3L15.5 13C15.5 13.6377 15.2564 14.2513 14.8189 14.7152C14.3815 15.1792 13.7832 15.4584 13.1467 15.4958L13 15.5L3 15.5ZM3 13.8333L10.5 13.8333L10.5 2.16667L3 2.16667C2.79589 2.16669 2.59889 2.24163 2.44636 2.37726C2.29383 2.5129 2.19638 2.69979 2.1725 2.9025L2.16667 3L2.16667 13C2.16669 13.2041 2.24163 13.4011 2.37726 13.5536C2.5129 13.7062 2.69979 13.8036 2.9025 13.8275L3 13.8333ZM6.65583 10.325L6.5775 10.2558L4.91083 8.58917C4.76735 8.44567 4.68116 8.25476 4.66843 8.05223C4.65569 7.84971 4.71729 7.6495 4.84167 7.48917L4.91083 7.41083L6.5775 5.74417C6.72747 5.59471 6.9287 5.50794 7.14032 5.50148C7.35194 5.49502 7.55809 5.56935 7.7169 5.70937C7.8757 5.8494 7.97525 6.04463 7.99533 6.25539C8.01541 6.46616 7.95451 6.67667 7.825 6.84417L7.75583 6.9225L6.67917 8L7.75583 9.0775C7.89931 9.22099 7.98551 9.41191 7.99824 9.61443C8.01097 9.81695 7.94938 10.0172 7.825 10.1775L7.75583 10.2558C7.61234 10.3993 7.42142 10.4855 7.2189 10.4982C7.01638 10.511 6.81617 10.4494 6.65583 10.325Z"/> |
| 368 |
</svg> |
| 369 |
<span class="pst-collapse-sidebar-label">Collapse Sidebar</span> |
| 370 |
<span class="pst-expand-sidebar-label">Expand Sidebar</span> |
| 371 |
</button></div> |
| 372 |
<div class="sidebar-primary-item"> |
| 373 |
|
| 374 |
<nav class="bd-docs-nav bd-links" |
| 375 |
aria-label="セクションナビゲーション"> |
| 376 |
<p class="bd-links__title" role="heading" aria-level="1">セクションナビゲーション</p> |
| 377 |
<div class="bd-toc-item navbar-nav"><ul class="current nav bd-sidenav"> |
| 378 |
<li class="toctree-l1 current active"><a class="current reference internal" href="#">8.1. GQTP</a></li> |
| 379 |
<li class="toctree-l1"><a class="reference internal" href="search.html">8.2. 検索</a></li> |
| 380 |
</ul> |
| 381 |
</div> |
| 382 |
</nav></div> |
| 383 |
</div> |
| 384 |
|
| 385 |
|
| 386 |
<div class="sidebar-primary-items__end sidebar-primary__section"> |
| 387 |
<div class="sidebar-primary-item"> |
| 388 |
<div id="ethical-ad-placement" |
| 389 |
class="flat" |
| 390 |
data-ea-publisher="readthedocs" |
| 391 |
data-ea-type="readthedocs-sidebar" |
| 392 |
data-ea-manual="true"> |
| 393 |
</div></div> |
| 394 |
</div> |
| 395 |
|
| 396 |
|
| 397 |
</div> |
| 398 |
|
| 399 |
<main id="main-content" class="bd-main" role="main"> |
| 400 |
|
| 401 |
|
| 402 |
<div class="bd-content"> |
| 403 |
<div class="bd-article-container"> |
| 404 |
|
| 405 |
<div class="bd-header-article d-print-none"> |
| 406 |
<div class="header-article-items header-article__inner"> |
| 407 |
|
| 408 |
<div class="header-article-items__start"> |
| 409 |
|
| 410 |
<div class="header-article-item"> |
| 411 |
|
| 412 |
<nav aria-label="パンくずリスト" class="d-print-none"> |
| 413 |
<ul class="bd-breadcrumbs"> |
| 414 |
|
| 415 |
<li class="breadcrumb-item breadcrumb-home"> |
| 416 |
<a href="../index.html" class="nav-link" aria-label="ホーム"> |
| 417 |
<i class="fa-solid fa-home"></i> |
| 418 |
</a> |
| 419 |
</li> |
| 420 |
|
| 421 |
<li class="breadcrumb-item"><a href="../spec.html" class="nav-link"><span class="section-number">8. </span>仕様</a></li> |
| 422 |
|
| 423 |
<li class="breadcrumb-item active" aria-current="page"><span class="ellipsis"><span class="section-number">8.1. </span>GQTP</span></li> |
| 424 |
</ul> |
| 425 |
</nav> |
| 426 |
</div> |
| 427 |
|
| 428 |
</div> |
| 429 |
|
| 430 |
|
| 431 |
</div> |
| 432 |
</div> |
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
<div id="searchbox"></div> |
| 438 |
<article class="bd-article"> |
| 439 |
|
| 440 |
<section id="gqtp"> |
| 441 |
<h1><span class="section-number">8.1. </span>GQTP<a class="headerlink" href="#gqtp" title="Link to this heading">#</a></h1> |
| 442 |
<p>GQTPはGroonga Query Transfer Protocolの頭文字です。GQTPはgroonga用の独自プロトコルです。</p> |
| 443 |
<section id="protocol"> |
| 444 |
<h2><span class="section-number">8.1.1. </span>プロトコル<a class="headerlink" href="#protocol" title="Link to this heading">#</a></h2> |
| 445 |
<p>GQTPはステートフルなクライアント・サーバーモデルのプロトコルです。以下の流れが1つの処理単位です:</p> |
| 446 |
<ul class="simple"> |
| 447 |
<li><p>クライアントがリクエストを送る</p></li> |
| 448 |
<li><p>サーバーがリクエストを受け取る</p></li> |
| 449 |
<li><p>サーバーがリクエストを処理する</p></li> |
| 450 |
<li><p>サーバーがレスポンスを返す</p></li> |
| 451 |
<li><p>クライアントがレスポンスを受け取る</p></li> |
| 452 |
</ul> |
| 453 |
<p>1つのセッション内で0個以上の処理単位を実行できます。</p> |
| 454 |
<p>リクエストもレスポンスもGQTPヘッダーとボディから成ります。GQTPヘッダーは固定長のデータです。ボディは可変長サイズのデータです。ボディのサイズはGQTPヘッダーの中に入っています。GQTPではボディの中身については何も定義しません。</p> |
| 455 |
<section id="gqtp-header"> |
| 456 |
<span id="gqtp-header-spec"></span><h3><span class="section-number">8.1.1.1. </span>GQTPヘッダー<a class="headerlink" href="#gqtp-header" title="Link to this heading">#</a></h3> |
| 457 |
<p>GQTPヘッダーは以下の符号なし整数値から成ります:</p> |
| 458 |
<div class="pst-scrollable-table-container"><table class="table"> |
| 459 |
<thead> |
| 460 |
<tr class="row-odd"><th class="head"><p>名前</p></th> |
| 461 |
<th class="head"><p>サイズ</p></th> |
| 462 |
<th class="head"><p>説明</p></th> |
| 463 |
</tr> |
| 464 |
</thead> |
| 465 |
<tbody> |
| 466 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">protocol</span></code></p></td> |
| 467 |
<td><p>1byte</p></td> |
| 468 |
<td><p>プロトコルの種類。</p></td> |
| 469 |
</tr> |
| 470 |
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">query_type</span></code></p></td> |
| 471 |
<td><p>1byte</p></td> |
| 472 |
<td><p>ボディのコンテントタイプ。</p></td> |
| 473 |
</tr> |
| 474 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">key_length</span></code></p></td> |
| 475 |
<td><p>2byte</p></td> |
| 476 |
<td><p>未使用。</p></td> |
| 477 |
</tr> |
| 478 |
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">level</span></code></p></td> |
| 479 |
<td><p>1byte</p></td> |
| 480 |
<td><p>未使用。</p></td> |
| 481 |
</tr> |
| 482 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">flags</span></code></p></td> |
| 483 |
<td><p>1byte</p></td> |
| 484 |
<td><p>フラグ。</p></td> |
| 485 |
</tr> |
| 486 |
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">status</span></code></p></td> |
| 487 |
<td><p>2byte</p></td> |
| 488 |
<td><p>リターンコード。</p></td> |
| 489 |
</tr> |
| 490 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p></td> |
| 491 |
<td><p>4byte</p></td> |
| 492 |
<td><p>ボディのサイズ。</p></td> |
| 493 |
</tr> |
| 494 |
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">opaque</span></code></p></td> |
| 495 |
<td><p>4byte</p></td> |
| 496 |
<td><p>未使用。</p></td> |
| 497 |
</tr> |
| 498 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">cas</span></code></p></td> |
| 499 |
<td><p>8byte</p></td> |
| 500 |
<td><p>未使用。</p></td> |
| 501 |
</tr> |
| 502 |
</tbody> |
| 503 |
</table> |
| 504 |
</div> |
| 505 |
<p>ヘッダーのすべての値はネットワークバイトオーダーを使っています。</p> |
| 506 |
<p>以下のセクションではそれぞれのヘッダーの値で利用可能な値について説明します。</p> |
| 507 |
<p>GQTPヘッダーは全部で24byteになります。</p> |
| 508 |
<section id="id1"> |
| 509 |
<h4><span class="section-number">8.1.1.1.1. </span><code class="docutils literal notranslate"><span class="pre">protocol</span></code><a class="headerlink" href="#id1" title="Link to this heading">#</a></h4> |
| 510 |
<p>リクエストのGQTPヘッダーでもレスポンスのGQTPヘッダーでも、この値は常に <code class="docutils literal notranslate"><span class="pre">0xc7</span></code> になります。</p> |
| 511 |
</section> |
| 512 |
<section id="query-type"> |
| 513 |
<h4><span class="section-number">8.1.1.1.2. </span><code class="docutils literal notranslate"><span class="pre">query_type</span></code><a class="headerlink" href="#query-type" title="Link to this heading">#</a></h4> |
| 514 |
<p>この値は以下のいずれかの値です:</p> |
| 515 |
<div class="pst-scrollable-table-container"><table class="table"> |
| 516 |
<thead> |
| 517 |
<tr class="row-odd"><th class="head"><p>名前</p></th> |
| 518 |
<th class="head"><p>値</p></th> |
| 519 |
<th class="head"><p>説明</p></th> |
| 520 |
</tr> |
| 521 |
</thead> |
| 522 |
<tbody> |
| 523 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">NONE</span></code></p></td> |
| 524 |
<td><p>0</p></td> |
| 525 |
<td><p>自由形式。</p></td> |
| 526 |
</tr> |
| 527 |
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">TSV</span></code></p></td> |
| 528 |
<td><p>1</p></td> |
| 529 |
<td><p>値をタブで区切った形式。</p></td> |
| 530 |
</tr> |
| 531 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">JSON</span></code></p></td> |
| 532 |
<td><p>2</p></td> |
| 533 |
<td><p>JSON。</p></td> |
| 534 |
</tr> |
| 535 |
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">XML</span></code></p></td> |
| 536 |
<td><p>3</p></td> |
| 537 |
<td><p>XML。</p></td> |
| 538 |
</tr> |
| 539 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">MSGPACK</span></code></p></td> |
| 540 |
<td><p>4</p></td> |
| 541 |
<td><p>MessagePack。</p></td> |
| 542 |
</tr> |
| 543 |
</tbody> |
| 544 |
</table> |
| 545 |
</div> |
| 546 |
<p>リクエストGQTPヘッダーでは使われません。</p> |
| 547 |
<p>レスポンスGQTPヘッダーで使われます。ボディは指定した形式にします。</p> |
| 548 |
</section> |
| 549 |
<section id="flags"> |
| 550 |
<h4><span class="section-number">8.1.1.1.3. </span><code class="docutils literal notranslate"><span class="pre">flags</span></code><a class="headerlink" href="#flags" title="Link to this heading">#</a></h4> |
| 551 |
<p>この値は以下の値をビット単位ORしたものになります:</p> |
| 552 |
<div class="pst-scrollable-table-container"><table class="table"> |
| 553 |
<thead> |
| 554 |
<tr class="row-odd"><th class="head"><p>名前</p></th> |
| 555 |
<th class="head"><p>値</p></th> |
| 556 |
<th class="head"><p>説明</p></th> |
| 557 |
</tr> |
| 558 |
</thead> |
| 559 |
<tbody> |
| 560 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">MORE</span></code></p></td> |
| 561 |
<td><p>0x01</p></td> |
| 562 |
<td><p>まだデータがあります。</p></td> |
| 563 |
</tr> |
| 564 |
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">TAIL</span></code></p></td> |
| 565 |
<td><p>0x02</p></td> |
| 566 |
<td><p>これ以上データはありません。</p></td> |
| 567 |
</tr> |
| 568 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">HEAD</span></code></p></td> |
| 569 |
<td><p>0x04</p></td> |
| 570 |
<td><p>未使用。</p></td> |
| 571 |
</tr> |
| 572 |
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">QUIET</span></code></p></td> |
| 573 |
<td><p>0x08</p></td> |
| 574 |
<td><p>レスポンスを出力しません。</p></td> |
| 575 |
</tr> |
| 576 |
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">QUIT</span></code></p></td> |
| 577 |
<td><p>0x10</p></td> |
| 578 |
<td><p>終了します。</p></td> |
| 579 |
</tr> |
| 580 |
</tbody> |
| 581 |
</table> |
| 582 |
</div> |
| 583 |
<p><code class="docutils literal notranslate"><span class="pre">MORE</span></code> あるいは <code class="docutils literal notranslate"><span class="pre">TAIL</span></code> フラグは必ず指定しないといけません。</p> |
| 584 |
<p><code class="docutils literal notranslate"><span class="pre">MORE</span></code> フラグを使うときは <code class="docutils literal notranslate"><span class="pre">QUIET</span></code> フラグも使うべきです。リクエストが途中のときはレスポンスを出力する必要がないからです。</p> |
| 585 |
<p>セッションを終了するときは <code class="docutils literal notranslate"><span class="pre">QUIT</span></code> フラグを使ってください。</p> |
| 586 |
</section> |
| 587 |
<section id="status"> |
| 588 |
<h4><span class="section-number">8.1.1.1.4. </span><code class="docutils literal notranslate"><span class="pre">status</span></code><a class="headerlink" href="#status" title="Link to this heading">#</a></h4> |
| 589 |
<p>利用可能な値です。将来的に新しいステータスが追加される可能性があります。</p> |
| 590 |
<ul class="simple"> |
| 591 |
<li><p>0: <code class="docutils literal notranslate"><span class="pre">SUCCESS</span></code></p></li> |
| 592 |
<li><p>1: <code class="docutils literal notranslate"><span class="pre">END_OF_DATA</span></code></p></li> |
| 593 |
<li><p>65535: <code class="docutils literal notranslate"><span class="pre">UNKNOWN_ERROR</span></code></p></li> |
| 594 |
<li><p>65534: <code class="docutils literal notranslate"><span class="pre">OPERATION_NOT_PERMITTED</span></code></p></li> |
| 595 |
<li><p>65533: <code class="docutils literal notranslate"><span class="pre">NO_SUCH_FILE_OR_DIRECTORY</span></code></p></li> |
| 596 |
<li><p>65532: <code class="docutils literal notranslate"><span class="pre">NO_SUCH_PROCESS</span></code></p></li> |
| 597 |
<li><p>65531: <code class="docutils literal notranslate"><span class="pre">INTERRUPTED_FUNCTION_CALL</span></code></p></li> |
| 598 |
<li><p>65530: <code class="docutils literal notranslate"><span class="pre">INPUT_OUTPUT_ERROR</span></code></p></li> |
| 599 |
<li><p>65529: <code class="docutils literal notranslate"><span class="pre">NO_SUCH_DEVICE_OR_ADDRESS</span></code></p></li> |
| 600 |
<li><p>65528: <code class="docutils literal notranslate"><span class="pre">ARG_LIST_TOO_LONG</span></code></p></li> |
| 601 |
<li><p>65527: <code class="docutils literal notranslate"><span class="pre">EXEC_FORMAT_ERROR</span></code></p></li> |
| 602 |
<li><p>65526: <code class="docutils literal notranslate"><span class="pre">BAD_FILE_DESCRIPTOR</span></code></p></li> |
| 603 |
<li><p>65525: <code class="docutils literal notranslate"><span class="pre">NO_CHILD_PROCESSES</span></code></p></li> |
| 604 |
<li><p>65524: <code class="docutils literal notranslate"><span class="pre">RESOURCE_TEMPORARILY_UNAVAILABLE</span></code></p></li> |
| 605 |
<li><p>65523: <code class="docutils literal notranslate"><span class="pre">NOT_ENOUGH_SPACE</span></code></p></li> |
| 606 |
<li><p>65522: <code class="docutils literal notranslate"><span class="pre">PERMISSION_DENIED</span></code></p></li> |
| 607 |
<li><p>65521: <code class="docutils literal notranslate"><span class="pre">BAD_ADDRESS</span></code></p></li> |
| 608 |
<li><p>65520: <code class="docutils literal notranslate"><span class="pre">RESOURCE_BUSY</span></code></p></li> |
| 609 |
<li><p>65519: <code class="docutils literal notranslate"><span class="pre">FILE_EXISTS</span></code></p></li> |
| 610 |
<li><p>65518: <code class="docutils literal notranslate"><span class="pre">IMPROPER_LINK</span></code></p></li> |
| 611 |
<li><p>65517: <code class="docutils literal notranslate"><span class="pre">NO_SUCH_DEVICE</span></code></p></li> |
| 612 |
<li><p>65516: <code class="docutils literal notranslate"><span class="pre">NOT_A_DIRECTORY</span></code></p></li> |
| 613 |
<li><p>65515: <code class="docutils literal notranslate"><span class="pre">IS_A_DIRECTORY</span></code></p></li> |
| 614 |
<li><p>65514: <code class="docutils literal notranslate"><span class="pre">INVALID_ARGUMENT</span></code></p></li> |
| 615 |
<li><p>65513: <code class="docutils literal notranslate"><span class="pre">TOO_MANY_OPEN_FILES_IN_SYSTEM</span></code></p></li> |
| 616 |
<li><p>65512: <code class="docutils literal notranslate"><span class="pre">TOO_MANY_OPEN_FILES</span></code></p></li> |
| 617 |
<li><p>65511: <code class="docutils literal notranslate"><span class="pre">INAPPROPRIATE_I_O_CONTROL_OPERATION</span></code></p></li> |
| 618 |
<li><p>65510: <code class="docutils literal notranslate"><span class="pre">FILE_TOO_LARGE</span></code></p></li> |
| 619 |
<li><p>65509: <code class="docutils literal notranslate"><span class="pre">NO_SPACE_LEFT_ON_DEVICE</span></code></p></li> |
| 620 |
<li><p>65508: <code class="docutils literal notranslate"><span class="pre">INVALID_SEEK</span></code></p></li> |
| 621 |
<li><p>65507: <code class="docutils literal notranslate"><span class="pre">READ_ONLY_FILE_SYSTEM</span></code></p></li> |
| 622 |
<li><p>65506: <code class="docutils literal notranslate"><span class="pre">TOO_MANY_LINKS</span></code></p></li> |
| 623 |
<li><p>65505: <code class="docutils literal notranslate"><span class="pre">BROKEN_PIPE</span></code></p></li> |
| 624 |
<li><p>65504: <code class="docutils literal notranslate"><span class="pre">DOMAIN_ERROR</span></code></p></li> |
| 625 |
<li><p>65503: <code class="docutils literal notranslate"><span class="pre">RESULT_TOO_LARGE</span></code></p></li> |
| 626 |
<li><p>65502: <code class="docutils literal notranslate"><span class="pre">RESOURCE_DEADLOCK_AVOIDED</span></code></p></li> |
| 627 |
<li><p>65501: <code class="docutils literal notranslate"><span class="pre">NO_MEMORY_AVAILABLE</span></code></p></li> |
| 628 |
<li><p>65500: <code class="docutils literal notranslate"><span class="pre">FILENAME_TOO_LONG</span></code></p></li> |
| 629 |
<li><p>65499: <code class="docutils literal notranslate"><span class="pre">NO_LOCKS_AVAILABLE</span></code></p></li> |
| 630 |
<li><p>65498: <code class="docutils literal notranslate"><span class="pre">FUNCTION_NOT_IMPLEMENTED</span></code></p></li> |
| 631 |
<li><p>65497: <code class="docutils literal notranslate"><span class="pre">DIRECTORY_NOT_EMPTY</span></code></p></li> |
| 632 |
<li><p>65496: <code class="docutils literal notranslate"><span class="pre">ILLEGAL_BYTE_SEQUENCE</span></code></p></li> |
| 633 |
<li><p>65495: <code class="docutils literal notranslate"><span class="pre">SOCKET_NOT_INITIALIZED</span></code></p></li> |
| 634 |
<li><p>65494: <code class="docutils literal notranslate"><span class="pre">OPERATION_WOULD_BLOCK</span></code></p></li> |
| 635 |
<li><p>65493: <code class="docutils literal notranslate"><span class="pre">ADDRESS_IS_NOT_AVAILABLE</span></code></p></li> |
| 636 |
<li><p>65492: <code class="docutils literal notranslate"><span class="pre">NETWORK_IS_DOWN</span></code></p></li> |
| 637 |
<li><p>65491: <code class="docutils literal notranslate"><span class="pre">NO_BUFFER</span></code></p></li> |
| 638 |
<li><p>65490: <code class="docutils literal notranslate"><span class="pre">SOCKET_IS_ALREADY_CONNECTED</span></code></p></li> |
| 639 |
<li><p>65489: <code class="docutils literal notranslate"><span class="pre">SOCKET_IS_NOT_CONNECTED</span></code></p></li> |
| 640 |
<li><p>65488: <code class="docutils literal notranslate"><span class="pre">SOCKET_IS_ALREADY_SHUTDOWNED</span></code></p></li> |
| 641 |
<li><p>65487: <code class="docutils literal notranslate"><span class="pre">OPERATION_TIMEOUT</span></code></p></li> |
| 642 |
<li><p>65486: <code class="docutils literal notranslate"><span class="pre">CONNECTION_REFUSED</span></code></p></li> |
| 643 |
<li><p>65485: <code class="docutils literal notranslate"><span class="pre">RANGE_ERROR</span></code></p></li> |
| 644 |
<li><p>65484: <code class="docutils literal notranslate"><span class="pre">TOKENIZER_ERROR</span></code></p></li> |
| 645 |
<li><p>65483: <code class="docutils literal notranslate"><span class="pre">FILE_CORRUPT</span></code></p></li> |
| 646 |
<li><p>65482: <code class="docutils literal notranslate"><span class="pre">INVALID_FORMAT</span></code></p></li> |
| 647 |
<li><p>65481: <code class="docutils literal notranslate"><span class="pre">OBJECT_CORRUPT</span></code></p></li> |
| 648 |
<li><p>65480: <code class="docutils literal notranslate"><span class="pre">TOO_MANY_SYMBOLIC_LINKS</span></code></p></li> |
| 649 |
<li><p>65479: <code class="docutils literal notranslate"><span class="pre">NOT_SOCKET</span></code></p></li> |
| 650 |
<li><p>65478: <code class="docutils literal notranslate"><span class="pre">OPERATION_NOT_SUPPORTED</span></code></p></li> |
| 651 |
<li><p>65477: <code class="docutils literal notranslate"><span class="pre">ADDRESS_IS_IN_USE</span></code></p></li> |
| 652 |
<li><p>65476: <code class="docutils literal notranslate"><span class="pre">ZLIB_ERROR</span></code></p></li> |
| 653 |
<li><p>65475: <code class="docutils literal notranslate"><span class="pre">LZO_ERROR</span></code></p></li> |
| 654 |
<li><p>65474: <code class="docutils literal notranslate"><span class="pre">STACK_OVER_FLOW</span></code></p></li> |
| 655 |
<li><p>65473: <code class="docutils literal notranslate"><span class="pre">SYNTAX_ERROR</span></code></p></li> |
| 656 |
<li><p>65472: <code class="docutils literal notranslate"><span class="pre">RETRY_MAX</span></code></p></li> |
| 657 |
<li><p>65471: <code class="docutils literal notranslate"><span class="pre">INCOMPATIBLE_FILE_FORMAT</span></code></p></li> |
| 658 |
<li><p>65470: <code class="docutils literal notranslate"><span class="pre">UPDATE_NOT_ALLOWED</span></code></p></li> |
| 659 |
<li><p>65469: <code class="docutils literal notranslate"><span class="pre">TOO_SMALL_OFFSET</span></code></p></li> |
| 660 |
<li><p>65468: <code class="docutils literal notranslate"><span class="pre">TOO_LARGE_OFFSET</span></code></p></li> |
| 661 |
<li><p>65467: <code class="docutils literal notranslate"><span class="pre">TOO_SMALL_LIMIT</span></code></p></li> |
| 662 |
<li><p>65466: <code class="docutils literal notranslate"><span class="pre">CAS_ERROR</span></code></p></li> |
| 663 |
<li><p>65465: <code class="docutils literal notranslate"><span class="pre">UNSUPPORTED_COMMAND_VERSION</span></code></p></li> |
| 664 |
</ul> |
| 665 |
</section> |
| 666 |
<section id="size"> |
| 667 |
<h4><span class="section-number">8.1.1.1.5. </span><code class="docutils literal notranslate"><span class="pre">size</span></code><a class="headerlink" href="#size" title="Link to this heading">#</a></h4> |
| 668 |
<p>ボディのサイズです。ボディの最大サイズは4GiBです。これは <code class="docutils literal notranslate"><span class="pre">size</span></code> が4byteの符号なし整数だからです。4GiB以上のサイズのデータを送りたい場合は <code class="docutils literal notranslate"><span class="pre">MORE</span></code> フラグを使ってください。</p> |
| 669 |
</section> |
| 670 |
</section> |
| 671 |
</section> |
| 672 |
<section id="example"> |
| 673 |
<h2><span class="section-number">8.1.2. </span>例<a class="headerlink" href="#example" title="Link to this heading">#</a></h2> |
| 674 |
<section id="how-to-run-a-gqtp-server"> |
| 675 |
<h3><span class="section-number">8.1.2.1. </span>GQTPサーバの起動<a class="headerlink" href="#how-to-run-a-gqtp-server" title="Link to this heading">#</a></h3> |
| 676 |
<p>Groongaには、専用のプロトコルであるGQTPが存在します。GQTPを用いることにより、データベースへとリモートアクセスすることができます。以下の書式はGQTPサーバの起動方法を示しています。</p> |
| 677 |
<p>Form:</p> |
| 678 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">groonga</span> <span class="p">[</span><span class="o">-</span><span class="n">p</span> <span class="n">PORT_NUMBER</span><span class="p">]</span> <span class="o">-</span><span class="n">s</span> <span class="n">DB_PATH</span> |
| 679 |
</pre></div> |
| 680 |
</div> |
| 681 |
<p><cite>-s</cite> オプションはGroongaをサーバとして起動するためのオプションです。DB_PATHには既存のデータベースのパスを指定します。 <cite>-p</cite> オプションとその引数により、サーバのポート番号を指定することができます。ポート番号を省略した場合は10043が使用されます。</p> |
| 682 |
<p>以下のコマンドにより、デフォルトのポート番号で待ち受けるサーバを起動することができます。サーバは指定されたデータベースへの操作を受け付けます。</p> |
| 683 |
<p>実行例:</p> |
| 684 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">groonga</span> <span class="o">-</span><span class="n">s</span> <span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">groonga</span><span class="o">-</span><span class="n">databases</span><span class="o">/</span><span class="n">introduction</span><span class="o">.</span><span class="n">db</span> |
| 685 |
<span class="n">Ctrl</span><span class="o">-</span><span class="n">c</span> |
| 686 |
<span class="o">%</span> |
| 687 |
</pre></div> |
| 688 |
</div> |
| 689 |
</section> |
| 690 |
<section id="how-to-run-a-gqtp-daemon"> |
| 691 |
<h3><span class="section-number">8.1.2.2. </span>GQTPデーモンの起動<a class="headerlink" href="#how-to-run-a-gqtp-daemon" title="Link to this heading">#</a></h3> |
| 692 |
<p>GQTPサーバはデーモンとして起動することができます。オプションとして、 <cite>-s</cite> の代わりに <cite>-d</cite> を与えてください。</p> |
| 693 |
<p>Form:</p> |
| 694 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">groonga</span> <span class="p">[</span><span class="o">-</span><span class="n">p</span> <span class="n">PORT_NUMBER</span><span class="p">]</span> <span class="o">-</span><span class="n">d</span> <span class="n">DB_PATH</span> |
| 695 |
</pre></div> |
| 696 |
</div> |
| 697 |
<p>Groongaをデーモンとして起動したときは、デーモンのプロセスIDが表示されます。以下の例では、12345というプロセスIDが表示されています。サーバとして起動した場合と同様に、指定されたデータベースへの操作を受け付けます。</p> |
| 698 |
<p>実行例:</p> |
| 699 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">groonga</span> <span class="o">-</span><span class="n">d</span> <span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">groonga</span><span class="o">-</span><span class="n">databases</span><span class="o">/</span><span class="n">introduction</span><span class="o">.</span><span class="n">db</span> |
| 700 |
<span class="mi">12345</span> |
| 701 |
<span class="o">%</span> |
| 702 |
</pre></div> |
| 703 |
</div> |
| 704 |
</section> |
| 705 |
<section id="how-to-run-a-gqtp-client"> |
| 706 |
<h3><span class="section-number">8.1.2.3. </span>GQTPサーバへの接続<a class="headerlink" href="#how-to-run-a-gqtp-client" title="Link to this heading">#</a></h3> |
| 707 |
<p>GQTPサーバに接続するクライアントは、以下のように起動します。</p> |
| 708 |
<p>Form:</p> |
| 709 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">groonga</span> <span class="p">[</span><span class="o">-</span><span class="n">p</span> <span class="n">PORT_NUMBER</span><span class="p">]</span> <span class="o">-</span><span class="n">c</span> <span class="p">[</span><span class="n">HOST_NAME_OR_IP_ADDRESS</span><span class="p">]</span> |
| 710 |
</pre></div> |
| 711 |
</div> |
| 712 |
<p>上記のコマンドによって起動されたクライアントは、サーバとの接続に成功すると対話モードに入ります。HOST_NAME_OR_IP_ADDRESSにはサーバのホスト名もしくはIPアドレスを指定します。HOST_NAME_OR_IP_ADDRESSが省略されたときは"localhost"をサーバのホスト名として採用します。また、 <cite>-p</cite> オプションとその引数により、サーバのポート番号を指定することができます。ポート番号を省略した場合は10043が使用されます。</p> |
| 713 |
<p>実行例:</p> |
| 714 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ groonga -c |
| 715 |
status |
| 716 |
# [ |
| 717 |
# [ |
| 718 |
# 0, |
| 719 |
# 1337566253.89858, |
| 720 |
# 0.000355720520019531 |
| 721 |
# ], |
| 722 |
# { |
| 723 |
# "alloc_count": 29, |
| 724 |
# "starttime": 1696558618, |
| 725 |
# "start_time": 1696558618, |
| 726 |
# "uptime": 0, |
| 727 |
# "version": "2.9.1", |
| 728 |
# "n_queries": 0, |
| 729 |
# "cache_hit_rate": 0.0, |
| 730 |
# "command_version": 1, |
| 731 |
# "default_command_version": 1, |
| 732 |
# "max_command_version": 3, |
| 733 |
# "n_jobs": 0, |
| 734 |
# "features": { |
| 735 |
# "nfkc": true, |
| 736 |
# "mecab": true, |
| 737 |
# "message_pack": true, |
| 738 |
# "mruby": true, |
| 739 |
# "onigmo": true, |
| 740 |
# "zlib": true, |
| 741 |
# "lz4": true, |
| 742 |
# "zstandard": true, |
| 743 |
# "kqueue": false, |
| 744 |
# "epoll": true, |
| 745 |
# "poll": false, |
| 746 |
# "rapidjson": false, |
| 747 |
# "apache_arrow": true, |
| 748 |
# "xxhash": true, |
| 749 |
# "blosc": true, |
| 750 |
# "bfloat16": true, |
| 751 |
# "h3": true, |
| 752 |
# "simdjson": true, |
| 753 |
# "llama.cpp": true, |
| 754 |
# "back_trace": true, |
| 755 |
# "reference_count": false |
| 756 |
# }, |
| 757 |
# "apache_arrow": { |
| 758 |
# "version_major": 2, |
| 759 |
# "version_minor": 9, |
| 760 |
# "version_patch": 1, |
| 761 |
# "version": "2.9.1" |
| 762 |
# }, |
| 763 |
# "memory_map_size": 2929, |
| 764 |
# "n_workers": 0, |
| 765 |
# "default_n_workers": 0, |
| 766 |
# "os": "Linux", |
| 767 |
# "cpu": "x86_64" |
| 768 |
# } |
| 769 |
# ] |
| 770 |
> ctrl-d |
| 771 |
$ |
| 772 |
</pre></div> |
| 773 |
</div> |
| 774 |
<p>対話モードでは、標準入力からコマンドを読み込んで順次実行します。</p> |
| 775 |
</section> |
| 776 |
<section id="how-to-terminate-a-gqtp-server"> |
| 777 |
<h3><span class="section-number">8.1.2.4. </span>GQTPサーバの終了<a class="headerlink" href="#how-to-terminate-a-gqtp-server" title="Link to this heading">#</a></h3> |
| 778 |
<p><a class="reference internal" href="../reference/commands/shutdown.html"><span class="doc">shutdown</span></a> でGQTPサーバーを終了できます。</p> |
| 779 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ groonga -c |
| 780 |
> shutdown |
| 781 |
$ |
| 782 |
</pre></div> |
| 783 |
</div> |
| 784 |
</section> |
| 785 |
</section> |
| 786 |
<section id="see-also"> |
| 787 |
<h2><span class="section-number">8.1.3. </span>参照<a class="headerlink" href="#see-also" title="Link to this heading">#</a></h2> |
| 788 |
<ul class="simple"> |
| 789 |
<li><p><a class="reference internal" href="../reference/executables/groonga.html"><span class="doc">groonga 実行ファイル</span></a></p></li> |
| 790 |
<li><p><a class="reference internal" href="../server/gqtp.html"><span class="doc">GQTP</span></a></p></li> |
| 791 |
</ul> |
| 792 |
</section> |
| 793 |
</section> |
| 794 |
|
| 795 |
|
| 796 |
</article> |
| 797 |
|
| 798 |
|
| 799 |
|
| 800 |
|
| 801 |
|
| 802 |
<footer class="prev-next-footer d-print-none"> |
| 803 |
|
| 804 |
<div class="prev-next-area"> |
| 805 |
<a class="left-prev" |
| 806 |
href="../spec.html" |
| 807 |
title="前のページ"> |
| 808 |
<i class="fa-solid fa-angle-left"></i> |
| 809 |
<div class="prev-next-info"> |
| 810 |
<p class="prev-next-subtitle">前へ</p> |
| 811 |
<p class="prev-next-title"><span class="section-number">8. </span>仕様</p> |
| 812 |
</div> |
| 813 |
</a> |
| 814 |
<a class="right-next" |
| 815 |
href="search.html" |
| 816 |
title="次ページ"> |
| 817 |
<div class="prev-next-info"> |
| 818 |
<p class="prev-next-subtitle">次へ</p> |
| 819 |
<p class="prev-next-title"><span class="section-number">8.2. </span>検索</p> |
| 820 |
</div> |
| 821 |
<i class="fa-solid fa-angle-right"></i> |
| 822 |
</a> |
| 823 |
</div> |
| 824 |
</footer> |
| 825 |
|
| 826 |
</div> |
| 827 |
|
| 828 |
|
| 829 |
|
| 830 |
<dialog id="pst-secondary-sidebar-modal"></dialog> |
| 831 |
<div id="pst-secondary-sidebar" class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner"> |
| 832 |
|
| 833 |
|
| 834 |
<div class="sidebar-secondary-item"> |
| 835 |
<div |
| 836 |
id="pst-page-navigation-heading-2" |
| 837 |
class="page-toc tocsection onthispage"> |
| 838 |
<i class="fa-solid fa-list"></i> このページでは |
| 839 |
</div> |
| 840 |
<nav id="pst-page-toc-nav" class="page-toc" aria-labelledby="pst-page-navigation-heading-2"> |
| 841 |
<ul class="pst-show_toc_level nav section-nav flex-column"> |
| 842 |
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#protocol">8.1.1. プロトコル</a><ul class="nav section-nav flex-column"> |
| 843 |
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#gqtp-header">8.1.1.1. GQTPヘッダー</a><ul class="nav section-nav flex-column"> |
| 844 |
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id1">8.1.1.1.1. <code class="docutils literal notranslate"><span class="pre">protocol</span></code></a></li> |
| 845 |
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#query-type">8.1.1.1.2. <code class="docutils literal notranslate"><span class="pre">query_type</span></code></a></li> |
| 846 |
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#flags">8.1.1.1.3. <code class="docutils literal notranslate"><span class="pre">flags</span></code></a></li> |
| 847 |
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#status">8.1.1.1.4. <code class="docutils literal notranslate"><span class="pre">status</span></code></a></li> |
| 848 |
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#size">8.1.1.1.5. <code class="docutils literal notranslate"><span class="pre">size</span></code></a></li> |
| 849 |
</ul> |
| 850 |
</li> |
| 851 |
</ul> |
| 852 |
</li> |
| 853 |
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#example">8.1.2. 例</a><ul class="nav section-nav flex-column"> |
| 854 |
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#how-to-run-a-gqtp-server">8.1.2.1. GQTPサーバの起動</a></li> |
| 855 |
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#how-to-run-a-gqtp-daemon">8.1.2.2. GQTPデーモンの起動</a></li> |
| 856 |
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#how-to-run-a-gqtp-client">8.1.2.3. GQTPサーバへの接続</a></li> |
| 857 |
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#how-to-terminate-a-gqtp-server">8.1.2.4. GQTPサーバの終了</a></li> |
| 858 |
</ul> |
| 859 |
</li> |
| 860 |
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#see-also">8.1.3. 参照</a></li> |
| 861 |
</ul> |
| 862 |
</nav></div> |
| 863 |
|
| 864 |
</div></div> |
| 865 |
|
| 866 |
|
| 867 |
</div> |
| 868 |
<footer class="bd-footer-content"> |
| 869 |
|
| 870 |
</footer> |
| 871 |
|
| 872 |
</main> |
| 873 |
</div> |
| 874 |
</div> |
| 875 |
|
| 876 |
|
| 877 |
<script defer src="../_static/scripts/bootstrap.js?digest=90905a2f556bf617f1a9"></script> |
| 878 |
<script defer src="../_static/scripts/pydata-sphinx-theme.js?digest=90905a2f556bf617f1a9"></script> |
| 879 |
|
| 880 |
<footer class="bd-footer"> |
| 881 |
<div class="bd-footer__inner bd-page-width"> |
| 882 |
|
| 883 |
<div class="footer-items__start"> |
| 884 |
|
| 885 |
<div class="footer-item"> |
| 886 |
|
| 887 |
<p class="copyright"> |
| 888 |
|
| 889 |
© Copyright 2009-2026 Groonga Project. |
| 890 |
<br/> |
| 891 |
|
| 892 |
</p> |
| 893 |
</div> |
| 894 |
|
| 895 |
</div> |
| 896 |
|
| 897 |
|
| 898 |
|
| 899 |
<div class="footer-items__end"> |
| 900 |
|
| 901 |
<div class="footer-item"> |
| 902 |
<p class="theme-version"> |
| 903 |
|
| 904 |
<a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> 0.20.0 で構築されています。 |
| 905 |
</p></div> |
| 906 |
|
| 907 |
</div> |
| 908 |
|
| 909 |
</div> |
| 910 |
|
| 911 |
</footer> |
| 912 |
</body> |
| 913 |
</html> |