File: groonga.html

package info (click to toggle)
groonga 11.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 121,576 kB
  • sloc: ansic: 801,209; javascript: 62,121; ruby: 46,206; cpp: 33,790; xml: 24,951; yacc: 13,333; sh: 7,776; python: 3,266; makefile: 2,315; perl: 133
file content (673 lines) | stat: -rw-r--r-- 46,077 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673


<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>7.1.3. groonga executable file &#8212; Groonga v10.1.1-31-g1e46ba6 documentation</title>
    <link rel="stylesheet" href="../../_static/groonga.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    
    <script id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../_static/language_data.js"></script>
    
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="7.1.4. groonga-benchmark" href="groonga-benchmark.html" />
    <link rel="prev" title="7.1.2. grnslap" href="grnslap.html" /> 
  </head><body>
<div class="header">
  <h1 class="title">
    <a id="top-link" href="../../index.html">
      <span class="project">groonga</span>
      <span class="separator">-</span>
      <span class="description">An open-source fulltext search engine and column store.</span>
    </a>
  </h1>

  <div class="other-language-links">
    <ul>
      <li><a href="../../../../ja/html/reference/executables/groonga.html">日本語</a></li>
    </ul>
  </div>
</div>
  

    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="groonga-benchmark.html" title="7.1.4. groonga-benchmark"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="grnslap.html" title="7.1.2. grnslap"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">Groonga v10.1.1-31-g1e46ba6 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../reference.html" ><span class="section-number">7. </span>Reference manual</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../executables.html" accesskey="U"><span class="section-number">7.1. </span>Executables</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href=""><span class="section-number">7.1.3. </span><code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="groonga-executable-file">
