Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 03663abacfb5829946c324cb3e985338 > files > 419

groonga-doc-1.2.7-1.fc14.x86_64.rpm




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>7.1.3. groonga実行ファイル &mdash; groonga v1.2.6ドキュメント</title>
    
    <link rel="stylesheet" href="../_static/groonga.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.2.6',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/translations.js"></script>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="top" title="groonga v1.2.6ドキュメント" href="../index.html" />
    <link rel="up" title="7.1. 実行ファイル" href="../executables.html" />
    <link rel="next" title="7.1.4. groonga HTTPサービス" href="groonga-http.html" />
    <link rel="prev" title="7.1.2. grntest" href="grntest.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">オープンソースのカラムストア機能付き全文検索エンジン</span>
    </a>
  </h1>

  <div class="other-language-links">
    <ul>
      <li><a href="../../../en/html/executables/groonga.html"><img src="../_static/us.png" alt="English"></a></li>
    </ul>
  </div>
</div>
  

    <div class="related">
      <h3>ナビゲーション</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="総合索引"
             accesskey="I">索引</a></li>
        <li class="right" >
          <a href="groonga-http.html" title="7.1.4. groonga HTTPサービス"
             accesskey="N">次へ</a> |</li>
        <li class="right" >
          <a href="grntest.html" title="7.1.2. grntest"
             accesskey="P">前へ</a> |</li>
        <li><a href="../index.html">groonga v1.2.6ドキュメント</a> &raquo;</li>
          <li><a href="../reference.html" >7. リファレンスマニュアル</a> &raquo;</li>
          <li><a href="../executables.html" accesskey="U">7.1. 実行ファイル</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="groonga">
