Kouhei Sutou
null+****@clear*****
Mon Jan 18 19:09:44 JST 2016
Kouhei Sutou 2016-01-18 19:09:44 +0900 (Mon, 18 Jan 2016) New Revision: 8837b8d06c556445a7b665670eca6692cbef940d https://github.com/groonga/groonga.org/commit/8837b8d06c556445a7b665670eca6692cbef940d Message: Add new files Added files: docs/reference/commands/schema.html docs/sources/reference/commands/schema.txt ja/docs/reference/commands/schema.html ja/docs/sources/reference/commands/schema.txt Added: docs/reference/commands/schema.html (+1195 -0) 100644 =================================================================== --- /dev/null +++ docs/reference/commands/schema.html 2016-01-18 19:09:44 +0900 (31bd86c) @@ -0,0 +1,1195 @@ +<!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.3.43. schema — Groonga v5.1.1 documentation</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: '5.1.1', + 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> + <link rel="shortcut icon" href="../../static/favicon.ico"/> + <link rel="top" title="Groonga v5.1.1 documentation" href="../../index.html" /> + <link rel="up" title="7.3. Command" href="../command.html" /> + <link rel="next" title="7.3.44. select" href="select.html" /> + <link rel="prev" title="7.3.42. ruby_load" href="ruby_load.html" /> + <meta property="fb:page_id" content="201193596592346" /><!-- groonga --> + <meta property="fb:admins" content="664204556" /><!-- kouhei.sutou --> + <meta property="og:type" content="product" /> + <meta property="og:image" content="http://groonga.org/images/logos/groonga-icon-full-size.png" /> + <meta property="og:site_name" content="groonga" /> + + <link rel="stylesheet" href="/css/sphinx.css" type="text/css" /> + </head> + + <body role="document"> +<div class="header"> + <h1 class="title"> + <a id="top-link" href="../../../"> + <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="facebook-buttons"> + <fb:like href="http://www.facebook.com/pages/groonga/201193596592346" + layout="standard" + width="290"></fb:like> + </div> + <div class="other-language-links"> + + <ul> + <li><a href="../../../ja/docs/reference/commands/schema.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="select.html" title="7.3.44. select" + accesskey="N">next</a> |</li> + <li class="right" > + <a href="ruby_load.html" title="7.3.42. ruby_load" + accesskey="P">previous</a> |</li> + <li class="nav-item nav-item-0"><a href="../../index.html">Groonga v5.1.1 documentation</a> »</li> + <li class="nav-item nav-item-1"><a href="../../reference.html" >7. Reference manual</a> »</li> + <li class="nav-item nav-item-2"><a href="../command.html" accesskey="U">7.3. Command</a> »</li> + </ul> + </div> + + <div class="document"> + <div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body" role="main"> + + <div class="section" id="schema"> +<h1>7.3.43. <code class="docutils literal"><span class="pre">schema</span></code><a class="headerlink" href="#schema" title="Permalink to this headline">¶</a></h1> +<div class="section" id="summary"> +<h2>7.3.43.1. Summary<a class="headerlink" href="#summary" title="Permalink to this headline">¶</a></h2> +<div class="versionadded"> +<p><span class="versionmodified">New in version 5.0.9.</span></p> +</div> +<p><code class="docutils literal"><span class="pre">schema</span></code> command returns schema in the database.</p> +<p>This command is useful when you want to inspect the database. For +example, visualizing the database, creating GUI for the database and +so on.</p> +</div> +<div class="section" id="syntax"> +<h2>7.3.43.2. Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This command takes no parameters:</p> +<div class="highlight-none"><div class="highlight"><pre>schema +</pre></div> +</div> +</div> +<div class="section" id="usage"> +<h2>7.3.43.3. Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2> +<p>Here is an example schema to show example output:</p> +<p>Execution example:</p> +<div class="highlight-none"><div class="highlight"><pre>table_create Memos TABLE_HASH_KEY ShortText +# [[0, 1337566253.89858, 0.000355720520019531], true] +column_create Memos content COLUMN_SCALAR Text +# [[0, 1337566253.89858, 0.000355720520019531], true] +table_create Terms TABLE_PAT_KEY ShortText \ + --default_tokenizer TokenBigram \ + --normalizer NormalizerAuto +# [[0, 1337566253.89858, 0.000355720520019531], true] +column_create Terms memos_content_index \ + COLUMN_INDEX|WITH_POSITION \ + Memos content +# [[0, 1337566253.89858, 0.000355720520019531], true] +</pre></div> +</div> +<p>Here is an output of <code class="docutils literal"><span class="pre">schema</span></code> command against this example schema:</p> +<p>Execution example:</p> +<div class="highlight-none"><div class="highlight"><pre>schema +# [ +# [ +# 0, +# 1337566253.89858, +# 0.000355720520019531 +# ], +# { +# "tables": { +# "Terms": { +# "normalizer": { +# "name": "NormalizerAuto" +# }, +# "name": "Terms", +# "tokenizer": { +# "name": "TokenBigram" +# }, +# "command": { +# "command_line": "table_create --name Terms --flags TABLE_PAT_KEY --key_type ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto", +# "name": "table_create", +# "arguments": { +# "key_type": "ShortText", +# "default_tokenizer": "TokenBigram", +# "normalizer": "NormalizerAuto", +# "flags": "TABLE_PAT_KEY", +# "name": "Terms" +# } +# }, +# "indexes": [], +# "key_type": { +# "type": "type", +# "name": "ShortText" +# }, +# "value_type": null, +# "token_filters": [], +# "type": "patricia trie", +# "columns": { +# "memos_content_index": { +# "name": "memos_content_index", +# "weight": false, +# "section": false, +# "compress": null, +# "command": { +# "command_line": "column_create --table Terms --name memos_content_index --flags COLUMN_INDEX|WITH_POSITION --type Memos --sources content", +# "name": "column_create", +# "arguments": { +# "table": "Terms", +# "flags": "COLUMN_INDEX|WITH_POSITION", +# "name": "memos_content_index", +# "sources": "content", +# "type": "Memos" +# } +# }, +# "indexes": [], +# "sources": [ +# { +# "table": "Memos", +# "name": "content", +# "full_name": "Memos.content" +# } +# ], +# "value_type": { +# "type": "reference", +# "name": "Memos" +# }, +# "full_name": "Terms.memos_content_index", +# "position": true, +# "table": "Terms", +# "type": "index" +# } +# } +# }, +# "Memos": { +# "normalizer": null, +# "name": "Memos", +# "tokenizer": null, +# "command": { +# "command_line": "table_create --name Memos --flags TABLE_HASH_KEY --key_type ShortText", +# "name": "table_create", +# "arguments": { +# "key_type": "ShortText", +# "flags": "TABLE_HASH_KEY", +# "name": "Memos" +# } +# }, +# "indexes": [], +# "key_type": { +# "type": "type", +# "name": "ShortText" +# }, +# "value_type": null, +# "token_filters": [], +# "type": "hash table", +# "columns": { +# "content": { +# "name": "content", +# "weight": false, +# "section": false, +# "compress": null, +# "command": { +# "command_line": "column_create --table Memos --name content --flags COLUMN_SCALAR --type Text", +# "name": "column_create", +# "arguments": { +# "table": "Memos", +# "flags": "COLUMN_SCALAR", +# "name": "content", +# "type": "Text" +# } +# }, +# "indexes": [ +# { +# "table": "Terms", +# "section": 0, +# "name": "memos_content_index", +# "full_name": "Terms.memos_content_index" +# } +# ], +# "sources": [], +# "value_type": { +# "type": "type", +# "name": "Text" +# }, +# "full_name": "Memos.content", +# "position": false, +# "table": "Memos", +# "type": "scalar" +# } +# } +# } +# }, +# "normalizers": { +# "NormalizerNFKC51": { +# "name": "NormalizerNFKC51" +# }, +# "NormalizerAuto": { +# "name": "NormalizerAuto" +# } +# }, +# "token_filters": {}, +# "tokenizers": { +# "TokenBigramSplitSymbolAlphaDigit": { +# "name": "TokenBigramSplitSymbolAlphaDigit" +# }, +# "TokenRegexp": { +# "name": "TokenRegexp" +# }, +# "TokenBigramIgnoreBlankSplitSymbolAlphaDigit": { +# "name": "TokenBigramIgnoreBlankSplitSymbolAlphaDigit" +# }, +# "TokenBigram": { +# "name": "TokenBigram" +# }, +# "TokenDelimit": { +# "name": "TokenDelimit" +# }, +# "TokenUnigram": { +# "name": "TokenUnigram" +# }, +# "TokenBigramSplitSymbol": { +# "name": "TokenBigramSplitSymbol" +# }, +# "TokenDelimitNull": { +# "name": "TokenDelimitNull" +# }, +# "TokenBigramIgnoreBlankSplitSymbolAlpha": { +# "name": "TokenBigramIgnoreBlankSplitSymbolAlpha" +# }, +# "TokenBigramSplitSymbolAlpha": { +# "name": "TokenBigramSplitSymbolAlpha" +# }, +# "TokenTrigram": { +# "name": "TokenTrigram" +# }, +# "TokenMecab": { +# "name": "TokenMecab" +# }, +# "TokenBigramIgnoreBlankSplitSymbol": { +# "name": "TokenBigramIgnoreBlankSplitSymbol" +# }, +# "TokenBigramIgnoreBlank": { +# "name": "TokenBigramIgnoreBlank" +# } +# }, +# "plugins": {}, +# "types": { +# "UInt64": { +# "can_be_key_type": true, +# "name": "UInt64", +# "can_be_value_type": true, +# "size": 8 +# }, +# "Int32": { +# "can_be_key_type": true, +# "name": "Int32", +# "can_be_value_type": true, +# "size": 4 +# }, +# "Int16": { +# "can_be_key_type": true, +# "name": "Int16", +# "can_be_value_type": true, +# "size": 2 +# }, +# "LongText": { +# "can_be_key_type": false, +# "name": "LongText", +# "can_be_value_type": false, +# "size": 2147483648 +# }, +# "TokyoGeoPoint": { +# "can_be_key_type": true, +# "name": "TokyoGeoPoint", +# "can_be_value_type": true, +# "size": 8 +# }, +# "Text": { +# "can_be_key_type": false, +# "name": "Text", +# "can_be_value_type": false, +# "size": 65536 +# }, +# "ShortText": { +# "can_be_key_type": true, +# "name": "ShortText", +# "can_be_value_type": false, +# "size": 4096 +# }, +# "Float": { +# "can_be_key_type": true, +# "name": "Float", +# "can_be_value_type": true, +# "size": 8 +# }, +# "UInt8": { +# "can_be_key_type": true, +# "name": "UInt8", +# "can_be_value_type": true, +# "size": 1 +# }, +# "UInt32": { +# "can_be_key_type": true, +# "name": "UInt32", +# "can_be_value_type": true, +# "size": 4 +# }, +# "Object": { +# "can_be_key_type": true, +# "name": "Object", +# "can_be_value_type": true, +# "size": 8 +# }, +# "UInt16": { +# "can_be_key_type": true, +# "name": "UInt16", +# "can_be_value_type": true, +# "size": 2 +# }, +# "Int64": { +# "can_be_key_type": true, +# "name": "Int64", +# "can_be_value_type": true, +# "size": 8 +# }, +# "Time": { +# "can_be_key_type": true, +# "name": "Time", +# "can_be_value_type": true, +# "size": 8 +# }, +# "Bool": { +# "can_be_key_type": true, +# "name": "Bool", +# "can_be_value_type": true, +# "size": 1 +# }, +# "WGS84GeoPoint": { +# "can_be_key_type": true, +# "name": "WGS84GeoPoint", +# "can_be_value_type": true, +# "size": 8 +# }, +# "Int8": { +# "can_be_key_type": true, +# "name": "Int8", +# "can_be_value_type": true, +# "size": 1 +# } +# } +# } +# ] +</pre></div> +</div> +</div> +<div class="section" id="return-value"> +<h2>7.3.43.4. Return value<a class="headerlink" href="#return-value" title="Permalink to this headline">¶</a></h2> +<p><code class="docutils literal"><span class="pre">schema</span></code> command returns schema in the database:</p> +<div class="highlight-none"><div class="highlight"><pre>[HEADER, SCHEMA] +</pre></div> +</div> +<div class="section" id="header"> +<h3>7.3.43.4.1. <code class="docutils literal"><span class="pre">HEADER</span></code><a class="headerlink" href="#header" title="Permalink to this headline">¶</a></h3> +<p>See <a class="reference internal" href="../command/output_format.html"><em>Output format</em></a> about <code class="docutils literal"><span class="pre">HEADER</span></code>.</p> +</div> +<div class="section" id="id1"> +<h3>7.3.43.4.2. <code class="docutils literal"><span class="pre">SCHEMA</span></code><a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">SCHEMA</span></code> is an object that consists of the following information:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "plugins": PLUGINS, + "types": TYPES, + "tokenizers": TOKENIZERS, + "normalizers": NORMALIZERS, + "token_filters": TOKEN_FITLERS, + "tables": TABLES +} +</pre></div> +</div> +</div> +<div class="section" id="plugins"> +<h3>7.3.43.4.3. <code class="docutils literal"><span class="pre">PLUGINS</span></code><a class="headerlink" href="#plugins" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">PLUGINS</span></code> is an object. Its key is plugin name and its value is +plugin detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "PLUGIN_NAME_1": PLUGIN_1, + "PLUGIN_NAME_2": PLUGIN_2, + ... + "PLUGIN_NAME_n": PLUGIN_n +} +</pre></div> +</div> +</div> +<div class="section" id="plugin"> +<h3>7.3.43.4.4. <code class="docutils literal"><span class="pre">PLUGIN</span></code><a class="headerlink" href="#plugin" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">PLUGIN</span></code> is an object that describes plugin detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": PLUGIN_NAME +} +</pre></div> +</div> +<p>Here are properties of <code class="docutils literal"><span class="pre">PLUGIN</span></code>:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Name</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td>The plugin name. It's used in <a class="reference internal" href="plugin_register.html"><em>plugin_register</em></a>.</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="types"> +<h3>7.3.43.4.5. <code class="docutils literal"><span class="pre">TYPES</span></code><a class="headerlink" href="#types" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TYPES</span></code> is an object. Its key is type name and its value is +type detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "TYPE_NAME_1": TYPE_1, + "TYPE_NAME_2": TYPE_2, + ... + "TYPE_NAME_n": TYPE_n +} +</pre></div> +</div> +</div> +<div class="section" id="type"> +<h3>7.3.43.4.6. <code class="docutils literal"><span class="pre">TYPE</span></code><a class="headerlink" href="#type" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TYPE</span></code> is an object that describes type detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": TYPE_NAME, + "size": SIZE_OF_ONE_VALUE_IN_BYTE, + "can_be_key_type": BOOLEAN, + "can_be_value_type": BOOLEAN +} +</pre></div> +</div> +<p>Here are properties of <code class="docutils literal"><span class="pre">TYPE</span></code>:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Name</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td>The type name.</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">size</span></code></td> +<td>The number of bytes of one value.</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">can_be_key_type</span></code></td> +<td><code class="docutils literal"><span class="pre">true</span></code> when the type can be used for table key, <code class="docutils literal"><span class="pre">false</span></code> +otherwise.</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">can_be_value_type</span></code></td> +<td><code class="docutils literal"><span class="pre">true</span></code> when the type can be used for table value, <code class="docutils literal"><span class="pre">false</span></code> +otherwise.</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="tokenizers"> +<h3>7.3.43.4.7. <code class="docutils literal"><span class="pre">TOKENIZERS</span></code><a class="headerlink" href="#tokenizers" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TOKENIZERS</span></code> is an object. Its key is tokenizer name and its value +is tokenizer detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "TOKENIZER_NAME_1": TOKENIZER_1, + "TOKENIZER_NAME_2": TOKENIZER_2, + ... + "TOKENIZER_NAME_n": TOKENIZER_n +} +</pre></div> +</div> +</div> +<div class="section" id="tokenizer"> +<h3>7.3.43.4.8. <code class="docutils literal"><span class="pre">TOKENIZER</span></code><a class="headerlink" href="#tokenizer" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TOKENIZER</span></code> is an object that describes tokenizer detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": TOKENIZER_NAME +} +</pre></div> +</div> +<p>Here are properties of <code class="docutils literal"><span class="pre">TOKENIZER</span></code>:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Name</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td>The tokenizer name. It's used for +<a class="reference internal" href="table_create.html#table-create-default-tokenizer"><span>default_tokenizer</span></a>.</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="normalizers"> +<h3>7.3.43.4.9. <code class="docutils literal"><span class="pre">NORMALIZERS</span></code><a class="headerlink" href="#normalizers" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">NORMALIZERS</span></code> is an object. Its key is normalizer name and its value +is normalizer detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "NORMALIZER_NAME_1": NORMALIZER_1, + "NORMALIZER_NAME_2": NORMALIZER_2, + ... + "NORMALIZER_NAME_n": NORMALIZER_n +} +</pre></div> +</div> +</div> +<div class="section" id="normalizer"> +<h3>7.3.43.4.10. <code class="docutils literal"><span class="pre">NORMALIZER</span></code><a class="headerlink" href="#normalizer" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">NORMALIZER</span></code> is an object that describes normalizer detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": NORMALIZER_NAME +} +</pre></div> +</div> +<p>Here are properties of <code class="docutils literal"><span class="pre">NORMALIZER</span></code>:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Name</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td>The normalizer name. It's used for +<a class="reference internal" href="table_create.html#table-create-normalizer"><span>normalizer</span></a>.</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="token-filters"> +<h3>7.3.43.4.11. <code class="docutils literal"><span class="pre">TOKEN_FILTERS</span></code><a class="headerlink" href="#token-filters" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TOKEN_FILTERS</span></code> is an object. Its key is token filter name and its value +is token filter detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "TOKEN_FILTER_NAME_1": TOKEN_FILTER_1, + "TOKEN_FILTER_NAME_2": TOKEN_FILTER_2, + ... + "TOKEN_FILTER_NAME_n": TOKEN_FILTER_n +} +</pre></div> +</div> +</div> +<div class="section" id="token-filter"> +<h3>7.3.43.4.12. <code class="docutils literal"><span class="pre">TOKEN_FILTER</span></code><a class="headerlink" href="#token-filter" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TOKEN_FILTER</span></code> is an object that describes token filter detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": TOKEN_FILTER_NAME +} +</pre></div> +</div> +<p>Here are properties of <code class="docutils literal"><span class="pre">TOKEN_FILTER</span></code>:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Name</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td>The token filter name. It's used for +<a class="reference internal" href="table_create.html#table-create-token-filters"><span>token_filters</span></a>.</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="tables"> +<h3>7.3.43.4.13. <code class="docutils literal"><span class="pre">TABLES</span></code><a class="headerlink" href="#tables" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TABLES</span></code> is an object. Its key is table name and its value +is table detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "TABLE_NAME_1": TABLE_1, + "TABLE_NAME_2": TABLE_2, + ... + "TABLE_NAME_n": TABLE_n +} +</pre></div> +</div> +</div> +<div class="section" id="table"> +<h3>7.3.43.4.14. <code class="docutils literal"><span class="pre">TABLE</span></code><a class="headerlink" href="#table" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TABLE</span></code> is an object that describes table detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": TABLE_NAME + "type": TYPE, + "key_type": KEY_TYPE, + "value_type": VALUE_TYPE, + "tokenizer": TOKENIZER, + "normalizer": NORMALIZER, + "token_filters": [ + TOKEN_FILTER_1, + TOKEN_FILTER_2, + ..., + TOKEN_FILTER_n, + ], + "indexes": [ + INDEX_1, + INDEX_2, + ..., + INDEX_n + ], + "command": COMMAND, + "columns": { + "COLUMN_NAME_1": COLUMN_1, + "COLUMN_NAME_2": COLUMN_2, + ..., + "COLUMN_NAME_3": COLUMN_3, + } +} +</pre></div> +</div> +<p>Here are properties of <code class="docutils literal"><span class="pre">TABLE</span></code>:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Name</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td>The table name.</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">type</span></code></td> +<td><p class="first">The table type.</p> +<p>This is one of the followings:</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">array</span></code>: <a class="reference internal" href="../tables.html#table-no-key"><span>TABLE_NO_KEY</span></a></li> +<li><code class="docutils literal"><span class="pre">hash</span></code>: <a class="reference internal" href="../tables.html#table-hash-key"><span>TABLE_HASH_KEY</span></a></li> +<li><code class="docutils literal"><span class="pre">patricia</span> <span class="pre">trie</span></code>: <a class="reference internal" href="../tables.html#table-pat-key"><span>TABLE_PAT_KEY</span></a></li> +<li><code class="docutils literal"><span class="pre">double</span> <span class="pre">array</span> <span class="pre">trie</span></code>: <a class="reference internal" href="../tables.html#table-dat-key"><span>TABLE_DAT_KEY</span></a></li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">key_type</span></code></td> +<td><p class="first">The type of the table's key.</p> +<p>If the table type is <code class="docutils literal"><span class="pre">array</span></code>, this is <code class="docutils literal"><span class="pre">null</span></code>.</p> +<p>If the table type isn't <code class="docutils literal"><span class="pre">array</span></code>, this is an object +that has the following properties:</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">name</span></code>: The type name.</li> +<li><code class="docutils literal"><span class="pre">type</span></code>: <code class="docutils literal"><span class="pre">reference</span></code> if the type is an table, <code class="docutils literal"><span class="pre">type</span></code> +otherwise.</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">value_type</span></code></td> +<td><p class="first">The type of the table's value.</p> +<p>If the table doesn't use value, this is <code class="docutils literal"><span class="pre">null</span></code>.</p> +<p>If the table uses value, this is an object that has the +following properties:</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">name</span></code>: The type name.</li> +<li><code class="docutils literal"><span class="pre">type</span></code>: <code class="docutils literal"><span class="pre">reference</span></code> if the type is an table, <code class="docutils literal"><span class="pre">type</span></code> +otherwise.</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">tokenizer</span></code></td> +<td><p class="first">The tokenizer of the table. It's specified by +<a class="reference internal" href="table_create.html#table-create-default-tokenizer"><span>default_tokenizer</span></a>.</p> +<p>If the table doesn't use tokenizer, this is <code class="docutils literal"><span class="pre">null</span></code>.</p> +<p>If the table uses tokenizer, this is an object that has the +following properties:</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">name</span></code>: The tokenizer name.</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">normalizer</span></code></td> +<td><p class="first">The normalizer of the table. It's specified by +<a class="reference internal" href="table_create.html#table-create-normalizer"><span>normalizer</span></a>.</p> +<p>If the table doesn't use normalizer, this is <code class="docutils literal"><span class="pre">null</span></code>.</p> +<p>If the table uses normalizer, this is an object that has the +following properties:</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">name</span></code>: The normalizer name.</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">token_filters</span></code></td> +<td><p class="first">The token filters of the table. It's specified by +<a class="reference internal" href="table_create.html#table-create-token-filters"><span>token_filters</span></a>.</p> +<p>This is an array of an object. The object has the following +properties:</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">name</span></code>: The token filter name.</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">indexes</span></code></td> +<td><p class="first">The indexes of the table's key.</p> +<p class="last">This is an array of <a class="reference internal" href="#schema-return-value-index"><span>INDEX</span></a>.</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">command</span></code></td> +<td><p class="first">The Groonga command information to create the table.</p> +<p class="last">This is <a class="reference internal" href="#schema-return-value-command"><span>COMMAND</span></a>.</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">columns</span></code></td> +<td><p class="first">The columns of the table.</p> +<p class="last">This is an object that its key is a column name and its value +is <a class="reference internal" href="#schema-return-value-column"><span>COLUMN</span></a>.</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="index"> +<span id="schema-return-value-index"></span><h3>7.3.43.4.15. <code class="docutils literal"><span class="pre">INDEX</span></code><a class="headerlink" href="#index" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">INDEX</span></code> is an object that describes index detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "full_name": INDEX_COLUMN_NAME_WITH_TABLE_NAME, + "table": TABLE_NAME, + "name": INDEX_COLUMN_NAME, + "section": SECTION +} +</pre></div> +</div> +<p>Here are properties of <code class="docutils literal"><span class="pre">INDEX</span></code>:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Name</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">full_name</span></code></td> +<td><p class="first">The index column name with table name.</p> +<p class="last">For example, <code class="docutils literal"><span class="pre">Terms.index</span></code>.</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">table</span></code></td> +<td><p class="first">The table name of the index column.</p> +<p class="last">For example, <code class="docutils literal"><span class="pre">Terms</span></code>.</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first">The index column name.</p> +<p class="last">For example, <code class="docutils literal"><span class="pre">index</span></code>.</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">section</span></code></td> +<td><p class="first">The section number in the index column for the table's key.</p> +<p class="last">If the index column isn't multiple column index, this is <code class="docutils literal"><span class="pre">0</span></code>.</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="command"> +<span id="schema-return-value-command"></span><h3>7.3.43.4.16. <code class="docutils literal"><span class="pre">COMMAND</span></code><a class="headerlink" href="#command" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">COMMAND</span></code> is an object that describes how to create the table or +column:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": COMMAND_NAME, + "arguments": { + "KEY_1": "VALUE_1", + "KEY_2": "VALUE_2", + ..., + "KEY_n": "VALUE_n" + }, + "command_line": COMMAND_LINE +} +</pre></div> +</div> +<p>Here are properties of <code class="docutils literal"><span class="pre">COMMAND</span></code>:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Name</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td>The Groonga command name to create the table or column.</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">arguments</span></code></td> +<td><p class="first">The arguments of the Groonga command to create the +table or column.</p> +<p class="last">This is an object that its key is argument name and its value +is argument value.</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">command_line</span></code></td> +<td><p class="first">The Groonga command line to create the table or column.</p> +<p class="last">This is a string that can be evaluated by Groonga.</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="column"> +<span id="schema-return-value-column"></span><h3>7.3.43.4.17. <code class="docutils literal"><span class="pre">COLUMN</span></code><a class="headerlink" href="#column" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">COLUMN</span></code> is an object that describes column detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": COLUMN_NAME, + "table": TABLE_NAME, + "full_name": COLUMN_NAME_WITH_TABLE, + "type": TYPE, + "value_type": VALUE_TYPE, + "compress": COMPRESS, + "section": SECTION, + "weight": WEIGHT, + "compress": COMPRESS, + "section": BOOLEAN, + "weight": BOOLEAN, + "position": BOOLEAN, + "sources": [ + SOURCE_1, + SOURCE_2, + ..., + SOURCE_n + ], + "indexes": [ + INDEX_1, + INDEX_2, + ..., + INDEX_n + ], + "command": COMMAND +} +</pre></div> +</div> +<p>Here are properties of <code class="docutils literal"><span class="pre">COLUMN</span></code>:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Name</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first">The column name.</p> +<p class="last">For example, <code class="docutils literal"><span class="pre">age</span></code>.</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">table</span></code></td> +<td><p class="first">The table name of the column.</p> +<p class="last">For example, <code class="docutils literal"><span class="pre">Users</span></code>.</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">full_name</span></code></td> +<td><p class="first">The column name with table name.</p> +<p class="last">For example, <code class="docutils literal"><span class="pre">Users.age</span></code>.</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">type</span></code></td> +<td><p class="first">The column type.</p> +<p>This is one of the followings:</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">scalar</span></code>: <a class="reference internal" href="../columns/scalar.html"><em>Scalar column</em></a></li> +<li><code class="docutils literal"><span class="pre">vector</span></code>: <a class="reference internal" href="../columns/vector.html"><em>Vector column</em></a></li> +<li><code class="docutils literal"><span class="pre">index</span></code>: <a class="reference internal" href="../columns/index.html"><em>Index column</em></a></li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">value_type</span></code></td> +<td><p class="first">The type of the column's value.</p> +<p>This is an object that has the following properties:</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">name</span></code>: The type name.</li> +<li><code class="docutils literal"><span class="pre">type</span></code>: <code class="docutils literal"><span class="pre">reference</span></code> if the type is an table, <code class="docutils literal"><span class="pre">type</span></code> +otherwise.</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">compress</span></code></td> +<td><p class="first">The compression method of the column.</p> +<p>If the column doesn't use any compression methods, this is +<code class="docutils literal"><span class="pre">null</span></code>.</p> +<p>If the column uses a compression method, this is one of the +followings:</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">zlib</span></code>: The column uses zlib to compress column value.</li> +<li><code class="docutils literal"><span class="pre">lz4</span></code>: The column uses LZ4 to compress column value.</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">section</span></code></td> +<td><p class="first">Whether the column can store section information or not.</p> +<p><code class="docutils literal"><span class="pre">true</span></code> if the column is created with <code class="docutils literal"><span class="pre">WITH_SECTION</span></code> flag, +<code class="docutils literal"><span class="pre">false</span></code> otherwise.</p> +<p class="last">Normally, if the column isn't an index column, this is <code class="docutils literal"><span class="pre">false</span></code>.</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">weight</span></code></td> +<td><p class="first">Whether the column can store weight information or not.</p> +<p class="last"><code class="docutils literal"><span class="pre">true</span></code> if the column is created with <code class="docutils literal"><span class="pre">WITH_WEIGHT</span></code> flag, +<code class="docutils literal"><span class="pre">false</span></code> otherwise.</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">position</span></code></td> +<td><p class="first">Whether the column can store position information or not.</p> +<p><code class="docutils literal"><span class="pre">true</span></code> if the column is created with <code class="docutils literal"><span class="pre">WITH_POSITION</span></code> flag, +<code class="docutils literal"><span class="pre">false</span></code> otherwise.</p> +<p class="last">Normally, if the column isn't an index column, this is <code class="docutils literal"><span class="pre">false</span></code>.</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">sources</span></code></td> +<td><p class="first">The source columns of the index column.</p> +<p>This is an array of <a class="reference internal" href="#schema-return-value-source"><span>SOURCE</span></a>.</p> +<p class="last">Normally, if the column isn't an index column, this is an +empty array.</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">indexes</span></code></td> +<td><p class="first">The indexes of the column.</p> +<p class="last">This is an array of <a class="reference internal" href="#schema-return-value-index"><span>INDEX</span></a>.</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">command</span></code></td> +<td><p class="first">The Groonga command information to create the column.</p> +<p class="last">This is <a class="reference internal" href="#schema-return-value-command"><span>COMMAND</span></a>.</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="source"> +<span id="schema-return-value-source"></span><h3>7.3.43.4.18. <code class="docutils literal"><span class="pre">SOURCE</span></code><a class="headerlink" href="#source" title="Permalink to this headline">¶</a></h3> +<p><code class="docutils literal"><span class="pre">SOURCE</span></code> is an object that describes source detail:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": COLUMN_NAME, + "table": TABLE_NAME, + "full_name": COLUMN_NAME_WITH_TABLE_NAME +} +</pre></div> +</div> +<p>Here are properties of <code class="docutils literal"><span class="pre">SOURCE</span></code>:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Name</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first">The source column name.</p> +<p>For example, <code class="docutils literal"><span class="pre">content</span></code>.</p> +<p class="last">This may be a <code class="docutils literal"><span class="pre">_key</span></code> pseudo column.</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">table</span></code></td> +<td><p class="first">The table name of the source column.</p> +<p class="last">For example, <code class="docutils literal"><span class="pre">Memos</span></code>.</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">full_name</span></code></td> +<td><p class="first">The source column name with table name.</p> +<p class="last">For example, <code class="docutils literal"><span class="pre">Memos.content</span></code>.</p> +</td> +</tr> +</tbody> +</table> +</div> +</div> +<div class="section" id="see-also"> +<h2>7.3.43.5. See also<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h2> +<blockquote> +<div><ul class="simple"> +<li><a class="reference internal" href="table_create.html"><em>table_create</em></a></li> +<li><a class="reference internal" href="column_create.html"><em>column_create</em></a></li> +</ul> +</div></blockquote> +</div> +</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.3.43. <code class="docutils literal"><span class="pre">schema</span></code></a><ul> +<li><a class="reference internal" href="#summary">7.3.43.1. Summary</a></li> +<li><a class="reference internal" href="#syntax">7.3.43.2. Syntax</a></li> +<li><a class="reference internal" href="#usage">7.3.43.3. Usage</a></li> +<li><a class="reference internal" href="#return-value">7.3.43.4. Return value</a><ul> +<li><a class="reference internal" href="#header">7.3.43.4.1. <code class="docutils literal"><span class="pre">HEADER</span></code></a></li> +<li><a class="reference internal" href="#id1">7.3.43.4.2. <code class="docutils literal"><span class="pre">SCHEMA</span></code></a></li> +<li><a class="reference internal" href="#plugins">7.3.43.4.3. <code class="docutils literal"><span class="pre">PLUGINS</span></code></a></li> +<li><a class="reference internal" href="#plugin">7.3.43.4.4. <code class="docutils literal"><span class="pre">PLUGIN</span></code></a></li> +<li><a class="reference internal" href="#types">7.3.43.4.5. <code class="docutils literal"><span class="pre">TYPES</span></code></a></li> +<li><a class="reference internal" href="#type">7.3.43.4.6. <code class="docutils literal"><span class="pre">TYPE</span></code></a></li> +<li><a class="reference internal" href="#tokenizers">7.3.43.4.7. <code class="docutils literal"><span class="pre">TOKENIZERS</span></code></a></li> +<li><a class="reference internal" href="#tokenizer">7.3.43.4.8. <code class="docutils literal"><span class="pre">TOKENIZER</span></code></a></li> +<li><a class="reference internal" href="#normalizers">7.3.43.4.9. <code class="docutils literal"><span class="pre">NORMALIZERS</span></code></a></li> +<li><a class="reference internal" href="#normalizer">7.3.43.4.10. <code class="docutils literal"><span class="pre">NORMALIZER</span></code></a></li> +<li><a class="reference internal" href="#token-filters">7.3.43.4.11. <code class="docutils literal"><span class="pre">TOKEN_FILTERS</span></code></a></li> +<li><a class="reference internal" href="#token-filter">7.3.43.4.12. <code class="docutils literal"><span class="pre">TOKEN_FILTER</span></code></a></li> +<li><a class="reference internal" href="#tables">7.3.43.4.13. <code class="docutils literal"><span class="pre">TABLES</span></code></a></li> +<li><a class="reference internal" href="#table">7.3.43.4.14. <code class="docutils literal"><span class="pre">TABLE</span></code></a></li> +<li><a class="reference internal" href="#index">7.3.43.4.15. <code class="docutils literal"><span class="pre">INDEX</span></code></a></li> +<li><a class="reference internal" href="#command">7.3.43.4.16. <code class="docutils literal"><span class="pre">COMMAND</span></code></a></li> +<li><a class="reference internal" href="#column">7.3.43.4.17. <code class="docutils literal"><span class="pre">COLUMN</span></code></a></li> +<li><a class="reference internal" href="#source">7.3.43.4.18. <code class="docutils literal"><span class="pre">SOURCE</span></code></a></li> +</ul> +</li> +<li><a class="reference internal" href="#see-also">7.3.43.5. See also</a></li> +</ul> +</li> +</ul> + + <h4>Previous topic</h4> + <p class="topless"><a href="ruby_load.html" + title="previous chapter">7.3.42. <code class="docutils literal"><span class="pre">ruby_load</span></code></a></p> + <h4>Next topic</h4> + <p class="topless"><a href="select.html" + title="next chapter">7.3.44. <code class="docutils literal"><span class="pre">select</span></code></a></p> + <div role="note" aria-label="source link"> + <h3>This Page</h3> + <ul class="this-page-menu"> + <li><a href="../../sources/reference/commands/schema.txt" + rel="nofollow">Show Source</a></li> + </ul> + </div> +<div id="searchbox" style="display: none" role="search"> + <h3>Quick search</h3> + <form class="search" action="../../search.html" method="get"> + <input type="text" name="q" /> + <input type="submit" value="Go" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> + <p class="searchtip" style="font-size: 90%"> + Enter search terms or a module, class or function name. + </p> +</div> +<script type="text/javascript">$('#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="select.html" title="7.3.44. select" + >next</a> |</li> + <li class="right" > + <a href="ruby_load.html" title="7.3.42. ruby_load" + >previous</a> |</li> + <li class="nav-item nav-item-0"><a href="../../index.html">Groonga v5.1.1 documentation</a> »</li> + <li class="nav-item nav-item-1"><a href="../../reference.html" >7. Reference manual</a> »</li> + <li class="nav-item nav-item-2"><a href="../command.html" >7.3. Command</a> »</li> + </ul> + </div> + <div class="footer" role="contentinfo"> + © Copyright 2009-2016, Brazil, Inc. + </div> + <script src="http://connect.facebook.net/en_US/all.js"></script> + + <script> + FB.init({ + appId : null, + status : true, // check login status + cookie : true, // enable cookies to allow the server to access the session + xfbml : true // parse XFBML + }); + </script> + </body> + +</html> \ No newline at end of file Added: docs/sources/reference/commands/schema.txt (+612 -0) 100644 =================================================================== --- /dev/null +++ docs/sources/reference/commands/schema.txt 2016-01-18 19:09:44 +0900 (3e50349) @@ -0,0 +1,612 @@ +.. -*- rst -*- + +.. highlightlang:: none + +.. groonga-command +.. database: schema + +``schema`` +========== + +Summary +------- + +.. versionadded:: 5.0.9 + +``schema`` command returns schema in the database. + +This command is useful when you want to inspect the database. For +example, visualizing the database, creating GUI for the database and +so on. + +Syntax +------ + +This command takes no parameters:: + + schema + +Usage +----- + +Here is an example schema to show example output: + +.. groonga-command +.. include:: ../../example/reference/commands/schema/sample.log +.. table_create Memos TABLE_HASH_KEY ShortText +.. column_create Memos content COLUMN_SCALAR Text +.. +.. table_create Terms TABLE_PAT_KEY ShortText \ +.. --default_tokenizer TokenBigram \ +.. --normalizer NormalizerAuto +.. column_create Terms memos_content_index \ +.. COLUMN_INDEX|WITH_POSITION \ +.. Memos content + +Here is an output of ``schema`` command against this example schema: + +.. groonga-command +.. include:: ../../example/reference/commands/schema/output.log +.. schema + +Return value +------------ + +``schema`` command returns schema in the database:: + + [HEADER, SCHEMA] + +``HEADER`` +^^^^^^^^^^ + +See :doc:`/reference/command/output_format` about ``HEADER``. + +``SCHEMA`` +^^^^^^^^^^ + +``SCHEMA`` is an object that consists of the following information:: + + { + "plugins": PLUGINS, + "types": TYPES, + "tokenizers": TOKENIZERS, + "normalizers": NORMALIZERS, + "token_filters": TOKEN_FITLERS, + "tables": TABLES + } + +``PLUGINS`` +^^^^^^^^^^^ + +``PLUGINS`` is an object. Its key is plugin name and its value is +plugin detail:: + + { + "PLUGIN_NAME_1": PLUGIN_1, + "PLUGIN_NAME_2": PLUGIN_2, + ... + "PLUGIN_NAME_n": PLUGIN_n + } + +``PLUGIN`` +^^^^^^^^^^ + +``PLUGIN`` is an object that describes plugin detail:: + + { + "name": PLUGIN_NAME + } + +Here are properties of ``PLUGIN``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The plugin name. It's used in :doc:`plugin_register`. + +``TYPES`` +^^^^^^^^^ + +``TYPES`` is an object. Its key is type name and its value is +type detail:: + + { + "TYPE_NAME_1": TYPE_1, + "TYPE_NAME_2": TYPE_2, + ... + "TYPE_NAME_n": TYPE_n + } + +``TYPE`` +^^^^^^^^ + +``TYPE`` is an object that describes type detail:: + + { + "name": TYPE_NAME, + "size": SIZE_OF_ONE_VALUE_IN_BYTE, + "can_be_key_type": BOOLEAN, + "can_be_value_type": BOOLEAN + } + +Here are properties of ``TYPE``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The type name. + * - ``size`` + - The number of bytes of one value. + * - ``can_be_key_type`` + - ``true`` when the type can be used for table key, ``false`` + otherwise. + * - ``can_be_value_type`` + - ``true`` when the type can be used for table value, ``false`` + otherwise. + +``TOKENIZERS`` +^^^^^^^^^^^^^^ + +``TOKENIZERS`` is an object. Its key is tokenizer name and its value +is tokenizer detail:: + + { + "TOKENIZER_NAME_1": TOKENIZER_1, + "TOKENIZER_NAME_2": TOKENIZER_2, + ... + "TOKENIZER_NAME_n": TOKENIZER_n + } + +``TOKENIZER`` +^^^^^^^^^^^^^ + +``TOKENIZER`` is an object that describes tokenizer detail:: + + { + "name": TOKENIZER_NAME + } + +Here are properties of ``TOKENIZER``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The tokenizer name. It's used for + :ref:`table-create-default-tokenizer`. + +``NORMALIZERS`` +^^^^^^^^^^^^^^^ + +``NORMALIZERS`` is an object. Its key is normalizer name and its value +is normalizer detail:: + + { + "NORMALIZER_NAME_1": NORMALIZER_1, + "NORMALIZER_NAME_2": NORMALIZER_2, + ... + "NORMALIZER_NAME_n": NORMALIZER_n + } + +``NORMALIZER`` +^^^^^^^^^^^^^^ + +``NORMALIZER`` is an object that describes normalizer detail:: + + { + "name": NORMALIZER_NAME + } + +Here are properties of ``NORMALIZER``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The normalizer name. It's used for + :ref:`table-create-normalizer`. + +``TOKEN_FILTERS`` +^^^^^^^^^^^^^^^^^ + +``TOKEN_FILTERS`` is an object. Its key is token filter name and its value +is token filter detail:: + + { + "TOKEN_FILTER_NAME_1": TOKEN_FILTER_1, + "TOKEN_FILTER_NAME_2": TOKEN_FILTER_2, + ... + "TOKEN_FILTER_NAME_n": TOKEN_FILTER_n + } + +``TOKEN_FILTER`` +^^^^^^^^^^^^^^^^ + +``TOKEN_FILTER`` is an object that describes token filter detail:: + + { + "name": TOKEN_FILTER_NAME + } + +Here are properties of ``TOKEN_FILTER``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The token filter name. It's used for + :ref:`table-create-token-filters`. + +``TABLES`` +^^^^^^^^^^ + +``TABLES`` is an object. Its key is table name and its value +is table detail:: + + { + "TABLE_NAME_1": TABLE_1, + "TABLE_NAME_2": TABLE_2, + ... + "TABLE_NAME_n": TABLE_n + } + +``TABLE`` +^^^^^^^^^ + +``TABLE`` is an object that describes table detail:: + + { + "name": TABLE_NAME + "type": TYPE, + "key_type": KEY_TYPE, + "value_type": VALUE_TYPE, + "tokenizer": TOKENIZER, + "normalizer": NORMALIZER, + "token_filters": [ + TOKEN_FILTER_1, + TOKEN_FILTER_2, + ..., + TOKEN_FILTER_n, + ], + "indexes": [ + INDEX_1, + INDEX_2, + ..., + INDEX_n + ], + "command": COMMAND, + "columns": { + "COLUMN_NAME_1": COLUMN_1, + "COLUMN_NAME_2": COLUMN_2, + ..., + "COLUMN_NAME_3": COLUMN_3, + } + } + +Here are properties of ``TABLE``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The table name. + * - ``type`` + - The table type. + + This is one of the followings: + + * ``array``: :ref:`table-no-key` + * ``hash``: :ref:`table-hash-key` + * ``patricia trie``: :ref:`table-pat-key` + * ``double array trie``: :ref:`table-dat-key` + * - ``key_type`` + - The type of the table's key. + + If the table type is ``array``, this is ``null``. + + If the table type isn't ``array``, this is an object + that has the following properties: + + * ``name``: The type name. + * ``type``: ``reference`` if the type is an table, ``type`` + otherwise. + * - ``value_type`` + - The type of the table's value. + + If the table doesn't use value, this is ``null``. + + If the table uses value, this is an object that has the + following properties: + + * ``name``: The type name. + * ``type``: ``reference`` if the type is an table, ``type`` + otherwise. + * - ``tokenizer`` + - The tokenizer of the table. It's specified by + :ref:`table-create-default-tokenizer`. + + If the table doesn't use tokenizer, this is ``null``. + + If the table uses tokenizer, this is an object that has the + following properties: + + * ``name``: The tokenizer name. + * - ``normalizer`` + - The normalizer of the table. It's specified by + :ref:`table-create-normalizer`. + + If the table doesn't use normalizer, this is ``null``. + + If the table uses normalizer, this is an object that has the + following properties: + + * ``name``: The normalizer name. + * - ``token_filters`` + - The token filters of the table. It's specified by + :ref:`table-create-token-filters`. + + This is an array of an object. The object has the following + properties: + + * ``name``: The token filter name. + * - ``indexes`` + - The indexes of the table's key. + + This is an array of :ref:`schema-return-value-index`. + * - ``command`` + - The Groonga command information to create the table. + + This is :ref:`schema-return-value-command`. + * - ``columns`` + - The columns of the table. + + This is an object that its key is a column name and its value + is :ref:`schema-return-value-column`. + +.. _schema-return-value-index: + +``INDEX`` +^^^^^^^^^ + +``INDEX`` is an object that describes index detail:: + + { + "full_name": INDEX_COLUMN_NAME_WITH_TABLE_NAME, + "table": TABLE_NAME, + "name": INDEX_COLUMN_NAME, + "section": SECTION + } + +Here are properties of ``INDEX``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``full_name`` + - The index column name with table name. + + For example, ``Terms.index``. + * - ``table`` + - The table name of the index column. + + For example, ``Terms``. + * - ``name`` + - The index column name. + + For example, ``index``. + * - ``section`` + - The section number in the index column for the table's key. + + If the index column isn't multiple column index, this is ``0``. + +.. _schema-return-value-command: + +``COMMAND`` +^^^^^^^^^^^ + +``COMMAND`` is an object that describes how to create the table or +column:: + + { + "name": COMMAND_NAME, + "arguments": { + "KEY_1": "VALUE_1", + "KEY_2": "VALUE_2", + ..., + "KEY_n": "VALUE_n" + }, + "command_line": COMMAND_LINE + } + +Here are properties of ``COMMAND``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The Groonga command name to create the table or column. + * - ``arguments`` + - The arguments of the Groonga command to create the + table or column. + + This is an object that its key is argument name and its value + is argument value. + * - ``command_line`` + - The Groonga command line to create the table or column. + + This is a string that can be evaluated by Groonga. + +.. _schema-return-value-column: + +``COLUMN`` +^^^^^^^^^^ + +``COLUMN`` is an object that describes column detail:: + + { + "name": COLUMN_NAME, + "table": TABLE_NAME, + "full_name": COLUMN_NAME_WITH_TABLE, + "type": TYPE, + "value_type": VALUE_TYPE, + "compress": COMPRESS, + "section": SECTION, + "weight": WEIGHT, + "compress": COMPRESS, + "section": BOOLEAN, + "weight": BOOLEAN, + "position": BOOLEAN, + "sources": [ + SOURCE_1, + SOURCE_2, + ..., + SOURCE_n + ], + "indexes": [ + INDEX_1, + INDEX_2, + ..., + INDEX_n + ], + "command": COMMAND + } + +Here are properties of ``COLUMN``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The column name. + + For example, ``age``. + * - ``table`` + - The table name of the column. + + For example, ``Users``. + * - ``full_name`` + - The column name with table name. + + For example, ``Users.age``. + * - ``type`` + - The column type. + + This is one of the followings: + + * ``scalar``: :doc:`/reference/columns/scalar` + * ``vector``: :doc:`/reference/columns/vector` + * ``index``: :doc:`/reference/columns/index` + * - ``value_type`` + - The type of the column's value. + + This is an object that has the following properties: + + * ``name``: The type name. + * ``type``: ``reference`` if the type is an table, ``type`` + otherwise. + * - ``compress`` + - The compression method of the column. + + If the column doesn't use any compression methods, this is + ``null``. + + If the column uses a compression method, this is one of the + followings: + + * ``zlib``: The column uses zlib to compress column value. + * ``lz4``: The column uses LZ4 to compress column value. + * - ``section`` + - Whether the column can store section information or not. + + ``true`` if the column is created with ``WITH_SECTION`` flag, + ``false`` otherwise. + + Normally, if the column isn't an index column, this is ``false``. + * - ``weight`` + - Whether the column can store weight information or not. + + ``true`` if the column is created with ``WITH_WEIGHT`` flag, + ``false`` otherwise. + * - ``position`` + - Whether the column can store position information or not. + + ``true`` if the column is created with ``WITH_POSITION`` flag, + ``false`` otherwise. + + Normally, if the column isn't an index column, this is ``false``. + * - ``sources`` + - The source columns of the index column. + + This is an array of :ref:`schema-return-value-source`. + + Normally, if the column isn't an index column, this is an + empty array. + * - ``indexes`` + - The indexes of the column. + + This is an array of :ref:`schema-return-value-index`. + * - ``command`` + - The Groonga command information to create the column. + + This is :ref:`schema-return-value-command`. + +.. _schema-return-value-source: + +``SOURCE`` +^^^^^^^^^^ + +``SOURCE`` is an object that describes source detail:: + + { + "name": COLUMN_NAME, + "table": TABLE_NAME, + "full_name": COLUMN_NAME_WITH_TABLE_NAME + } + +Here are properties of ``SOURCE``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The source column name. + + For example, ``content``. + + This may be a ``_key`` pseudo column. + * - ``table`` + - The table name of the source column. + + For example, ``Memos``. + * - ``full_name`` + - The source column name with table name. + + For example, ``Memos.content``. + +See also +-------- + + * :doc:`table_create` + * :doc:`column_create` Added: ja/docs/reference/commands/schema.html (+1203 -0) 100644 =================================================================== --- /dev/null +++ ja/docs/reference/commands/schema.html 2016-01-18 19:09:44 +0900 (c5386e6) @@ -0,0 +1,1203 @@ +<!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.3.43. schema — Groonga v5.1.1ドキュメント</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: '5.1.1', + 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 v5.1.1ドキュメント" href="../../index.html" /> + <link rel="up" title="7.3. コマンド" href="../command.html" /> + <link rel="next" title="7.3.44. select" href="select.html" /> + <link rel="prev" title="7.3.42. ruby_load" href="ruby_load.html" /> + <meta property="fb:page_id" content="201193596592346" /><!-- groonga --> + <meta property="fb:admins" content="664204556" /><!-- kouhei.sutou --> + <meta property="og:type" content="product" /> + <meta property="og:image" content="http://groonga.org/images/logos/groonga-icon-full-size.png" /> + <meta property="og:site_name" content="groonga" /> + + <link rel="stylesheet" href="/css/sphinx.css" type="text/css" /> + </head> + + <body role="document"> +<div class="header"> + <h1 class="title"> + <a id="top-link" href="../../../"> + <span class="project">groonga</span> + <span class="separator">-</span> + <span class="description">オープンソースのカラムストア機能付き全文検索エンジン</span> + </a> + </h1> + + <div class="facebook-buttons"> + <fb:like href="http://www.facebook.com/pages/groonga/201193596592346" + layout="standard" + width="290"></fb:like> + </div> + <div class="other-language-links"> + + <ul> + <li><a href="../../../../docs/reference/commands/schema.html">English</a></li> + </ul> + </div> +</div> + + + <div class="related" role="navigation" aria-label="related navigation"> + <h3>ナビゲーション</h3> + <ul> + <li class="right" style="margin-right: 10px"> + <a href="../../genindex.html" title="総合索引" + accesskey="I">索引</a></li> + <li class="right" > + <a href="select.html" title="7.3.44. select" + accesskey="N">次へ</a> |</li> + <li class="right" > + <a href="ruby_load.html" title="7.3.42. ruby_load" + accesskey="P">前へ</a> |</li> + <li class="nav-item nav-item-0"><a href="../../index.html">Groonga v5.1.1ドキュメント</a> »</li> + <li class="nav-item nav-item-1"><a href="../../reference.html" >7. リファレンスマニュアル</a> »</li> + <li class="nav-item nav-item-2"><a href="../command.html" accesskey="U">7.3. コマンド</a> »</li> + </ul> + </div> + + <div class="document"> + <div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body" role="main"> + + <div class="section" id="schema"> +<h1>7.3.43. <code class="docutils literal"><span class="pre">schema</span></code><a class="headerlink" href="#schema" title="このヘッドラインへのパーマリンク">¶</a></h1> +<div class="section" id="summary"> +<h2>7.3.43.1. 概要<a class="headerlink" href="#summary" title="このヘッドラインへのパーマリンク">¶</a></h2> +<div class="versionadded"> +<p><span class="versionmodified">バージョン 5.0.9 で追加.</span></p> +</div> +<p><code class="docutils literal"><span class="pre">schema</span></code> コマンドはデータベース内のスキーマを返します。</p> +<p>このコマンドはデータベースの詳細を知りたいときに便利です。たとえば、データベースを視覚化したり、データベースのGUIを作ったりするときに便利です。</p> +</div> +<div class="section" id="syntax"> +<h2>7.3.43.2. 構文<a class="headerlink" href="#syntax" title="このヘッドラインへのパーマリンク">¶</a></h2> +<p>このコマンドに引数はありません:</p> +<div class="highlight-none"><div class="highlight"><pre>schema +</pre></div> +</div> +</div> +<div class="section" id="usage"> +<h2>7.3.43.3. 使い方<a class="headerlink" href="#usage" title="このヘッドラインへのパーマリンク">¶</a></h2> +<p>以下は出力例を示すためのサンプルスキーマです。</p> +<p>実行例:</p> +<div class="highlight-none"><div class="highlight"><pre>table_create Memos TABLE_HASH_KEY ShortText +# [[0, 1337566253.89858, 0.000355720520019531], true] +column_create Memos content COLUMN_SCALAR Text +# [[0, 1337566253.89858, 0.000355720520019531], true] +table_create Terms TABLE_PAT_KEY ShortText \ + --default_tokenizer TokenBigram \ + --normalizer NormalizerAuto +# [[0, 1337566253.89858, 0.000355720520019531], true] +column_create Terms memos_content_index \ + COLUMN_INDEX|WITH_POSITION \ + Memos content +# [[0, 1337566253.89858, 0.000355720520019531], true] +</pre></div> +</div> +<p>このサンプルスキーマに対する <code class="docutils literal"><span class="pre">schema</span></code> コマンドの出力は次の通りです。</p> +<p>実行例:</p> +<div class="highlight-none"><div class="highlight"><pre>schema +# [ +# [ +# 0, +# 1337566253.89858, +# 0.000355720520019531 +# ], +# { +# "tables": { +# "Terms": { +# "normalizer": { +# "name": "NormalizerAuto" +# }, +# "name": "Terms", +# "tokenizer": { +# "name": "TokenBigram" +# }, +# "command": { +# "command_line": "table_create --name Terms --flags TABLE_PAT_KEY --key_type ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto", +# "name": "table_create", +# "arguments": { +# "key_type": "ShortText", +# "default_tokenizer": "TokenBigram", +# "normalizer": "NormalizerAuto", +# "flags": "TABLE_PAT_KEY", +# "name": "Terms" +# } +# }, +# "indexes": [], +# "key_type": { +# "type": "type", +# "name": "ShortText" +# }, +# "value_type": null, +# "token_filters": [], +# "type": "patricia trie", +# "columns": { +# "memos_content_index": { +# "name": "memos_content_index", +# "weight": false, +# "section": false, +# "compress": null, +# "command": { +# "command_line": "column_create --table Terms --name memos_content_index --flags COLUMN_INDEX|WITH_POSITION --type Memos --sources content", +# "name": "column_create", +# "arguments": { +# "table": "Terms", +# "flags": "COLUMN_INDEX|WITH_POSITION", +# "name": "memos_content_index", +# "sources": "content", +# "type": "Memos" +# } +# }, +# "indexes": [], +# "sources": [ +# { +# "table": "Memos", +# "name": "content", +# "full_name": "Memos.content" +# } +# ], +# "value_type": { +# "type": "reference", +# "name": "Memos" +# }, +# "full_name": "Terms.memos_content_index", +# "position": true, +# "table": "Terms", +# "type": "index" +# } +# } +# }, +# "Memos": { +# "normalizer": null, +# "name": "Memos", +# "tokenizer": null, +# "command": { +# "command_line": "table_create --name Memos --flags TABLE_HASH_KEY --key_type ShortText", +# "name": "table_create", +# "arguments": { +# "key_type": "ShortText", +# "flags": "TABLE_HASH_KEY", +# "name": "Memos" +# } +# }, +# "indexes": [], +# "key_type": { +# "type": "type", +# "name": "ShortText" +# }, +# "value_type": null, +# "token_filters": [], +# "type": "hash table", +# "columns": { +# "content": { +# "name": "content", +# "weight": false, +# "section": false, +# "compress": null, +# "command": { +# "command_line": "column_create --table Memos --name content --flags COLUMN_SCALAR --type Text", +# "name": "column_create", +# "arguments": { +# "table": "Memos", +# "flags": "COLUMN_SCALAR", +# "name": "content", +# "type": "Text" +# } +# }, +# "indexes": [ +# { +# "table": "Terms", +# "section": 0, +# "name": "memos_content_index", +# "full_name": "Terms.memos_content_index" +# } +# ], +# "sources": [], +# "value_type": { +# "type": "type", +# "name": "Text" +# }, +# "full_name": "Memos.content", +# "position": false, +# "table": "Memos", +# "type": "scalar" +# } +# } +# } +# }, +# "normalizers": { +# "NormalizerNFKC51": { +# "name": "NormalizerNFKC51" +# }, +# "NormalizerAuto": { +# "name": "NormalizerAuto" +# } +# }, +# "token_filters": {}, +# "tokenizers": { +# "TokenBigramSplitSymbolAlphaDigit": { +# "name": "TokenBigramSplitSymbolAlphaDigit" +# }, +# "TokenRegexp": { +# "name": "TokenRegexp" +# }, +# "TokenBigramIgnoreBlankSplitSymbolAlphaDigit": { +# "name": "TokenBigramIgnoreBlankSplitSymbolAlphaDigit" +# }, +# "TokenBigram": { +# "name": "TokenBigram" +# }, +# "TokenDelimit": { +# "name": "TokenDelimit" +# }, +# "TokenUnigram": { +# "name": "TokenUnigram" +# }, +# "TokenBigramSplitSymbol": { +# "name": "TokenBigramSplitSymbol" +# }, +# "TokenDelimitNull": { +# "name": "TokenDelimitNull" +# }, +# "TokenBigramIgnoreBlankSplitSymbolAlpha": { +# "name": "TokenBigramIgnoreBlankSplitSymbolAlpha" +# }, +# "TokenBigramSplitSymbolAlpha": { +# "name": "TokenBigramSplitSymbolAlpha" +# }, +# "TokenTrigram": { +# "name": "TokenTrigram" +# }, +# "TokenMecab": { +# "name": "TokenMecab" +# }, +# "TokenBigramIgnoreBlankSplitSymbol": { +# "name": "TokenBigramIgnoreBlankSplitSymbol" +# }, +# "TokenBigramIgnoreBlank": { +# "name": "TokenBigramIgnoreBlank" +# } +# }, +# "plugins": {}, +# "types": { +# "UInt64": { +# "can_be_key_type": true, +# "name": "UInt64", +# "can_be_value_type": true, +# "size": 8 +# }, +# "Int32": { +# "can_be_key_type": true, +# "name": "Int32", +# "can_be_value_type": true, +# "size": 4 +# }, +# "Int16": { +# "can_be_key_type": true, +# "name": "Int16", +# "can_be_value_type": true, +# "size": 2 +# }, +# "LongText": { +# "can_be_key_type": false, +# "name": "LongText", +# "can_be_value_type": false, +# "size": 2147483648 +# }, +# "TokyoGeoPoint": { +# "can_be_key_type": true, +# "name": "TokyoGeoPoint", +# "can_be_value_type": true, +# "size": 8 +# }, +# "Text": { +# "can_be_key_type": false, +# "name": "Text", +# "can_be_value_type": false, +# "size": 65536 +# }, +# "ShortText": { +# "can_be_key_type": true, +# "name": "ShortText", +# "can_be_value_type": false, +# "size": 4096 +# }, +# "Float": { +# "can_be_key_type": true, +# "name": "Float", +# "can_be_value_type": true, +# "size": 8 +# }, +# "UInt8": { +# "can_be_key_type": true, +# "name": "UInt8", +# "can_be_value_type": true, +# "size": 1 +# }, +# "UInt32": { +# "can_be_key_type": true, +# "name": "UInt32", +# "can_be_value_type": true, +# "size": 4 +# }, +# "Object": { +# "can_be_key_type": true, +# "name": "Object", +# "can_be_value_type": true, +# "size": 8 +# }, +# "UInt16": { +# "can_be_key_type": true, +# "name": "UInt16", +# "can_be_value_type": true, +# "size": 2 +# }, +# "Int64": { +# "can_be_key_type": true, +# "name": "Int64", +# "can_be_value_type": true, +# "size": 8 +# }, +# "Time": { +# "can_be_key_type": true, +# "name": "Time", +# "can_be_value_type": true, +# "size": 8 +# }, +# "Bool": { +# "can_be_key_type": true, +# "name": "Bool", +# "can_be_value_type": true, +# "size": 1 +# }, +# "WGS84GeoPoint": { +# "can_be_key_type": true, +# "name": "WGS84GeoPoint", +# "can_be_value_type": true, +# "size": 8 +# }, +# "Int8": { +# "can_be_key_type": true, +# "name": "Int8", +# "can_be_value_type": true, +# "size": 1 +# } +# } +# } +# ] +</pre></div> +</div> +</div> +<div class="section" id="return-value"> +<h2>7.3.43.4. 戻り値<a class="headerlink" href="#return-value" title="このヘッドラインへのパーマリンク">¶</a></h2> +<p><code class="docutils literal"><span class="pre">schema</span></code> はこのデータベースのスキーマを返します。:</p> +<div class="highlight-none"><div class="highlight"><pre>[HEADER, SCHEMA] +</pre></div> +</div> +<div class="section" id="header"> +<h3>7.3.43.4.1. <code class="docutils literal"><span class="pre">HEADER</span></code><a class="headerlink" href="#header" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">HEADER</span></code> については <a class="reference internal" href="../command/output_format.html"><em>出力形式</em></a> を参照してください。</p> +</div> +<div class="section" id="id1"> +<h3>7.3.43.4.2. <code class="docutils literal"><span class="pre">SCHEMA</span></code><a class="headerlink" href="#id1" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">SCHEMA</span></code> は以下の情報を含んだオブジェクトです。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "plugins": PLUGINS, + "types": TYPES, + "tokenizers": TOKENIZERS, + "normalizers": NORMALIZERS, + "token_filters": TOKEN_FITLERS, + "tables": TABLES +} +</pre></div> +</div> +</div> +<div class="section" id="plugins"> +<h3>7.3.43.4.3. <code class="docutils literal"><span class="pre">PLUGINS</span></code><a class="headerlink" href="#plugins" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">PLUGINS</span></code> はオブジェクトです。キーはプラグイン名で値はプラグインの詳細です。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "PLUGIN_NAME_1": PLUGIN_1, + "PLUGIN_NAME_2": PLUGIN_2, + ... + "PLUGIN_NAME_n": PLUGIN_n +} +</pre></div> +</div> +</div> +<div class="section" id="plugin"> +<h3>7.3.43.4.4. <code class="docutils literal"><span class="pre">PLUGIN</span></code><a class="headerlink" href="#plugin" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">PLUGIN</span></code> はプラグインの詳細を示すオブジェクトです。</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": PLUGIN_NAME +} +</pre></div> +</div> +<p>以下は <code class="docutils literal"><span class="pre">PLUGIN</span></code> のプロパティです。</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head"><p class="first last">名前</p> +</th> +<th class="head"><p class="first last">説明</p> +</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first last">プラグイン名。 <a class="reference internal" href="plugin_register.html"><em>plugin_register</em></a> で使います。</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="types"> +<h3>7.3.43.4.5. <code class="docutils literal"><span class="pre">TYPES</span></code><a class="headerlink" href="#types" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TYPES</span></code> はオブジェクトです。キーは型名で、値は型の詳細です。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "TYPE_NAME_1": TYPE_1, + "TYPE_NAME_2": TYPE_2, + ... + "TYPE_NAME_n": TYPE_n +} +</pre></div> +</div> +</div> +<div class="section" id="type"> +<h3>7.3.43.4.6. <code class="docutils literal"><span class="pre">TYPE</span></code><a class="headerlink" href="#type" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TYPE</span></code> は型の詳細を示すオブジェクトです。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": TYPE_NAME, + "size": SIZE_OF_ONE_VALUE_IN_BYTE, + "can_be_key_type": BOOLEAN, + "can_be_value_type": BOOLEAN +} +</pre></div> +</div> +<p>以下は <code class="docutils literal"><span class="pre">TYPE</span></code> のプロパティです。</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head"><p class="first last">名前</p> +</th> +<th class="head"><p class="first last">説明</p> +</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first last">型名。</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">size</span></code></td> +<td><p class="first last">1つの値のバイト数です。</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">can_be_key_type</span></code></td> +<td><p class="first last">この型をテーブルのキーの型に使えるなら <code class="docutils literal"><span class="pre">true</span></code> 、そうでないなら <code class="docutils literal"><span class="pre">false</span></code> 。</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">can_be_value_type</span></code></td> +<td><p class="first last">この型をテーブルの値の型に使えるなら <code class="docutils literal"><span class="pre">true</span></code> 、そうでないなら <code class="docutils literal"><span class="pre">false</span></code> 。</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="tokenizers"> +<h3>7.3.43.4.7. <code class="docutils literal"><span class="pre">TOKENIZERS</span></code><a class="headerlink" href="#tokenizers" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TOKENIZERS</span></code> はオブジェクトです。キーはトークナイザー名で値はトークナイザーの詳細です。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "TOKENIZER_NAME_1": TOKENIZER_1, + "TOKENIZER_NAME_2": TOKENIZER_2, + ... + "TOKENIZER_NAME_n": TOKENIZER_n +} +</pre></div> +</div> +</div> +<div class="section" id="tokenizer"> +<h3>7.3.43.4.8. <code class="docutils literal"><span class="pre">TOKENIZER</span></code><a class="headerlink" href="#tokenizer" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TOKENIZER</span></code> はトークナイザーの詳細を示すオブジェクトです。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": TOKENIZER_NAME +} +</pre></div> +</div> +<p>以下は <code class="docutils literal"><span class="pre">TOKENIZER</span></code> のプロパティです。</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head"><p class="first last">名前</p> +</th> +<th class="head"><p class="first last">説明</p> +</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first last">トークナイザー名。 <a class="reference internal" href="table_create.html#table-create-default-tokenizer"><span>default_tokenizer</span></a> で使います。</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="normalizers"> +<h3>7.3.43.4.9. <code class="docutils literal"><span class="pre">NORMALIZERS</span></code><a class="headerlink" href="#normalizers" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">NORMALIZERS</span></code> はオブジェクトです。キーはノーマライザー名で値はノーマライザーの詳細です。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "NORMALIZER_NAME_1": NORMALIZER_1, + "NORMALIZER_NAME_2": NORMALIZER_2, + ... + "NORMALIZER_NAME_n": NORMALIZER_n +} +</pre></div> +</div> +</div> +<div class="section" id="normalizer"> +<h3>7.3.43.4.10. <code class="docutils literal"><span class="pre">NORMALIZER</span></code><a class="headerlink" href="#normalizer" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">NORMALIZER</span></code> はノーマライザーの詳細を示すオブジェクトです。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": NORMALIZER_NAME +} +</pre></div> +</div> +<p>以下は <code class="docutils literal"><span class="pre">NORMALIZER</span></code> のプロパティです。</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head"><p class="first last">名前</p> +</th> +<th class="head"><p class="first last">説明</p> +</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first last">ノーマライザー名。 <a class="reference internal" href="table_create.html#table-create-normalizer"><span>normalizer</span></a> で使います。</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="token-filters"> +<h3>7.3.43.4.11. <code class="docutils literal"><span class="pre">TOKEN_FILTERS</span></code><a class="headerlink" href="#token-filters" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TOKEN_FILTERS</span></code> はオブジェクトです。キーはトークンフィルター名で値はトークンフィルターの詳細です。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "TOKEN_FILTER_NAME_1": TOKEN_FILTER_1, + "TOKEN_FILTER_NAME_2": TOKEN_FILTER_2, + ... + "TOKEN_FILTER_NAME_n": TOKEN_FILTER_n +} +</pre></div> +</div> +</div> +<div class="section" id="token-filter"> +<h3>7.3.43.4.12. <code class="docutils literal"><span class="pre">TOKEN_FILTER</span></code><a class="headerlink" href="#token-filter" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TOKEN_FILTER</span></code> はトークンフィルターの詳細を示すオブジェクトです。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": TOKEN_FILTER_NAME +} +</pre></div> +</div> +<p>以下は <code class="docutils literal"><span class="pre">TOKEN_FILTER</span></code> のプロパティです。</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head"><p class="first last">名前</p> +</th> +<th class="head"><p class="first last">説明</p> +</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first last">トークンフィルター名。 <a class="reference internal" href="table_create.html#table-create-token-filters"><span>token_filters</span></a> で使います。</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="tables"> +<h3>7.3.43.4.13. <code class="docutils literal"><span class="pre">TABLES</span></code><a class="headerlink" href="#tables" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TABLES</span></code> はオブジェクトです。キーはテーブル名で値はテーブルの詳細です。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "TABLE_NAME_1": TABLE_1, + "TABLE_NAME_2": TABLE_2, + ... + "TABLE_NAME_n": TABLE_n +} +</pre></div> +</div> +</div> +<div class="section" id="table"> +<h3>7.3.43.4.14. <code class="docutils literal"><span class="pre">TABLE</span></code><a class="headerlink" href="#table" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">TABLE</span></code> はテーブルの詳細を示すオブジェクトです。</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": TABLE_NAME + "type": TYPE, + "key_type": KEY_TYPE, + "value_type": VALUE_TYPE, + "tokenizer": TOKENIZER, + "normalizer": NORMALIZER, + "token_filters": [ + TOKEN_FILTER_1, + TOKEN_FILTER_2, + ..., + TOKEN_FILTER_n, + ], + "indexes": [ + INDEX_1, + INDEX_2, + ..., + INDEX_n + ], + "command": COMMAND, + "columns": { + "COLUMN_NAME_1": COLUMN_1, + "COLUMN_NAME_2": COLUMN_2, + ..., + "COLUMN_NAME_3": COLUMN_3, + } +} +</pre></div> +</div> +<p>以下は <code class="docutils literal"><span class="pre">TABLE</span></code> のプロパティです。</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head"><p class="first last">名前</p> +</th> +<th class="head"><p class="first last">説明</p> +</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first last">テーブル名。</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">type</span></code></td> +<td><p class="first">テーブルの種類。</p> +<p>以下のどれかです。</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">array</span></code>: <a class="reference internal" href="../tables.html#table-no-key"><span>TABLE_NO_KEY</span></a></li> +<li><code class="docutils literal"><span class="pre">hash</span></code>: <a class="reference internal" href="../tables.html#table-hash-key"><span>TABLE_HASH_KEY</span></a></li> +<li><code class="docutils literal"><span class="pre">patricia</span> <span class="pre">trie</span></code>: <a class="reference internal" href="../tables.html#table-pat-key"><span>TABLE_PAT_KEY</span></a></li> +<li><code class="docutils literal"><span class="pre">double</span> <span class="pre">array</span> <span class="pre">trie</span></code>: <a class="reference internal" href="../tables.html#table-dat-key"><span>TABLE_DAT_KEY</span></a></li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">key_type</span></code></td> +<td><p class="first">テーブルのキーの型。</p> +<p>テーブルの種類が <code class="docutils literal"><span class="pre">array</span></code> なら <code class="docutils literal"><span class="pre">null</span></code> になります。</p> +<p>テーブルの種類が <code class="docutils literal"><span class="pre">array</span></code> でなければオブジェクトになります。オブジェクトは次のプロパティを持ちます。</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><p class="first"><code class="docutils literal"><span class="pre">name</span></code> :型名。</p> +</li> +<li><p class="first"><code class="docutils literal"><span class="pre">type</span></code> :もし型がテーブルなら <code class="docutils literal"><span class="pre">reference</span></code> 、そうでないなら <code class="docutils literal"><span class="pre">type</span></code> 。</p> +</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">value_type</span></code></td> +<td><p class="first">テーブルの値の型。</p> +<p>テーブルが「値」を使っていない場合は <code class="docutils literal"><span class="pre">null</span></code> になります。</p> +<p>テーブルが「値」を使っている場合はオブジェクトになります。オブジェクトは次のプロパティを持ちます。</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><p class="first"><code class="docutils literal"><span class="pre">name</span></code> :型名。</p> +</li> +<li><p class="first"><code class="docutils literal"><span class="pre">type</span></code> :もし型がテーブルなら <code class="docutils literal"><span class="pre">reference</span></code> 、そうでないなら <code class="docutils literal"><span class="pre">type</span></code> 。</p> +</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">tokenizer</span></code></td> +<td><p class="first">テーブルのトークナイザー。 <a class="reference internal" href="table_create.html#table-create-default-tokenizer"><span>default_tokenizer</span></a> で指定されたものです。</p> +<p>テーブルがトークナイザーを使っていない場合は <code class="docutils literal"><span class="pre">null</span></code> になります。</p> +<p>テーブルがトークナイザーを使っている場合はオブジェクトになります。オブジェクトは次のプロパティを持ちます。</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><p class="first"><code class="docutils literal"><span class="pre">name</span></code> :トークナイザー名。</p> +</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">normalizer</span></code></td> +<td><p class="first">テーブルのノーマライザー。 <a class="reference internal" href="table_create.html#table-create-normalizer"><span>normalizer</span></a> で指定されたものです。</p> +<p>テーブルがノーマライザーを使っていない場合は <code class="docutils literal"><span class="pre">null</span></code> になります。</p> +<p>テーブルがノーマライザーを使っている場合はオブジェクトになります。オブジェクトは次のプロパティを持ちます。</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><p class="first"><code class="docutils literal"><span class="pre">name</span></code> :ノーマライザー名。</p> +</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">token_filters</span></code></td> +<td><p class="first">テーブルのトークンフィルターです。 <a class="reference internal" href="table_create.html#table-create-token-filters"><span>token_filters</span></a> で指定されたものです。</p> +<p>オブジェクトの配列です。オブジェクトは次のプロパティを持ちます。</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><p class="first"><code class="docutils literal"><span class="pre">name</span></code> :トークンフィルター名。</p> +</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">indexes</span></code></td> +<td><p class="first">テーブルのキーに対するインデックス。</p> +<p class="last"><a class="reference internal" href="#schema-return-value-index"><span>INDEX</span></a> の配列です。</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">command</span></code></td> +<td><p class="first">このテーブルを作るためのGroongaコマンドに関する情報。</p> +<p class="last"><a class="reference internal" href="#schema-return-value-command"><span>COMMAND</span></a> になります。</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">columns</span></code></td> +<td><p class="first">テーブルのカラム。</p> +<p class="last">オブジェクトです。キーはカラム名で値は <a class="reference internal" href="#schema-return-value-column"><span>COLUMN</span></a> です。</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="index"> +<span id="schema-return-value-index"></span><h3>7.3.43.4.15. <code class="docutils literal"><span class="pre">INDEX</span></code><a class="headerlink" href="#index" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">INDEX</span></code> はインデックスの詳細を示すオブジェクトです。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "full_name": INDEX_COLUMN_NAME_WITH_TABLE_NAME, + "table": TABLE_NAME, + "name": INDEX_COLUMN_NAME, + "section": SECTION +} +</pre></div> +</div> +<p>以下は <code class="docutils literal"><span class="pre">INDEX</span></code> のプロパティです。</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head"><p class="first last">名前</p> +</th> +<th class="head"><p class="first last">説明</p> +</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">full_name</span></code></td> +<td><p class="first">テーブル名を含むインデックスカラム名。</p> +<p class="last">例: <code class="docutils literal"><span class="pre">Terms.index</span></code></p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">table</span></code></td> +<td><p class="first">インデックスカラムのテーブル名。</p> +<p class="last">例: <code class="docutils literal"><span class="pre">Terms</span></code></p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first">インデックスカラム名。</p> +<p class="last">例: <code class="docutils literal"><span class="pre">index</span></code></p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">section</span></code></td> +<td><p class="first">テーブルのキーに対するインデックスカラムのセクション番号。</p> +<p class="last">インデックスカラムがマルチカラムインデックスでない場合は <code class="docutils literal"><span class="pre">0</span></code> になります。</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="command"> +<span id="schema-return-value-command"></span><h3>7.3.43.4.16. <code class="docutils literal"><span class="pre">COMMAND</span></code><a class="headerlink" href="#command" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">COMMAND</span></code> はこのテーブル・カラムを作る方法を示したオブジェクトです。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": COMMAND_NAME, + "arguments": { + "KEY_1": "VALUE_1", + "KEY_2": "VALUE_2", + ..., + "KEY_n": "VALUE_n" + }, + "command_line": COMMAND_LINE +} +</pre></div> +</div> +<p>以下は <code class="docutils literal"><span class="pre">COMMAND</span></code> のプロパティです。</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head"><p class="first last">名前</p> +</th> +<th class="head"><p class="first last">説明</p> +</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first last">このテーブル・カラムを作るGroongaコマンドの名前。</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">arguments</span></code></td> +<td><p class="first">このテーブル・カラムを作るためのGroongaコマンドの引数。</p> +<p class="last">オブジェクトになります。キーは引数名で値は引数の値です。</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">command_line</span></code></td> +<td><p class="first">このテーブル・カラムを作るGroongaコマンドのコマンドラインです。</p> +<p class="last">この文字列はGroongaが評価できます。</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="column"> +<span id="schema-return-value-column"></span><h3>7.3.43.4.17. <code class="docutils literal"><span class="pre">COLUMN</span></code><a class="headerlink" href="#column" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">COLUMN</span></code> はカラムの詳細を示したオブジェクトです。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": COLUMN_NAME, + "table": TABLE_NAME, + "full_name": COLUMN_NAME_WITH_TABLE, + "type": TYPE, + "value_type": VALUE_TYPE, + "compress": COMPRESS, + "section": SECTION, + "weight": WEIGHT, + "compress": COMPRESS, + "section": BOOLEAN, + "weight": BOOLEAN, + "position": BOOLEAN, + "sources": [ + SOURCE_1, + SOURCE_2, + ..., + SOURCE_n + ], + "indexes": [ + INDEX_1, + INDEX_2, + ..., + INDEX_n + ], + "command": COMMAND +} +</pre></div> +</div> +<p>以下は <code class="docutils literal"><span class="pre">COLUMN</span></code> のプロパティです。</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head"><p class="first last">名前</p> +</th> +<th class="head"><p class="first last">説明</p> +</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first">カラム名。</p> +<p class="last">例: <code class="docutils literal"><span class="pre">age</span></code></p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">table</span></code></td> +<td><p class="first">カラムのテーブル名。</p> +<p class="last">例: <code class="docutils literal"><span class="pre">Users</span></code></p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">full_name</span></code></td> +<td><p class="first">テーブル名を含むカラム名。</p> +<p class="last">例: <code class="docutils literal"><span class="pre">Users.age</span></code></p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">type</span></code></td> +<td><p class="first">カラムの種類。</p> +<p>以下のどれかです。</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><code class="docutils literal"><span class="pre">scalar</span></code>: <a class="reference internal" href="../columns/scalar.html"><em>スカラーカラム</em></a></li> +<li><code class="docutils literal"><span class="pre">vector</span></code>: <a class="reference internal" href="../columns/vector.html"><em>ベクターカラム</em></a></li> +<li><code class="docutils literal"><span class="pre">index</span></code>: <a class="reference internal" href="../columns/index.html"><em>インデックスカラム</em></a></li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">value_type</span></code></td> +<td><p class="first">カラムの値の型。</p> +<p>オブジェクトです。このオブジェクトは次のプロパティを持ちます。</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><p class="first"><code class="docutils literal"><span class="pre">name</span></code> :型名。</p> +</li> +<li><p class="first"><code class="docutils literal"><span class="pre">type</span></code> :もし型がテーブルなら <code class="docutils literal"><span class="pre">reference</span></code> 、そうでないなら <code class="docutils literal"><span class="pre">type</span></code> 。</p> +</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">compress</span></code></td> +<td><p class="first">カラムの圧縮方法です。</p> +<p>カラムがどの圧縮方法も使っていない場合は <code class="docutils literal"><span class="pre">null</span></code> になります。</p> +<p>カラムが圧縮方法を使っている場合は次のどれかになります。</p> +<blockquote class="last"> +<div><ul class="simple"> +<li><p class="first"><code class="docutils literal"><span class="pre">zlib</span></code> :カラムの値を圧縮するためにzlibを使います。</p> +</li> +<li><p class="first"><code class="docutils literal"><span class="pre">lz4</span></code> :カラムの値を圧縮するためにLZ4を使います。</p> +</li> +</ul> +</div></blockquote> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">section</span></code></td> +<td><p class="first">カラムがセクション情報を保存できるかどうか。</p> +<p><code class="docutils literal"><span class="pre">WITH_SECTION</span></code> フラグ付きでカラムを作ったときは <code class="docutils literal"><span class="pre">true</span></code> 、そうでないときは <code class="docutils literal"><span class="pre">false</span></code> になります。</p> +<p class="last">通常、インデックスカラムでない場合は <code class="docutils literal"><span class="pre">false</span></code> になります。</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">weight</span></code></td> +<td><p class="first">カラムが重み情報を保存できるかどうか。</p> +<p class="last"><code class="docutils literal"><span class="pre">WITH_WEIGHT</span></code> フラグ付きでカラムを作ったときは <code class="docutils literal"><span class="pre">true</span></code> 、そうでないときは <code class="docutils literal"><span class="pre">false</span></code> になります。</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">position</span></code></td> +<td><p class="first">カラムが位置情報を保存できるかどうか。</p> +<p><code class="docutils literal"><span class="pre">WITH_POSITION</span></code> フラグ付きでカラムを作ったときは <code class="docutils literal"><span class="pre">true</span></code> 、そうでないときは <code class="docutils literal"><span class="pre">false</span></code> になります。</p> +<p class="last">通常、インデックスカラムでない場合は <code class="docutils literal"><span class="pre">false</span></code> になります。</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">sources</span></code></td> +<td><p class="first">インデックスカラムのソースカラム。</p> +<p><a class="reference internal" href="#schema-return-value-source"><span>SOURCE</span></a> の配列になります。</p> +<p class="last">通常、カラムがインデックスカラムでない場合は空配列になります。</p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">indexes</span></code></td> +<td><p class="first">カラムのインデックス。</p> +<p class="last"><a class="reference internal" href="#schema-return-value-index"><span>INDEX</span></a> の配列です。</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">command</span></code></td> +<td><p class="first">このカラムを作るためのGroongaコマンド情報。</p> +<p class="last"><a class="reference internal" href="#schema-return-value-command"><span>COMMAND</span></a> になります。</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section" id="source"> +<span id="schema-return-value-source"></span><h3>7.3.43.4.18. <code class="docutils literal"><span class="pre">SOURCE</span></code><a class="headerlink" href="#source" title="このヘッドラインへのパーマリンク">¶</a></h3> +<p><code class="docutils literal"><span class="pre">SOURCE</span></code> はソースの詳細を示すオブジェクトです。:</p> +<div class="highlight-none"><div class="highlight"><pre>{ + "name": COLUMN_NAME, + "table": TABLE_NAME, + "full_name": COLUMN_NAME_WITH_TABLE_NAME +} +</pre></div> +</div> +<p>以下は <code class="docutils literal"><span class="pre">SOURCE</span></code> のプロパティです。</p> +<table border="1" class="docutils"> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head"><p class="first last">名前</p> +</th> +<th class="head"><p class="first last">説明</p> +</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td> +<td><p class="first">ソースカラム名。</p> +<p>例: <code class="docutils literal"><span class="pre">content</span></code></p> +<p class="last"><code class="docutils literal"><span class="pre">_key</span></code> 擬似カラムに<なるかもしれません。</p> +</td> +</tr> +<tr class="row-odd"><td><code class="docutils literal"><span class="pre">table</span></code></td> +<td><p class="first">ソースカラムのテーブル名。</p> +<p class="last">例: <code class="docutils literal"><span class="pre">Memos</span></code></p> +</td> +</tr> +<tr class="row-even"><td><code class="docutils literal"><span class="pre">full_name</span></code></td> +<td><p class="first">テーブル名を含むソースカラム名。</p> +<p class="last">例: <code class="docutils literal"><span class="pre">Memos.content</span></code></p> +</td> +</tr> +</tbody> +</table> +</div> +</div> +<div class="section" id="see-also"> +<h2>7.3.43.5. 参考<a class="headerlink" href="#see-also" title="このヘッドラインへのパーマリンク">¶</a></h2> +<blockquote> +<div><ul class="simple"> +<li><a class="reference internal" href="table_create.html"><em>table_create</em></a></li> +<li><a class="reference internal" href="column_create.html"><em>column_create</em></a></li> +</ul> +</div></blockquote> +</div> +</div> + + + </div> + </div> + </div> + <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> + <div class="sphinxsidebarwrapper"> + <h3><a href="../../index.html">目次</a></h3> + <ul> +<li><a class="reference internal" href="#">7.3.43. <code class="docutils literal"><span class="pre">schema</span></code></a><ul> +<li><a class="reference internal" href="#summary">7.3.43.1. 概要</a></li> +<li><a class="reference internal" href="#syntax">7.3.43.2. 構文</a></li> +<li><a class="reference internal" href="#usage">7.3.43.3. 使い方</a></li> +<li><a class="reference internal" href="#return-value">7.3.43.4. 戻り値</a><ul> +<li><a class="reference internal" href="#header">7.3.43.4.1. <code class="docutils literal"><span class="pre">HEADER</span></code></a></li> +<li><a class="reference internal" href="#id1">7.3.43.4.2. <code class="docutils literal"><span class="pre">SCHEMA</span></code></a></li> +<li><a class="reference internal" href="#plugins">7.3.43.4.3. <code class="docutils literal"><span class="pre">PLUGINS</span></code></a></li> +<li><a class="reference internal" href="#plugin">7.3.43.4.4. <code class="docutils literal"><span class="pre">PLUGIN</span></code></a></li> +<li><a class="reference internal" href="#types">7.3.43.4.5. <code class="docutils literal"><span class="pre">TYPES</span></code></a></li> +<li><a class="reference internal" href="#type">7.3.43.4.6. <code class="docutils literal"><span class="pre">TYPE</span></code></a></li> +<li><a class="reference internal" href="#tokenizers">7.3.43.4.7. <code class="docutils literal"><span class="pre">TOKENIZERS</span></code></a></li> +<li><a class="reference internal" href="#tokenizer">7.3.43.4.8. <code class="docutils literal"><span class="pre">TOKENIZER</span></code></a></li> +<li><a class="reference internal" href="#normalizers">7.3.43.4.9. <code class="docutils literal"><span class="pre">NORMALIZERS</span></code></a></li> +<li><a class="reference internal" href="#normalizer">7.3.43.4.10. <code class="docutils literal"><span class="pre">NORMALIZER</span></code></a></li> +<li><a class="reference internal" href="#token-filters">7.3.43.4.11. <code class="docutils literal"><span class="pre">TOKEN_FILTERS</span></code></a></li> +<li><a class="reference internal" href="#token-filter">7.3.43.4.12. <code class="docutils literal"><span class="pre">TOKEN_FILTER</span></code></a></li> +<li><a class="reference internal" href="#tables">7.3.43.4.13. <code class="docutils literal"><span class="pre">TABLES</span></code></a></li> +<li><a class="reference internal" href="#table">7.3.43.4.14. <code class="docutils literal"><span class="pre">TABLE</span></code></a></li> +<li><a class="reference internal" href="#index">7.3.43.4.15. <code class="docutils literal"><span class="pre">INDEX</span></code></a></li> +<li><a class="reference internal" href="#command">7.3.43.4.16. <code class="docutils literal"><span class="pre">COMMAND</span></code></a></li> +<li><a class="reference internal" href="#column">7.3.43.4.17. <code class="docutils literal"><span class="pre">COLUMN</span></code></a></li> +<li><a class="reference internal" href="#source">7.3.43.4.18. <code class="docutils literal"><span class="pre">SOURCE</span></code></a></li> +</ul> +</li> +<li><a class="reference internal" href="#see-also">7.3.43.5. 参考</a></li> +</ul> +</li> +</ul> + + <h4>前のトピックへ</h4> + <p class="topless"><a href="ruby_load.html" + title="前の章へ">7.3.42. <code class="docutils literal"><span class="pre">ruby_load</span></code></a></p> + <h4>次のトピックへ</h4> + <p class="topless"><a href="select.html" + title="次の章へ">7.3.44. <code class="docutils literal"><span class="pre">select</span></code></a></p> + <div role="note" aria-label="source link"> + <h3>このページ</h3> + <ul class="this-page-menu"> + <li><a href="../../sources/reference/commands/schema.txt" + rel="nofollow">ソースコードを表示(英語)</a></li> + </ul> + </div> +<div id="searchbox" style="display: none" role="search"> + <h3>クイック検索</h3> + <form class="search" action="../../search.html" method="get"> + <input type="text" name="q" /> + <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" role="navigation" aria-label="related navigation"> + <h3>ナビゲーション</h3> + <ul> + <li class="right" style="margin-right: 10px"> + <a href="../../genindex.html" title="総合索引" + >索引</a></li> + <li class="right" > + <a href="select.html" title="7.3.44. select" + >次へ</a> |</li> + <li class="right" > + <a href="ruby_load.html" title="7.3.42. ruby_load" + >前へ</a> |</li> + <li class="nav-item nav-item-0"><a href="../../index.html">Groonga v5.1.1ドキュメント</a> »</li> + <li class="nav-item nav-item-1"><a href="../../reference.html" >7. リファレンスマニュアル</a> »</li> + <li class="nav-item nav-item-2"><a href="../command.html" >7.3. コマンド</a> »</li> + </ul> + </div> + <div class="footer" role="contentinfo"> + © Copyright 2009-2016, Brazil, Inc. + </div> + <script src="http://connect.facebook.net/ja_JP/all.js"></script> + + <script> + FB.init({ + appId : null, + status : true, // check login status + cookie : true, // enable cookies to allow the server to access the session + xfbml : true // parse XFBML + }); + </script> + </body> + +</html> \ No newline at end of file Added: ja/docs/sources/reference/commands/schema.txt (+612 -0) 100644 =================================================================== --- /dev/null +++ ja/docs/sources/reference/commands/schema.txt 2016-01-18 19:09:44 +0900 (3e50349) @@ -0,0 +1,612 @@ +.. -*- rst -*- + +.. highlightlang:: none + +.. groonga-command +.. database: schema + +``schema`` +========== + +Summary +------- + +.. versionadded:: 5.0.9 + +``schema`` command returns schema in the database. + +This command is useful when you want to inspect the database. For +example, visualizing the database, creating GUI for the database and +so on. + +Syntax +------ + +This command takes no parameters:: + + schema + +Usage +----- + +Here is an example schema to show example output: + +.. groonga-command +.. include:: ../../example/reference/commands/schema/sample.log +.. table_create Memos TABLE_HASH_KEY ShortText +.. column_create Memos content COLUMN_SCALAR Text +.. +.. table_create Terms TABLE_PAT_KEY ShortText \ +.. --default_tokenizer TokenBigram \ +.. --normalizer NormalizerAuto +.. column_create Terms memos_content_index \ +.. COLUMN_INDEX|WITH_POSITION \ +.. Memos content + +Here is an output of ``schema`` command against this example schema: + +.. groonga-command +.. include:: ../../example/reference/commands/schema/output.log +.. schema + +Return value +------------ + +``schema`` command returns schema in the database:: + + [HEADER, SCHEMA] + +``HEADER`` +^^^^^^^^^^ + +See :doc:`/reference/command/output_format` about ``HEADER``. + +``SCHEMA`` +^^^^^^^^^^ + +``SCHEMA`` is an object that consists of the following information:: + + { + "plugins": PLUGINS, + "types": TYPES, + "tokenizers": TOKENIZERS, + "normalizers": NORMALIZERS, + "token_filters": TOKEN_FITLERS, + "tables": TABLES + } + +``PLUGINS`` +^^^^^^^^^^^ + +``PLUGINS`` is an object. Its key is plugin name and its value is +plugin detail:: + + { + "PLUGIN_NAME_1": PLUGIN_1, + "PLUGIN_NAME_2": PLUGIN_2, + ... + "PLUGIN_NAME_n": PLUGIN_n + } + +``PLUGIN`` +^^^^^^^^^^ + +``PLUGIN`` is an object that describes plugin detail:: + + { + "name": PLUGIN_NAME + } + +Here are properties of ``PLUGIN``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The plugin name. It's used in :doc:`plugin_register`. + +``TYPES`` +^^^^^^^^^ + +``TYPES`` is an object. Its key is type name and its value is +type detail:: + + { + "TYPE_NAME_1": TYPE_1, + "TYPE_NAME_2": TYPE_2, + ... + "TYPE_NAME_n": TYPE_n + } + +``TYPE`` +^^^^^^^^ + +``TYPE`` is an object that describes type detail:: + + { + "name": TYPE_NAME, + "size": SIZE_OF_ONE_VALUE_IN_BYTE, + "can_be_key_type": BOOLEAN, + "can_be_value_type": BOOLEAN + } + +Here are properties of ``TYPE``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The type name. + * - ``size`` + - The number of bytes of one value. + * - ``can_be_key_type`` + - ``true`` when the type can be used for table key, ``false`` + otherwise. + * - ``can_be_value_type`` + - ``true`` when the type can be used for table value, ``false`` + otherwise. + +``TOKENIZERS`` +^^^^^^^^^^^^^^ + +``TOKENIZERS`` is an object. Its key is tokenizer name and its value +is tokenizer detail:: + + { + "TOKENIZER_NAME_1": TOKENIZER_1, + "TOKENIZER_NAME_2": TOKENIZER_2, + ... + "TOKENIZER_NAME_n": TOKENIZER_n + } + +``TOKENIZER`` +^^^^^^^^^^^^^ + +``TOKENIZER`` is an object that describes tokenizer detail:: + + { + "name": TOKENIZER_NAME + } + +Here are properties of ``TOKENIZER``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The tokenizer name. It's used for + :ref:`table-create-default-tokenizer`. + +``NORMALIZERS`` +^^^^^^^^^^^^^^^ + +``NORMALIZERS`` is an object. Its key is normalizer name and its value +is normalizer detail:: + + { + "NORMALIZER_NAME_1": NORMALIZER_1, + "NORMALIZER_NAME_2": NORMALIZER_2, + ... + "NORMALIZER_NAME_n": NORMALIZER_n + } + +``NORMALIZER`` +^^^^^^^^^^^^^^ + +``NORMALIZER`` is an object that describes normalizer detail:: + + { + "name": NORMALIZER_NAME + } + +Here are properties of ``NORMALIZER``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The normalizer name. It's used for + :ref:`table-create-normalizer`. + +``TOKEN_FILTERS`` +^^^^^^^^^^^^^^^^^ + +``TOKEN_FILTERS`` is an object. Its key is token filter name and its value +is token filter detail:: + + { + "TOKEN_FILTER_NAME_1": TOKEN_FILTER_1, + "TOKEN_FILTER_NAME_2": TOKEN_FILTER_2, + ... + "TOKEN_FILTER_NAME_n": TOKEN_FILTER_n + } + +``TOKEN_FILTER`` +^^^^^^^^^^^^^^^^ + +``TOKEN_FILTER`` is an object that describes token filter detail:: + + { + "name": TOKEN_FILTER_NAME + } + +Here are properties of ``TOKEN_FILTER``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The token filter name. It's used for + :ref:`table-create-token-filters`. + +``TABLES`` +^^^^^^^^^^ + +``TABLES`` is an object. Its key is table name and its value +is table detail:: + + { + "TABLE_NAME_1": TABLE_1, + "TABLE_NAME_2": TABLE_2, + ... + "TABLE_NAME_n": TABLE_n + } + +``TABLE`` +^^^^^^^^^ + +``TABLE`` is an object that describes table detail:: + + { + "name": TABLE_NAME + "type": TYPE, + "key_type": KEY_TYPE, + "value_type": VALUE_TYPE, + "tokenizer": TOKENIZER, + "normalizer": NORMALIZER, + "token_filters": [ + TOKEN_FILTER_1, + TOKEN_FILTER_2, + ..., + TOKEN_FILTER_n, + ], + "indexes": [ + INDEX_1, + INDEX_2, + ..., + INDEX_n + ], + "command": COMMAND, + "columns": { + "COLUMN_NAME_1": COLUMN_1, + "COLUMN_NAME_2": COLUMN_2, + ..., + "COLUMN_NAME_3": COLUMN_3, + } + } + +Here are properties of ``TABLE``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The table name. + * - ``type`` + - The table type. + + This is one of the followings: + + * ``array``: :ref:`table-no-key` + * ``hash``: :ref:`table-hash-key` + * ``patricia trie``: :ref:`table-pat-key` + * ``double array trie``: :ref:`table-dat-key` + * - ``key_type`` + - The type of the table's key. + + If the table type is ``array``, this is ``null``. + + If the table type isn't ``array``, this is an object + that has the following properties: + + * ``name``: The type name. + * ``type``: ``reference`` if the type is an table, ``type`` + otherwise. + * - ``value_type`` + - The type of the table's value. + + If the table doesn't use value, this is ``null``. + + If the table uses value, this is an object that has the + following properties: + + * ``name``: The type name. + * ``type``: ``reference`` if the type is an table, ``type`` + otherwise. + * - ``tokenizer`` + - The tokenizer of the table. It's specified by + :ref:`table-create-default-tokenizer`. + + If the table doesn't use tokenizer, this is ``null``. + + If the table uses tokenizer, this is an object that has the + following properties: + + * ``name``: The tokenizer name. + * - ``normalizer`` + - The normalizer of the table. It's specified by + :ref:`table-create-normalizer`. + + If the table doesn't use normalizer, this is ``null``. + + If the table uses normalizer, this is an object that has the + following properties: + + * ``name``: The normalizer name. + * - ``token_filters`` + - The token filters of the table. It's specified by + :ref:`table-create-token-filters`. + + This is an array of an object. The object has the following + properties: + + * ``name``: The token filter name. + * - ``indexes`` + - The indexes of the table's key. + + This is an array of :ref:`schema-return-value-index`. + * - ``command`` + - The Groonga command information to create the table. + + This is :ref:`schema-return-value-command`. + * - ``columns`` + - The columns of the table. + + This is an object that its key is a column name and its value + is :ref:`schema-return-value-column`. + +.. _schema-return-value-index: + +``INDEX`` +^^^^^^^^^ + +``INDEX`` is an object that describes index detail:: + + { + "full_name": INDEX_COLUMN_NAME_WITH_TABLE_NAME, + "table": TABLE_NAME, + "name": INDEX_COLUMN_NAME, + "section": SECTION + } + +Here are properties of ``INDEX``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``full_name`` + - The index column name with table name. + + For example, ``Terms.index``. + * - ``table`` + - The table name of the index column. + + For example, ``Terms``. + * - ``name`` + - The index column name. + + For example, ``index``. + * - ``section`` + - The section number in the index column for the table's key. + + If the index column isn't multiple column index, this is ``0``. + +.. _schema-return-value-command: + +``COMMAND`` +^^^^^^^^^^^ + +``COMMAND`` is an object that describes how to create the table or +column:: + + { + "name": COMMAND_NAME, + "arguments": { + "KEY_1": "VALUE_1", + "KEY_2": "VALUE_2", + ..., + "KEY_n": "VALUE_n" + }, + "command_line": COMMAND_LINE + } + +Here are properties of ``COMMAND``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The Groonga command name to create the table or column. + * - ``arguments`` + - The arguments of the Groonga command to create the + table or column. + + This is an object that its key is argument name and its value + is argument value. + * - ``command_line`` + - The Groonga command line to create the table or column. + + This is a string that can be evaluated by Groonga. + +.. _schema-return-value-column: + +``COLUMN`` +^^^^^^^^^^ + +``COLUMN`` is an object that describes column detail:: + + { + "name": COLUMN_NAME, + "table": TABLE_NAME, + "full_name": COLUMN_NAME_WITH_TABLE, + "type": TYPE, + "value_type": VALUE_TYPE, + "compress": COMPRESS, + "section": SECTION, + "weight": WEIGHT, + "compress": COMPRESS, + "section": BOOLEAN, + "weight": BOOLEAN, + "position": BOOLEAN, + "sources": [ + SOURCE_1, + SOURCE_2, + ..., + SOURCE_n + ], + "indexes": [ + INDEX_1, + INDEX_2, + ..., + INDEX_n + ], + "command": COMMAND + } + +Here are properties of ``COLUMN``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The column name. + + For example, ``age``. + * - ``table`` + - The table name of the column. + + For example, ``Users``. + * - ``full_name`` + - The column name with table name. + + For example, ``Users.age``. + * - ``type`` + - The column type. + + This is one of the followings: + + * ``scalar``: :doc:`/reference/columns/scalar` + * ``vector``: :doc:`/reference/columns/vector` + * ``index``: :doc:`/reference/columns/index` + * - ``value_type`` + - The type of the column's value. + + This is an object that has the following properties: + + * ``name``: The type name. + * ``type``: ``reference`` if the type is an table, ``type`` + otherwise. + * - ``compress`` + - The compression method of the column. + + If the column doesn't use any compression methods, this is + ``null``. + + If the column uses a compression method, this is one of the + followings: + + * ``zlib``: The column uses zlib to compress column value. + * ``lz4``: The column uses LZ4 to compress column value. + * - ``section`` + - Whether the column can store section information or not. + + ``true`` if the column is created with ``WITH_SECTION`` flag, + ``false`` otherwise. + + Normally, if the column isn't an index column, this is ``false``. + * - ``weight`` + - Whether the column can store weight information or not. + + ``true`` if the column is created with ``WITH_WEIGHT`` flag, + ``false`` otherwise. + * - ``position`` + - Whether the column can store position information or not. + + ``true`` if the column is created with ``WITH_POSITION`` flag, + ``false`` otherwise. + + Normally, if the column isn't an index column, this is ``false``. + * - ``sources`` + - The source columns of the index column. + + This is an array of :ref:`schema-return-value-source`. + + Normally, if the column isn't an index column, this is an + empty array. + * - ``indexes`` + - The indexes of the column. + + This is an array of :ref:`schema-return-value-index`. + * - ``command`` + - The Groonga command information to create the column. + + This is :ref:`schema-return-value-command`. + +.. _schema-return-value-source: + +``SOURCE`` +^^^^^^^^^^ + +``SOURCE`` is an object that describes source detail:: + + { + "name": COLUMN_NAME, + "table": TABLE_NAME, + "full_name": COLUMN_NAME_WITH_TABLE_NAME + } + +Here are properties of ``SOURCE``: + +.. list-table:: + :header-rows: 1 + + * - Name + - Description + * - ``name`` + - The source column name. + + For example, ``content``. + + This may be a ``_key`` pseudo column. + * - ``table`` + - The table name of the source column. + + For example, ``Memos``. + * - ``full_name`` + - The source column name with table name. + + For example, ``Memos.content``. + +See also +-------- + + * :doc:`table_create` + * :doc:`column_create`