<h1><span class="section-number">7.1.3. </span><code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file<a class="headerlink" href="#groonga-executable-file" title="Permalink to this headline">¶</a></h1>
<div class="section" id="summary">
<h2><span class="section-number">7.1.3.1. </span>Summary<a class="headerlink" href="#summary" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file provides the following features:</p>
<blockquote>
<div><ul class="simple">
<li><p>Fulltext search server</p></li>
<li><p>Fulltext search shell</p></li>
<li><p>Client for Groonga fulltext search server</p></li>
</ul>
</div></blockquote>
<p>Groonga can be used as a library. If you want to use Groonga as a
library, you need to write a program in C, C++ and so on. Library use
is useful for embedding fulltext search feature to your application,
but it’s not easy to use.</p>
<p>You can use <code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file to get fulltext search
feature.</p>
<p>If you want to try Groonga, fulltext search shell usage is useful. You
don’t need any server and client. You just need one terminal. You can
try Groonga like the following:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>% groonga -n db
&gt; status
[[0,1429687763.70845,0.000115633010864258],{&quot;alloc_count&quot;:195,...}]
&gt; quit
%
</pre></div>
</div>
<p>If you want to create an application that has fulltext search feature,
fulltext search server usage is useful. You can use Groonga as a
server like RDBMS (Relational DataBase Management
System). Client-server model is a popular architecture.</p>
<p>Normally, client for Groonga fulltext server usage isn’t used.</p>
</div>
<div class="section" id="syntax">
<h2><span class="section-number">7.1.3.2. </span>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file has the following four modes:</p>
<blockquote>
<div><ul class="simple">
<li><p>Standalone mode</p></li>
<li><p>Server mode</p></li>
<li><p>Daemon mode</p></li>
<li><p>Client mode</p></li>
</ul>
</div></blockquote>
<p>There are common options in these modes. These common options are
described later section.</p>
<div class="section" id="standalone-mode">
<span id="groonga-executable-file-standalone-mode"></span><h3><span class="section-number">7.1.3.2.1. </span>Standalone mode<a class="headerlink" href="#standalone-mode" title="Permalink to this headline">¶</a></h3>
<p>In standalone mode, <code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file runs one or more
Groonga <a class="reference internal" href="../command.html"><span class="doc">Command</span></a> against a local Groonga database.</p>
<p>Here is the syntax to run shell that executes Groonga command against
temporary database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options]
</pre></div>
</div>
<p>Here is the syntax to create a new database and run shell that
executes Groonga command against the new database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] -n DB_PATH
</pre></div>
</div>
<p>Here is the syntax to run shell that executes Groonga command against
existing database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] DB_PATH
</pre></div>
</div>
<p>Here is the syntax to run Groonga command against existing database
and exit:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] DB_PATH COMMAND [command arguments]
</pre></div>
</div>
</div>
<div class="section" id="server-mode">
<span id="groonga-executable-file-server-mode"></span><h3><span class="section-number">7.1.3.2.2. </span>Server mode<a class="headerlink" href="#server-mode" title="Permalink to this headline">¶</a></h3>
<p>In server mode, <code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file runs as a server. The
server accepts connections from other processes at local machine or
remote machine and executes received Groonga <a class="reference internal" href="../command.html"><span class="doc">Command</span></a>
against a local Groonga database.</p>
<p>You can choose one protocol from <a class="reference internal" href="../../server/http.html"><span class="doc">HTTP</span></a> and
<a class="reference internal" href="../../server/gqtp.html"><span class="doc">GQTP</span></a>. Normally, HTTP is suitable but GQTP is the
default protocol. This section describes only about HTTP protocol
usage.</p>
<p>In server mode, <code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file runs in the foreground. If
you want to run Groonga server in the background, see
<a class="reference internal" href="#groonga-executable-file-daemon-mode"><span class="std std-ref">Daemon mode</span></a>.</p>
<p>Here is the syntax to run Groonga server with temporary database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] --protocol http -s
</pre></div>
</div>
<p>Here is the syntax to create a new database and run Groonga server
with the new database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] --protocol http -s -n DB_PATH
</pre></div>
</div>
<p>Here is the syntax to run Groonga server with existing database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] --protocol http -s DB_PATH
</pre></div>
</div>
</div>
<div class="section" id="daemon-mode">
<span id="groonga-executable-file-daemon-mode"></span><h3><span class="section-number">7.1.3.2.3. </span>Daemon mode<a class="headerlink" href="#daemon-mode" title="Permalink to this headline">¶</a></h3>
<p>In daemon mode, <code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file runs as a daemon. Daemon
is similar to server but it runs in the background. See
<a class="reference internal" href="#groonga-executable-file-server-mode"><span class="std std-ref">Server mode</span></a> about server.</p>
<p>Here is the syntax to run Groonga daemon with temporary database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] --protocol http -d
</pre></div>
</div>
<p>Here is the syntax to create a new database and run Groonga daemon
with the new database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] --protocol http -d -n DB_PATH
</pre></div>
</div>
<p>Here is the syntax to run Groonga daemon with existing database:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] --protocol http -d DB_PATH
</pre></div>
</div>
<p><a class="reference internal" href="#cmdoption-groonga-pid-path"><code class="xref std std-option docutils literal notranslate"><span class="pre">--pid-path</span></code></a> option will be useful for daemon mode.</p>
</div>
<div class="section" id="client-mode">
<span id="groonga-executable-file-client-mode"></span><h3><span class="section-number">7.1.3.2.4. </span>Client mode<a class="headerlink" href="#client-mode" title="Permalink to this headline">¶</a></h3>
<p>In client mode, <code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file runs as a client for GQTP
protocol Groonga server. Its usage is similar to
<a class="reference internal" href="#groonga-executable-file-standalone-mode"><span class="std std-ref">Standalone mode</span></a>. You can run shell and
execute one command. You need to specify server address instead of
local database.</p>
<p>Note that you can’t use <code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file as a client for
Groonga server that uses HTTP.</p>
<p>Here is the syntax to run shell that executes Groonga command against
Groonga server that is running at <code class="docutils literal notranslate"><span class="pre">192.168.0.1:10043</span></code>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] -c --port 10043 192.168.0.1
</pre></div>
</div>
<p>Here is the syntax to run Groonga command against Groonga server that
is running at <code class="docutils literal notranslate"><span class="pre">192.168.0.1:10043</span></code> and exit:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>groonga [options] -c --port 10043 192.168.0.1 COMMAND [command arguments]
</pre></div>
</div>
</div>
</div>
<div class="section" id="options">
<h2><span class="section-number">7.1.3.3. </span>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
<dl class="std option">
<dt id="cmdoption-groonga-n">
<code class="sig-name descname">-n</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-groonga-n" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates new database.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-c">
<code class="sig-name descname">-c</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-groonga-c" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes <code class="docutils literal notranslate"><span class="pre">groonga</span></code> command in client mode.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-s">
<code class="sig-name descname">-s</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-groonga-s" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes <code class="docutils literal notranslate"><span class="pre">groonga</span></code> command in server mode. Use “Ctrl+C” to stop the <code class="docutils literal notranslate"><span class="pre">groonga</span></code> process.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-d">
<code class="sig-name descname">-d</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-groonga-d" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes <code class="docutils literal notranslate"><span class="pre">groonga</span></code> command in daemon mode. In contrast to server mode, <code class="docutils literal notranslate"><span class="pre">groonga</span></code> command forks in daemon mode. For example, to stop local daemon process, use “curl <a class="reference external" href="http://127.0.0.1:10041/d/shutdown">http://127.0.0.1:10041/d/shutdown</a>”.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-e">
<span id="cmdoption-groonga-encoding"></span><code class="sig-name descname">-e</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--encoding</code><code class="sig-prename descclassname"> &lt;encoding&gt;</code><a class="headerlink" href="#cmdoption-groonga-e" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies encoding which is used for Groonga database. This option is effective when you create new Groonga database.  This parameter specifies one of the following values: <code class="docutils literal notranslate"><span class="pre">none</span></code>, <code class="docutils literal notranslate"><span class="pre">euc</span></code>, <code class="docutils literal notranslate"><span class="pre">utf8</span></code>, <code class="docutils literal notranslate"><span class="pre">sjis</span></code>, <code class="docutils literal notranslate"><span class="pre">latin</span></code> or <code class="docutils literal notranslate"><span class="pre">koi8r</span></code>.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-l">
<span id="cmdoption-groonga-log-level"></span><code class="sig-name descname">-l</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--log-level</code><code class="sig-prename descclassname"> &lt;log level&gt;</code><a class="headerlink" href="#cmdoption-groonga-l" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies log level. Log level must be a log level name or an
integer value. Here are available log levels:</p>
</dd></dl>