<h1>7.1.3. groonga実行ファイル<a class="headerlink" href="#groonga" title="このヘッドラインへのパーマリンク">¶</a></h1>
<div class="section" id="id1">
<h2>7.1.3.1. 名前<a class="headerlink" href="#id1" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>groonga - 列指向データベース機能を持つ全文検索エンジンソフトウェア</p>
</div>
<div class="section" id="id2">
<h2>7.1.3.2. 書式<a class="headerlink" href="#id2" title="このヘッドラインへのパーマリンク">¶</a></h2>
<div class="highlight-none"><div class="highlight"><pre>groonga [options] [dest] [command [args]]
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h2>7.1.3.3. 説明<a class="headerlink" href="#id3" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>groongaは列指向のデータベース機能を持つ高速でスケーラブルな全文検索エンジンです。
groongaのデータベースは、groonga実行ファイルかCライブラリインタフェースを通して操作することができます。このマニュアルページでは、groonga実行ファイルの使い方について説明します。</p>
</div>
<div class="section" id="id4">
<h2>7.1.3.4. オプション<a class="headerlink" href="#id4" title="このヘッドラインへのパーマリンク">¶</a></h2>
<dl class="cmdoption">
<dt id="cmdoption-n">
<tt class="descname">-n</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-n" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>新たなデータベースを作成します。</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-c">
<tt class="descname">-c</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-c" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>クライアントモードで実行します。</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-s">
<tt class="descname">-s</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-s" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>サーバモードで実行します。</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-d">
<tt class="descname">-d</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-d" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>デーモンモードで実行します。(forkする点がサーバモードと異なる)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-e">
<tt class="descname">-e</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--encoding</tt><tt class="descclassname"> &lt;encoding&gt;</tt><a class="headerlink" href="#cmdoption-e" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>データベースで使用する文字エンコーディング方式を指定します。新たなデータベースを作成する時のみ有効です。none, euc, utf8, sjis, latin, koi8rのいずれかが指定できます。</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-l">
<tt class="descname">-l</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--log-level</tt><tt class="descclassname"> &lt;log level&gt;</tt><a class="headerlink" href="#cmdoption-l" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>ログレベルを指定します。0〜8までの数値が指定可能で、数が大きいほど多くのログが出力されます。</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-a">
<tt class="descname">-a</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--address</tt><tt class="descclassname"> &lt;ip/hostname&gt;</tt><a class="headerlink" href="#cmdoption-a" title="この定義へのパーマリンク">¶</a></dt>
<dd><p class="deprecated">
<span class="versionmodified">バージョン 1.2.2 で撤廃: </span>Use <a class="reference internal" href="#cmdoption--bind-address"><em class="xref std std-option">--bind-address</em></a> instead.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption--bind-address">
<tt class="descname">--bind-address</tt><tt class="descclassname"> &lt;ip/hostname&gt;</tt><a class="headerlink" href="#cmdoption--bind-address" title="この定義へのパーマリンク">¶</a></dt>
<dd><p class="versionadded">
<span class="versionmodified">バージョン 1.2.2 で追加.</span></p>
<p>サーバモードかデーモンモードで実行するとき、listenするアドレスを指定します。(デフォルトは <cite>hostname</cite> の返すホスト名)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-p">
<tt class="descname">-p</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--port</tt><tt class="descclassname"> &lt;port number&gt;</tt><a class="headerlink" href="#cmdoption-p" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>クライアント、サーバ、またはデーモンモードで使用するTCPポート番号。
(デフォルトは10041番)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-i">
<tt class="descname">-i</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--server-id</tt><tt class="descclassname"> &lt;ip/hostname&gt;</tt><a class="headerlink" href="#cmdoption-i" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>サーバモードかデーモンモードで実行するとき、サーバのIDとなるアドレスを指定します。(デフォルトは`hostname`の返すホスト名)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-h">
<tt class="descname">-h</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--help</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-h" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>ヘルプメッセージを出力します。</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption--document-root">
<tt class="descname">--document-root</tt><tt class="descclassname"> &lt;path&gt;</tt><a class="headerlink" href="#cmdoption--document-root" title="この定義へのパーマリンク">¶</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="cmdoption">
<dt id="cmdoption--protocol">
<tt class="descname">--protocol</tt><tt class="descclassname"> &lt;protocol&gt;</tt><a class="headerlink" href="#cmdoption--protocol" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>http,gqtpのいずれかを指定します。(デフォルトはgqtp)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption--log-path">
<tt class="descname">--log-path</tt><tt class="descclassname"> &lt;path&gt;</tt><a class="headerlink" href="#cmdoption--log-path" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>ログを出力するファイルのパスを指定します。(デフォルトは/var/log/groonga/groonga.logです)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption--query-log-path">
<tt class="descname">--query-log-path</tt><tt class="descclassname"> &lt;path&gt;</tt><a class="headerlink" href="#cmdoption--query-log-path" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>クエリーログを出力するファイルのパスを指定します。(デフォルトでは出力されません)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-t">
<tt class="descname">-t</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--max-threads</tt><tt class="descclassname"> &lt;max threasd&gt;</tt><a class="headerlink" href="#cmdoption-t" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>最大で利用するスレッド数を指定します。(デフォルトはマシンのCPUコア数と同じ数です)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption--pid-path">
<tt class="descname">--pid-path</tt><tt class="descclassname"> &lt;path&gt;</tt><a class="headerlink" href="#cmdoption--pid-path" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>PIDを保存するパスを指定します。(デフォルトでは保存しません)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption--config-path">
<tt class="descname">--config-path</tt><tt class="descclassname"> &lt;path&gt;</tt><a class="headerlink" href="#cmdoption--config-path" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>設定ファイルのパスを指定します。設定ファイルは以下のようなフォーマットになります。:</p>
<div class="highlight-none"><div class="highlight"><pre># &#39;#&#39;以降はコメント。
; &#39;;&#39;以降もコメント。

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

# &#39;=&#39;の前後の空白はは無視される。↓は↑と同じ意味。
pid-file=/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="cmdoption">
<dt id="cmdoption--cache-limit">
<tt class="descname">--cache-limit</tt><tt class="descclassname"> &lt;limit&gt;</tt><a class="headerlink" href="#cmdoption--cache-limit" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>キャッシュ数の最大値を指定します。(デフォルトは100です)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption--default-match-escalation-threshold">
<tt class="descname">--default-match-escalation-threshold</tt><tt class="descclassname"> &lt;threshold&gt;</tt><a class="headerlink" href="#cmdoption--default-match-escalation-threshold" title="この定義へのパーマリンク">¶</a></dt>
<dd><p>検索の挙動をエスカレーションする閾値を指定します。(デフォルトは0です)</p>
</dd></dl>