<table class="docutils align-default">
<colgroup>
<col style="width: 33%" />
<col style="width: 33%" />
<col style="width: 33%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Log level</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Integer value</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>None</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">none</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Emergency</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">E</span></code>, <code class="docutils literal notranslate"><span class="pre">emerge</span></code> or <code class="docutils literal notranslate"><span class="pre">emergency</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p></td>
</tr>
<tr class="row-even"><td><p>Alert</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">A</span></code> or <code class="docutils literal notranslate"><span class="pre">alert</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">2</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Critical</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">C</span></code>, <code class="docutils literal notranslate"><span class="pre">crit</span></code> or <code class="docutils literal notranslate"><span class="pre">critical</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">3</span></code></p></td>
</tr>
<tr class="row-even"><td><p>Error</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">e</span></code> or <code class="docutils literal notranslate"><span class="pre">error</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">4</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Warning</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">w</span></code>, <code class="docutils literal notranslate"><span class="pre">warn</span></code> or <code class="docutils literal notranslate"><span class="pre">warning</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p></td>
</tr>
<tr class="row-even"><td><p>Notice</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">n</span></code> or <code class="docutils literal notranslate"><span class="pre">notice</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">6</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Information</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">i</span></code> or <code class="docutils literal notranslate"><span class="pre">info</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">7</span></code></p></td>
</tr>
<tr class="row-even"><td><p>Debug</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">d</span></code> or <code class="docutils literal notranslate"><span class="pre">debug</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">8</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Dump</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">-</span></code> or <code class="docutils literal notranslate"><span class="pre">dump</span></code></p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">9</span></code></p></td>
</tr>
</tbody>
</table>
<dl class="std option">
<dt id="cmdoption-groonga-a">
<span id="cmdoption-groonga-address"></span><code class="sig-name descname">-a</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--address</code><code class="sig-prename descclassname"> &lt;ip/hostname&gt;</code><a class="headerlink" href="#cmdoption-groonga-a" title="Permalink to this definition">¶</a></dt>
<dd><div class="deprecated">
<p><span class="versionmodified deprecated">Deprecated since version 1.2.2: </span>Use <a class="reference internal" href="#cmdoption-groonga-bind-address"><code class="xref std std-option docutils literal notranslate"><span class="pre">--bind-address</span></code></a> instead.</p>
</div>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-bind-address">
<code class="sig-name descname">--bind-address</code><code class="sig-prename descclassname"> &lt;ip/hostname&gt;</code><a class="headerlink" href="#cmdoption-groonga-bind-address" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 1.2.2.</span></p>
</div>
<p>サーバモードかデーモンモードで実行するとき、listenするアドレスを指定します。(デフォルトは <cite>hostname</cite> の返すホスト名)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-p">
<span id="cmdoption-groonga-port"></span><code class="sig-name descname">-p</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--port</code><code class="sig-prename descclassname"> &lt;port number&gt;</code><a class="headerlink" href="#cmdoption-groonga-p" title="Permalink to this definition">¶</a></dt>
<dd><p>クライアント、サーバ、またはデーモンモードで使用するTCPポート番号。
(クライアントモードのデフォルトは10043番、サーバ、またはデーモンモードのデフォルトは、HTTPの場合、10041番、GQTPの場合、10043番)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-i">
<span id="cmdoption-groonga-server-id"></span><code class="sig-name descname">-i</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--server-id</code><code class="sig-prename descclassname"> &lt;ip/hostname&gt;</code><a class="headerlink" href="#cmdoption-groonga-i" title="Permalink to this definition">¶</a></dt>
<dd><p>サーバモードかデーモンモードで実行するとき、サーバのIDとなるアドレスを指定します。(デフォルトは`hostname`の返すホスト名)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-h">
<span id="cmdoption-groonga-help"></span><code class="sig-name descname">-h</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--help</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-groonga-h" title="Permalink to this definition">¶</a></dt>
<dd><p>ヘルプメッセージを出力します。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-document-root">
<code class="sig-name descname">--document-root</code><code class="sig-prename descclassname"> &lt;path&gt;</code><a class="headerlink" href="#cmdoption-groonga-document-root" title="Permalink to this definition">¶</a></dt>
<dd><p>httpサーバとしてgroongaを使用する場合に静的ページを格納するディレクトリを指定します。</p>
<p>デフォルトでは、データベースを管理するための汎用的なページに対応するファイルが/usr/share/groonga/admin_html以下にインストールされます。このディレクトリをdocument-rootオプションの値に指定して起動した場合、ウェブブラウザでhttp://hostname:port/index.htmlにアクセスすると、ウェブベースのデータベース管理ツールを使用できます。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-protocol">
<code class="sig-name descname">--protocol</code><code class="sig-prename descclassname"> &lt;protocol&gt;</code><a class="headerlink" href="#cmdoption-groonga-protocol" title="Permalink to this definition">¶</a></dt>
<dd><p>http,gqtpのいずれかを指定します。(デフォルトはgqtp)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-log-path">
<code class="sig-name descname">--log-path</code><code class="sig-prename descclassname"> &lt;path&gt;</code><a class="headerlink" href="#cmdoption-groonga-log-path" title="Permalink to this definition">¶</a></dt>
<dd><p>ログを出力するファイルのパスを指定します。(デフォルトは/var/log/groonga/groonga.logです)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-log-flags">
<code class="sig-name descname">--log-flags</code><code class="sig-prename descclassname"> &lt;log flags&gt;</code><a class="headerlink" href="#cmdoption-groonga-log-flags" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 8.1.1.</span></p>
</div>
<p>Specify log flags. Default value is <code class="docutils literal notranslate"><span class="pre">time|message</span></code>.</p>
<p><code class="docutils literal notranslate"><span class="pre">+</span></code> prefix means that <code class="docutils literal notranslate"><span class="pre">add</span> <span class="pre">the</span> <span class="pre">flag</span></code>.</p>
<p><code class="docutils literal notranslate"><span class="pre">-</span></code> prefix means that <code class="docutils literal notranslate"><span class="pre">remove</span> <span class="pre">the</span> <span class="pre">flag</span></code>.</p>
<p>No prefix means that <code class="docutils literal notranslate"><span class="pre">replace</span> <span class="pre">existing</span> <span class="pre">flags</span></code>.</p>
<p>Multiple log flags can be specified by separating flags with <code class="docutils literal notranslate"><span class="pre">|</span></code>.</p>
<p>We can specify flags below.</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">none</span></code></dt><dd><p>Output nothing into the log.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">time</span></code></dt><dd><p>Output timestamp into the log.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">message</span></code></dt><dd><p>Output log message into the log.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">location</span></code></dt><dd><p>Output process id and a location of an output of the log (file name, line and function name) into the log.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">process_id</span></code></dt><dd><p>Output process id into the log.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">pid</span></code></dt><dd><p>This flag is an alias of <code class="docutils literal notranslate"><span class="pre">process_id</span></code>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">thread_id</span></code></dt><dd><p>Output thread id into log</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">all</span></code></dt><dd><p>This flag specifies all flags except <code class="docutils literal notranslate"><span class="pre">none</span></code> and <code class="docutils literal notranslate"><span class="pre">default</span></code> flags.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">default</span></code></dt><dd><p>Output timestamp and log message into the log.</p>
</dd>
</dl>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-log-rotate-threshold-size">
<code class="sig-name descname">--log-rotate-threshold-size</code><code class="sig-prename descclassname"> &lt;threshold&gt;</code><a class="headerlink" href="#cmdoption-groonga-log-rotate-threshold-size" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 5.0.3.</span></p>
</div>
<p>Specifies threshold for log rotation. Log file is rotated when log file size is larger than or equals to the threshold (default: 0; disabled).</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-query-log-path">
<code class="sig-name descname">--query-log-path</code><code class="sig-prename descclassname"> &lt;path&gt;</code><a class="headerlink" href="#cmdoption-groonga-query-log-path" title="Permalink to this definition">¶</a></dt>
<dd><p>クエリーログを出力するファイルのパスを指定します。(デフォルトでは出力されません)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-query-log-rotate-threshold-size">
<code class="sig-name descname">--query-log-rotate-threshold-size</code><code class="sig-prename descclassname"> &lt;threshold&gt;</code><a class="headerlink" href="#cmdoption-groonga-query-log-rotate-threshold-size" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 5.0.3.</span></p>
</div>
<p>Specifies threshold for query log rotation. Query log file is rotated when query log file size is larger than or equals to the threshold (default: 0; disabled).</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-t">
<span id="cmdoption-groonga-max-threads"></span><code class="sig-name descname">-t</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--max-threads</code><code class="sig-prename descclassname"> &lt;max threasd&gt;</code><a class="headerlink" href="#cmdoption-groonga-t" title="Permalink to this definition">¶</a></dt>
<dd><p>最大で利用するスレッド数を指定します。(デフォルトはマシンのCPUコア数と同じ数です)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-pid-path">
<code class="sig-name descname">--pid-path</code><code class="sig-prename descclassname"> &lt;path&gt;</code><a class="headerlink" href="#cmdoption-groonga-pid-path" title="Permalink to this definition">¶</a></dt>
<dd><p>PIDを保存するパスを指定します。(デフォルトでは保存しません)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-config-path">
<code class="sig-name descname">--config-path</code><code class="sig-prename descclassname"> &lt;path&gt;</code><a class="headerlink" href="#cmdoption-groonga-config-path" title="Permalink to this definition">¶</a></dt>
<dd><p>設定ファイルのパスを指定します。設定ファイルは以下のようなフォーマットになります。:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span># &#39;#&#39;以降はコメント。
; &#39;;&#39;以降もコメント。

# &#39;キー = 値&#39;でオプションを指定。
pid-path = /var/run/groonga.pid

# &#39;=&#39;の前後の空白はは無視される。↓は↑と同じ意味。
pid-path=/var/run/groonga.pid

# &#39;キー&#39;は&#39;--XXX&#39;スタイルのオプション名と同じものが使える。
# 例えば、&#39;--pid-path&#39;に対応するキーは&#39;pid-path&#39;。
# ただし、キーが&#39;config-path&#39;のオプションは無視される。
</pre></div>
</div>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-cache-limit">
<code class="sig-name descname">--cache-limit</code><code class="sig-prename descclassname"> &lt;limit&gt;</code><a class="headerlink" href="#cmdoption-groonga-cache-limit" title="Permalink to this definition">¶</a></dt>
<dd><p>キャッシュ数の最大値を指定します。(デフォルトは100です)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-default-match-escalation-threshold">
<code class="sig-name descname">--default-match-escalation-threshold</code><code class="sig-prename descclassname"> &lt;threshold&gt;</code><a class="headerlink" href="#cmdoption-groonga-default-match-escalation-threshold" title="Permalink to this definition">¶</a></dt>
<dd><p>検索の挙動をエスカレーションする閾値を指定します。(デフォルトは0です)</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-default-request-timeout">
<code class="sig-name descname">--default-request-timeout</code><code class="sig-prename descclassname"> &lt;timeout&gt;</code><a class="headerlink" href="#cmdoption-groonga-default-request-timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies the default request timeout in seconds.</p>
<p>You can specify timeout less than 1 second by decimal such as
<code class="docutils literal notranslate"><span class="pre">0.1</span></code>. <code class="docutils literal notranslate"><span class="pre">0.1</span></code> means that 100 milliseconds.</p>
<p>If you specify <code class="docutils literal notranslate"><span class="pre">0</span></code> or less value, request timeout is disabled by
default.</p>
<p>The default value is <code class="docutils literal notranslate"><span class="pre">0</span></code>.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../command/request_timeout.html"><span class="doc">Request timeout</span></a></p>
</div>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-cache-base-path">
<code class="sig-name descname">--cache-base-path</code><code class="sig-prename descclassname"> &lt;path&gt;</code><a class="headerlink" href="#cmdoption-groonga-cache-base-path" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified added">New in version 7.0.2.</span></p>
</div>
<p>Specifies the base path for cache. It enables persistent cache
feature.</p>
<p>You can get the following merits by persistent cache feature:</p>
<blockquote>
<div><ul class="simple">
<li><p>You can reuse cache after <code class="docutils literal notranslate"><span class="pre">groonga</span></code> process is restarted. You
don’t need to warm up your cache each restart.</p></li>
<li><p>You can share cache with multiple <code class="docutils literal notranslate"><span class="pre">groonga</span></code> processes.</p></li>
</ul>
</div></blockquote>
<p>You must specify the base path on memory file system. If you
specify the base path on disk, your cache will be slow. It’s not
make sense.</p>
<p>The default is nothing. It means that persistent cache is
disabled. On memory cache is used.</p>
<p>Persistent cache is a bit slower than on memory cache. Normally,
the difference has little influence on performance.</p>
</dd></dl>