</div>
<div class="section" id="id5">
<h2>7.1.3.5. 引数<a class="headerlink" href="#id5" title="このヘッドラインへのパーマリンク">¶</a></h2>
<dl class="cmdoption">
<dt>
<tt class="descname">dest</tt></dt>
<dd><p>使用するデータベースのパス名を指定します。</p>
<p>クライアントモードの場合は接続先のホスト名とポート番号を指定します(デフォルト値は'localhost:10041')。ポート番号を指定しない場合には、10041が指定されたものとします。</p>
</dd></dl>

<dl class="cmdoption">
<dt>
<tt class="descname">command [args]</tt></dt>
<dd><p>スタンドアロンおよびクライアントモードの場合は、実行するコマンドとその引数をコマンドライン引数に指定できます。コマンドライン引数にcommandを与えなかった場合は、標準入力から一行ずつEOFに達するまでコマンド文字列を読み取り、順次実行します。</p>
</dd></dl>

</div>
<div class="section" id="id6">
<h2>7.1.3.6. コマンド<a class="headerlink" href="#id6" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>groonga実行ファイルを通してデータベースを操作する命令をコマンドと呼びます。コマンドは主にC言語で記述され、groongaプロセスにロードすることによって使用できるようになります。
それぞれのコマンドは一意な名前と、0個以上の引数を持ちます。</p>
<p>引数は以下の2種類の方法のいずれかで指定することができます。:</p>
<div class="highlight-none"><div class="highlight"><pre>形式1: コマンド名 値1 値2,..

形式2: コマンド名 --引数名1 値1 --引数名2 値2,..
</pre></div>
</div>
<p>形式1でコマンドを実行する場合は、定義された順番で値を指定しなければならず、途中の引数の値を省略することはできません。形式2でコマンドを実行する場合は、「--引数名」のように引数の名前を明示しなければならない代わりに、任意の順番で引数を指定することが可能で、途中の引数の指定を省略することもできます。</p>
<p>標準入力からコマンド文字列を与える場合は、コマンド名と引数名と値は、空白( )で区切ります。空白や、記号「&quot;'()」のうちいずれかを含む値を指定したい場合は、シングルクォート(')かダブルクォート(&quot;)で値を囲みます。値として指定する文字列の中では、改行文字は'n'に置き換えて指定します。また、引用符に使用した文字を値の中で指定する場合には、その文字の前にバックスラッシュ('') を指定します。バックスラッシュ文字自身を値として指定する場合には、その前にバックスラッシュを指定します。</p>
</div>
<div class="section" id="id7">
<h2>7.1.3.7. 組み込みコマンド<a class="headerlink" href="#id7" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>以下のコマンドは組み込みコマンドとして予め定義されています。</p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">status</span></tt></dt>
<dd>groongaプロセスの状態を表示します。</dd>
<dt><tt class="docutils literal"><span class="pre">table_list</span></tt></dt>
<dd>DBに定義されているテーブルのリストを表示します。</dd>
<dt><tt class="docutils literal"><span class="pre">column_list</span></tt></dt>
<dd>テーブルに定義されているカラムのリストを表示します。</dd>
<dt><tt class="docutils literal"><span class="pre">table_create</span></tt></dt>
<dd>DBにテーブルを追加します。</dd>
<dt><tt class="docutils literal"><span class="pre">column_create</span></tt></dt>
<dd>テーブルにカラムを追加します。</dd>
<dt><tt class="docutils literal"><span class="pre">table_remove</span></tt></dt>
<dd>DBに定義されているテーブルを削除します。</dd>
<dt><tt class="docutils literal"><span class="pre">column_remove</span></tt></dt>
<dd>テーブルに定義されているカラムを削除します。</dd>
<dt><tt class="docutils literal"><span class="pre">view_add</span></tt></dt>
<dd>VIEW型のテーブルに要素となるテーブルを定義します。</dd>
<dt><tt class="docutils literal"><span class="pre">load</span></tt></dt>
<dd>テーブルにレコードを挿入します。</dd>
<dt><tt class="docutils literal"><span class="pre">select</span></tt></dt>
<dd>テーブルに含まれるレコードを検索して表示します。</dd>
<dt><tt class="docutils literal"><span class="pre">define_selector</span></tt></dt>
<dd>検索条件をカスタマイズした新たな検索コマンドを定義します。</dd>
<dt><tt class="docutils literal"><span class="pre">quit</span></tt></dt>
<dd>データベースとのセッションを終了します。</dd>
<dt><tt class="docutils literal"><span class="pre">shutdown</span></tt></dt>
<dd>サーバ(デーモン)プロセスを停止します。</dd>
<dt><tt class="docutils literal"><span class="pre">log_level</span></tt></dt>
<dd>ログ出力レベルを設定します。</dd>
<dt><tt class="docutils literal"><span class="pre">log_put</span></tt></dt>
<dd>ログ出力を行います。</dd>
<dt><tt class="docutils literal"><span class="pre">clearlock</span></tt></dt>
<dd>ロックを解除します。</dd>
</dl>
</div></blockquote>
</div>
<div class="section" id="id8">
<h2>7.1.3.8. 例<a class="headerlink" href="#id8" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>新しいデータベースを作成します。:</p>
<div class="highlight-none"><div class="highlight"><pre>% groonga -n /tmp/hoge.db quit
%
</pre></div>
</div>
<p>作成済みのデータベースにテーブルを定義します。:</p>
<div class="highlight-none"><div class="highlight"><pre>% groonga /tmp/hoge.db table_create Table 0 ShortText
[[0]]
%
</pre></div>
</div>
<p>サーバを起動します。:</p>
<div class="highlight-none"><div class="highlight"><pre>% groonga -d /tmp/hoge.db
%
</pre></div>
</div>
<p>httpサーバとして起動します。:</p>
<div class="highlight-none"><div class="highlight"><pre>% 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"><div class="highlight"><pre>% 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>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">目次</a></h3>
  <ul>