</div>
<div class="section" id="command-line-parameters">
<h2><span class="section-number">7.1.3.4. </span>Command line parameters<a class="headerlink" href="#command-line-parameters" title="Permalink to this headline">¶</a></h2>
<dl class="std option">
<dt id="cmdoption-groonga-arg-dest">
<code class="sig-name descname">dest</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-groonga-arg-dest" title="Permalink to this definition">¶</a></dt>
<dd><p>使用するデータベースのパス名を指定します。</p>
<p>クライアントモードの場合は接続先のホスト名とポート番号を指定します(デフォルト値は’localhost:10043’)。ポート番号を指定しない場合には、10043が指定されたものとします。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-groonga-arg-command">
<code class="sig-name descname">command</code><code class="sig-prename descclassname"> [args]</code><a class="headerlink" href="#cmdoption-groonga-arg-command" title="Permalink to this definition">¶</a></dt>
<dd><p>スタンドアロンおよびクライアントモードの場合は、実行するコマンドとその引数をコマンドライン引数に指定できます。コマンドライン引数にcommandを与えなかった場合は、標準入力から一行ずつEOFに達するまでコマンド文字列を読み取り、順次実行します。</p>
</dd></dl>

</div>
<div class="section" id="command">
<span id="command-list-with-continuous-line"></span><h2><span class="section-number">7.1.3.5. </span>Command<a class="headerlink" href="#command" title="Permalink to this headline">¶</a></h2>
<p>groongaコマンドを通してデータベースを操作する命令をコマンドと呼びます。コマンドは主にC言語で記述され、groongaプロセスにロードすることによって使用できるようになります。
それぞれのコマンドは一意な名前と、0個以上の引数を持ちます。</p>
<p>引数は以下の2種類の方法のいずれかで指定することができます。:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>形式1: コマンド名 値1 値2,..