<li><a class="reference internal" href="#">7.1.3. groonga実行ファイル</a><ul>
<li><a class="reference internal" href="#id1">7.1.3.1. 名前</a></li>
<li><a class="reference internal" href="#id2">7.1.3.2. 書式</a></li>
<li><a class="reference internal" href="#id3">7.1.3.3. 説明</a></li>
<li><a class="reference internal" href="#id4">7.1.3.4. オプション</a></li>
<li><a class="reference internal" href="#id5">7.1.3.5. 引数</a></li>
<li><a class="reference internal" href="#id6">7.1.3.6. コマンド</a></li>
<li><a class="reference internal" href="#id7">7.1.3.7. 組み込みコマンド</a></li>
<li><a class="reference internal" href="#id8">7.1.3.8. 例</a></li>
</ul>
</li>
</ul>

  <h4>前のトピックへ</h4>
  <p class="topless"><a href="grntest.html"
                        title="前の章へ">7.1.2. grntest</a></p>
  <h4>次のトピックへ</h4>
  <p class="topless"><a href="groonga-http.html"
                        title="次の章へ">7.1.4. groonga HTTPサービス</a></p>
  <h3>このページ</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/executables/groonga.txt"
           rel="nofollow">ソースコードを表示</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>クイック検索</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="検索" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    モジュール、クラス、または関数名を入力してください
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>ナビゲーション</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="総合索引"
             >索引</a></li>
        <li class="right" >
          <a href="groonga-http.html" title="7.1.4. groonga HTTPサービス"
             >次へ</a> |</li>
        <li class="right" >
          <a href="grntest.html" title="7.1.2. grntest"
             >前へ</a> |</li>
        <li><a href="../index.html">groonga v1.2.6ドキュメント</a> &raquo;</li>
          <li><a href="../reference.html" >7. リファレンスマニュアル</a> &raquo;</li>
          <li><a href="../executables.html" >7.1. 実行ファイル</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2011, Brazil, Inc.
    </div>
  </body>
</html>