形式2: コマンド名 --引数名1 値1 --引数名2 値2,..
</pre></div>
</div>
<p>形式1でコマンドを実行する場合は、定義された順番で値を指定しなければならず、途中の引数の値を省略することはできません。形式2でコマンドを実行する場合は、「–引数名」のように引数の名前を明示しなければならない代わりに、任意の順番で引数を指定することが可能で、途中の引数の指定を省略することもできます。</p>
<p>標準入力からコマンド文字列を与える場合は、コマンド名と引数名と値は、空白( )で区切ります。空白や、記号「”’()」のうちいずれかを含む値を指定したい場合は、シングルクォート(‘)かダブルクォート(“)で値を囲みます。値として指定する文字列の中では、改行文字は’n’に置き換えて指定します。また、引用符に使用した文字を値の中で指定する場合には、その文字の前にバックスラッシュ(‘') を指定します。バックスラッシュ文字自身を値として指定する場合には、その前にバックスラッシュを指定します。</p>
<p>You can write command list with continuous line which is represented by ‘\’ character.:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>table_create --name Terms \
             --flags TABLE_PAT_KEY \
             --key_type ShortText \
             --default_tokenizer TokenBigram
</pre></div>
</div>
</div>
<div class="section" id="builtin-command">
<h2><span class="section-number">7.1.3.6. </span>Builtin command<a class="headerlink" href="#builtin-command" title="Permalink to this headline">¶</a></h2>
<p>以下のコマンドは組み込みコマンドとして予め定義されています。</p>
<blockquote>
<div><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">status</span></code></dt><dd><p>groongaプロセスの状態を表示します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">table_list</span></code></dt><dd><p>DBに定義されているテーブルのリストを表示します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">column_list</span></code></dt><dd><p>テーブルに定義されているカラムのリストを表示します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">table_create</span></code></dt><dd><p>DBにテーブルを追加します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">column_create</span></code></dt><dd><p>テーブルにカラムを追加します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">table_remove</span></code></dt><dd><p>DBに定義されているテーブルを削除します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">column_remove</span></code></dt><dd><p>テーブルに定義されているカラムを削除します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">load</span></code></dt><dd><p>テーブルにレコードを挿入します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">select</span></code></dt><dd><p>テーブルに含まれるレコードを検索して表示します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">define_selector</span></code></dt><dd><p>検索条件をカスタマイズした新たな検索コマンドを定義します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">quit</span></code></dt><dd><p>データベースとのセッションを終了します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">shutdown</span></code></dt><dd><p>サーバ(デーモン)プロセスを停止します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">log_level</span></code></dt><dd><p>ログ出力レベルを設定します。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">log_put</span></code></dt><dd><p>ログ出力を行います。</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">clearlock</span></code></dt><dd><p>ロックを解除します。</p>
</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="usage">
<h2><span class="section-number">7.1.3.7. </span>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
<p>新しいデータベースを作成します。:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>% groonga -n /tmp/hoge.db quit
%
</pre></div>
</div>
<p>作成済みのデータベースにテーブルを定義します。:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>% groonga /tmp/hoge.db table_create Table 0 ShortText
[[0]]
%
</pre></div>
</div>
<p>サーバを起動します。:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>% groonga -d /tmp/hoge.db
%
</pre></div>
</div>
<p>httpサーバとして起動します。:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>% groonga -d -p 80 --protocol http --document-root /usr/share/groonga/admin_html /tmp/hoge.db
%
</pre></div>
</div>
<p>サーバに接続し、テーブル一覧を表示します。:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>% groonga -c localhost table_list
[[0],[[&quot;id&quot;,&quot;name&quot;,&quot;path&quot;,&quot;flags&quot;,&quot;domain&quot;],[256,&quot;Table&quot;,&quot;/tmp/hoge.db.0000100&quot;,49152,14]]]
%
</pre></div>
</div>
</div>
</div>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">7.1.3. <code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file</a><ul>
<li><a class="reference internal" href="#summary">7.1.3.1. Summary</a></li>
<li><a class="reference internal" href="#syntax">7.1.3.2. Syntax</a><ul>
<li><a class="reference internal" href="#standalone-mode">7.1.3.2.1. Standalone mode</a></li>
<li><a class="reference internal" href="#server-mode">7.1.3.2.2. Server mode</a></li>
<li><a class="reference internal" href="#daemon-mode">7.1.3.2.3. Daemon mode</a></li>
<li><a class="reference internal" href="#client-mode">7.1.3.2.4. Client mode</a></li>
</ul>
</li>
<li><a class="reference internal" href="#options">7.1.3.3. Options</a></li>
<li><a class="reference internal" href="#command-line-parameters">7.1.3.4. Command line parameters</a></li>
<li><a class="reference internal" href="#command">7.1.3.5. Command</a></li>
<li><a class="reference internal" href="#builtin-command">7.1.3.6. Builtin command</a></li>
<li><a class="reference internal" href="#usage">7.1.3.7. Usage</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="grnslap.html"
                        title="previous chapter"><span class="section-number">7.1.2. </span>grnslap</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="groonga-benchmark.html"
                        title="next chapter"><span class="section-number">7.1.4. </span>groonga-benchmark</a></p>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="groonga-benchmark.html" title="7.1.4. groonga-benchmark"
             >next</a> |</li>
        <li class="right" >
          <a href="grnslap.html" title="7.1.2. grnslap"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">Groonga v10.1.1-31-g1e46ba6 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../reference.html" ><span class="section-number">7. </span>Reference manual</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../executables.html" ><span class="section-number">7.1. </span>Executables</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href=""><span class="section-number">7.1.3. </span><code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2009-2021, Brazil, Inc.
    </div>
  </body>
</html>