Sophie

Sophie

distrib > Fedora > 18 > x86_64 > media > updates > by-pkgid > e450e7f3d6075c4a54de19e68d38177f > files > 345

groonga-doc-3.0.5-1.fc18.x86_64.rpm


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


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>4.7. match_columnsパラメータ &mdash; groonga v3.0.5 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:     '3.0.5',
        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 v3.0.5 documentation" href="../index.html" />
    <link rel="up" title="4. Tutorial" href="../tutorial.html" />
    <link rel="next" title="4.8. パトリシア木による前方一致検索" href="patricia_trie.html" />
    <link rel="prev" title="4.6. タグ検索・参照関係の逆引き" href="index.html" /> 
  </head>
  <body>
<div class="header">
  <h1 class="title">
    <a id="top-link" href="../index.html">
      <span class="project">groonga</span>
      <span class="separator">-</span>
      <span class="description">An open-source fulltext search engine and column store.</span>
    </a>
  </h1>

  <div class="other-language-links">
    <ul>
      <li><a href="../../../ja/html/tutorial/match_columns.html"><img src="../_static/jp.png" alt="日本語">日本語版はこちら</a></li>
    </ul>
  </div>
</div>
  

    <div class="related">
      <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="patricia_trie.html" title="4.8. パトリシア木による前方一致検索"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="4.6. タグ検索・参照関係の逆引き"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">groonga v3.0.5 documentation</a> &raquo;</li>
          <li><a href="../tutorial.html" accesskey="U">4. Tutorial</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="match-columns">
<h1>4.7. match_columnsパラメータ<a class="headerlink" href="#match-columns" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<h2>4.7.1. 複数のカラムを対象とした全文検索<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<p>groongaでは、複数のカラムを対象とした全文検索を行うことができます。例えば、ブログのテーブルで、タイトルと内容とがそれぞれ別のカラムに入ったものがあるとしましょう。「タイトルもしくは内容に特定の単語を含む」検索を行いたいとします。</p>
<p>この場合、2つのインデックス作成方式があります。1つは、それぞれのカラムに1つずつインデックスを付与する方式です。もう1つは、複数のカラムに対して1つのインデックスを付与する方式です。groongaでは、どちらの形式のインデックスが存在している場合でも、同一の記法で全文検索を行うことができます。</p>
<div class="section" id="id2">
<h3>4.7.1.1. カラムごとにインデックスを付与する場合<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<p>Blog1テーブルを作り、タイトル文字列のtitleカラム、本文のmessageカラムを追加しています。
インデックス用のIndexBlog1テーブルも作り、titleカラムのインデックス用にindex_titleカラム、messageカラムのインデック用にindex_messageカラムと、それぞれ1カラムごとに1つずつ追加しています。</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>table_create --name Blog1 --flags TABLE_HASH_KEY --key_type ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create --table Blog1 --name title --flags COLUMN_SCALAR --type ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create --table Blog1 --name message --flags COLUMN_SCALAR --type ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create --name IndexBlog1 --flags TABLE_PAT_KEY|KEY_NORMALIZE --key_type ShortText --default_tokenizer TokenBigram
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create --table IndexBlog1 --name index_title --flags COLUMN_INDEX|WITH_POSITION --type Blog1 --source title
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create --table IndexBlog1 --name index_message --flags COLUMN_INDEX|WITH_POSITION --type Blog1 --source message
# [[0, 1337566253.89858, 0.000355720520019531], true]
load --table Blog1
[
{&quot;_key&quot;:&quot;grn1&quot;,&quot;title&quot;:&quot;groonga test&quot;,&quot;message&quot;:&quot;groonga message&quot;},
{&quot;_key&quot;:&quot;grn2&quot;,&quot;title&quot;:&quot;baseball result&quot;,&quot;message&quot;:&quot;rakutan eggs 4 - 4 groonga moritars&quot;},
{&quot;_key&quot;:&quot;grn3&quot;,&quot;title&quot;:&quot;groonga message&quot;,&quot;message&quot;:&quot;none&quot;}
]
# [[0, 1337566253.89858, 0.000355720520019531], 3]
</pre></div>
</div>
<p>match_columnsオプションで、検索対象のカラムを複数指定することが出来ます。検索する文字列はqueryオプションで指定します。これを使うことで、タイトルと本文を全文検索することができます。</p>
<p>実際に検索してみましょう。</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>select --table Blog1 --match_columns title||message --query groonga
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         3
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;message&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ],
#       [
#         1,
#         &quot;grn1&quot;,
#         &quot;groonga message&quot;,
#         &quot;groonga test&quot;
#       ],
#       [
#         3,
#         &quot;grn3&quot;,
#         &quot;none&quot;,
#         &quot;groonga message&quot;
#       ],
#       [
#         2,
#         &quot;grn2&quot;,
#         &quot;rakutan eggs 4 - 4 groonga moritars&quot;,
#         &quot;baseball result&quot;
#       ]
#     ]
#   ]
# ]
select --table Blog1 --match_columns title||message --query message
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         2
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;message&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ],
#       [
#         3,
#         &quot;grn3&quot;,
#         &quot;none&quot;,
#         &quot;groonga message&quot;
#       ],
#       [
#         1,
#         &quot;grn1&quot;,
#         &quot;groonga message&quot;,
#         &quot;groonga test&quot;
#       ]
#     ]
#   ]
# ]
select --table Blog1 --match_columns title --query message
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         1
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;message&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ],
#       [
#         3,
#         &quot;grn3&quot;,
#         &quot;none&quot;,
#         &quot;groonga message&quot;
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h3>4.7.1.2. 複数のカラムにまたがったインデックスを付与する場合<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3>
<p>内容は上の例とほぼ同じですが、titleとmessageの2つのカラムに対するインデックスが共通になっており、インデックスカラムが1つしかありません。</p>
<p>共通のインデックスを用いても、titleカラムのみでの検索、messageカラムのみでの検索、titleもしくはmessageカラムでの検索、全ての検索を行うことができます。</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>table_create --name Blog2 --flags TABLE_HASH_KEY --key_type ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create --table Blog2 --name title --flags COLUMN_SCALAR --type ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create --table Blog2 --name message --flags COLUMN_SCALAR --type ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create --name IndexBlog2 --flags TABLE_PAT_KEY|KEY_NORMALIZE --key_type ShortText --default_tokenizer TokenBigram
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create --table IndexBlog2 --name index_blog --flags COLUMN_INDEX|WITH_POSITION|WITH_SECTION --type Blog2 --source title,message
# [[0, 1337566253.89858, 0.000355720520019531], true]
load --table Blog2
[
{&quot;_key&quot;:&quot;grn1&quot;,&quot;title&quot;:&quot;groonga test&quot;,&quot;message&quot;:&quot;groonga message&quot;},
{&quot;_key&quot;:&quot;grn2&quot;,&quot;title&quot;:&quot;baseball result&quot;,&quot;message&quot;:&quot;rakutan eggs 4 - 4 groonga moritars&quot;},
{&quot;_key&quot;:&quot;grn3&quot;,&quot;title&quot;:&quot;groonga message&quot;,&quot;message&quot;:&quot;none&quot;}
]
# [[0, 1337566253.89858, 0.000355720520019531], 3]
</pre></div>
</div>
<p>実際に検索してみましょう。結果は上の例と同じになります。</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>select --table Blog2 --match_columns title||message --query groonga
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         3
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;message&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ],
#       [
#         1,
#         &quot;grn1&quot;,
#         &quot;groonga message&quot;,
#         &quot;groonga test&quot;
#       ],
#       [
#         2,
#         &quot;grn2&quot;,
#         &quot;rakutan eggs 4 - 4 groonga moritars&quot;,
#         &quot;baseball result&quot;
#       ],
#       [
#         3,
#         &quot;grn3&quot;,
#         &quot;none&quot;,
#         &quot;groonga message&quot;
#       ]
#     ]
#   ]
# ]
select --table Blog2 --match_columns title||message --query message
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         2
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;message&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ],
#       [
#         1,
#         &quot;grn1&quot;,
#         &quot;groonga message&quot;,
#         &quot;groonga test&quot;
#       ],
#       [
#         3,
#         &quot;grn3&quot;,
#         &quot;none&quot;,
#         &quot;groonga message&quot;
#       ]
#     ]
#   ]
# ]
select --table Blog2 --match_columns title --query message
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         1
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_key&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;message&quot;,
#           &quot;ShortText&quot;
#         ],
#         [
#           &quot;title&quot;,
#           &quot;ShortText&quot;
#         ]
#       ],
#       [
#         3,
#         &quot;grn3&quot;,
#         &quot;none&quot;,
#         &quot;groonga message&quot;
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
</div>
</div>
<div class="section" id="id4">
<h2>4.7.2. インデックス名を指定した全文検索<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<p>執筆中です。</p>
</div>
<div class="section" id="nested-index-search-among-related-table-by-column-index">
<span id="nested-index-search"></span><h2>4.7.3. Nested index search among related table by column index<a class="headerlink" href="#nested-index-search-among-related-table-by-column-index" title="Permalink to this headline">¶</a></h2>
<p>If there are relationships among multiple table with column index,
you can search multiple table by specifying reference column name.</p>
<p>Here is the concrete example.</p>
<p>There are tables which store blog articles, comments for articles.
The table which stores articles has columns for article and comment.
And the comment column refers Comments table.
The table which stores comments has columns for comment and column index to article table.</p>
<p>if you want to search the articles which contain specified keyword in comment,
you need to execute fulltext search for table of comment, then search the records which contains fulltext search results.</p>
<p>But, you can search the records by specifying the reference column index at once.</p>
<p>Here is the sample schema.</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>table_create Comments TABLE_HASH_KEY UInt32
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Comments content COLUMN_SCALAR ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create Articles TABLE_NO_KEY
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Articles content COLUMN_SCALAR Text
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Articles comment COLUMN_SCALAR Comments
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create Lexicon TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Lexicon articles_content COLUMN_INDEX|WITH_POSITION Articles content
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Lexicon comments_content COLUMN_INDEX|WITH_POSITION Comments content
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Comments article COLUMN_INDEX Articles comment
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
<p>Here is the sample data.</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>load --table Comments
[
{&quot;_key&quot;: 1, &quot;content&quot;: &quot;I&#39;m using groonga too!&quot;},
{&quot;_key&quot;: 2, &quot;content&quot;: &quot;I&#39;m using groonga and mroonga!&quot;},
{&quot;_key&quot;: 3, &quot;content&quot;: &quot;I&#39;m using mroonga too!&quot;}
]
# [[0, 1337566253.89858, 0.000355720520019531], 3]
load --table Articles
[
{&quot;content&quot;: &quot;Groonga is fast!&quot;, &quot;comment&quot;: 1},
{&quot;content&quot;: &quot;Groonga is useful!&quot;},
{&quot;content&quot;: &quot;Mroonga is fast!&quot;, &quot;comment&quot;: 3}
]
# [[0, 1337566253.89858, 0.000355720520019531], 3]
</pre></div>
</div>
<p>You can write the query that search the records which contains specified keyword as a comment, then fetch the articles which refers to it.</p>
<p>Query for searching the records described above:</p>
<div class="highlight-none"><div class="highlight"><pre>select Articles --match_columns comment.content --query groonga --output_columns &quot;_id, _score, *&quot;
</pre></div>
</div>
<p>You need to concatenate comment column of Articles table and content column of Comments table with period(.) as --match_columns arguments.</p>
<p>At first, this query execute fulltext search from content of Comments table, then fetch the records of Articles table which refers to already searched records of Comments table.
(Because of this, if you comment out the query which create column index 'article' of Comments table, you can't get intended search results.)</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>select Articles --match_columns comment.content --query groonga --output_columns &quot;_id, _score, *&quot;
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         1
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_score&quot;,
#           &quot;Int32&quot;
#         ],
#         [
#           &quot;comment&quot;,
#           &quot;Comments&quot;
#         ],
#         [
#           &quot;content&quot;,
#           &quot;Text&quot;
#         ]
#       ],
#       [
#         1,
#         1,
#         1,
#         &quot;Groonga is fast!&quot;
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
<p>Now, you can search articles which contains specific keywords as a comment.</p>
<p>The feature of nested index search is not limited to the relationship between two table only.</p>
<p>Here is the sample schema similar to previous one. The difference is added table which express 'Reply' and relationship is extended to three tables.</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>table_create Replies2 TABLE_HASH_KEY UInt32
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Replies2 content COLUMN_SCALAR ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create Comments2 TABLE_HASH_KEY UInt32
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Comments2 content COLUMN_SCALAR ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Comments2 comment COLUMN_SCALAR Replies2
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create Articles2 TABLE_NO_KEY
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Articles2 content COLUMN_SCALAR Text
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Articles2 comment COLUMN_SCALAR Comments2
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create Lexicon2 TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Lexicon2 articles_content COLUMN_INDEX|WITH_POSITION Articles2 content
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Lexicon2 comments_content COLUMN_INDEX|WITH_POSITION Comments2 content
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Lexicon2 replies_content COLUMN_INDEX|WITH_POSITION Replies2 content
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Comments2 article COLUMN_INDEX Articles2 comment
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Replies2 reply_to COLUMN_INDEX Comments2 comment
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
<p>Here is the sample data.</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>load --table Replies2
[
{&quot;_key&quot;: 1, &quot;content&quot;: &quot;I&#39;m using rroonga too!&quot;},
{&quot;_key&quot;: 2, &quot;content&quot;: &quot;I&#39;m using groonga and mroonga and rroonga!&quot;},
{&quot;_key&quot;: 3, &quot;content&quot;: &quot;I&#39;m using nroonga too!&quot;}
]
# [[0, 1337566253.89858, 0.000355720520019531], 3]
load --table Comments2
[
{&quot;_key&quot;: 1, &quot;content&quot;: &quot;I&#39;m using groonga too!&quot;, &quot;comment&quot;: 1},
{&quot;_key&quot;: 2, &quot;content&quot;: &quot;I&#39;m using groonga and mroonga!&quot;, &quot;comment&quot;: 2},
{&quot;_key&quot;: 3, &quot;content&quot;: &quot;I&#39;m using mroonga too!&quot;}
]
# [[0, 1337566253.89858, 0.000355720520019531], 3]
load --table Articles2
[
{&quot;content&quot;: &quot;Groonga is fast!&quot;, &quot;comment&quot;: 1},
{&quot;content&quot;: &quot;Groonga is useful!&quot;, &quot;comment&quot;: 2},
{&quot;content&quot;: &quot;Mroonga is fast!&quot;, &quot;comment&quot;: 3}
]
# [[0, 1337566253.89858, 0.000355720520019531], 3]
</pre></div>
</div>
<p>Query for searching the records described above:</p>
<div class="highlight-none"><div class="highlight"><pre>select Articles2 --match_columns comment.content --query mroonga --output_columns &quot;_id, _score, *&quot;
select Articles2 --match_columns comment.comment.content --query mroonga --output_columns &quot;_id, _score, *&quot;
</pre></div>
</div>
<p>The first query searches 'mroonga' from Comments2 table, the second one searches 'mroonga' from Replies2 and Comment2 table by using reference column index.</p>
<p>Execution example:</p>
<div class="highlight-none"><div class="highlight"><pre>select Articles2 --match_columns comment.content --query mroonga --output_columns &quot;_id, _score, *&quot;
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         2
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_score&quot;,
#           &quot;Int32&quot;
#         ],
#         [
#           &quot;comment&quot;,
#           &quot;Comments2&quot;
#         ],
#         [
#           &quot;content&quot;,
#           &quot;Text&quot;
#         ]
#       ],
#       [
#         2,
#         1,
#         2,
#         &quot;Groonga is useful!&quot;
#       ],
#       [
#         3,
#         1,
#         3,
#         &quot;Mroonga is fast!&quot;
#       ]
#     ]
#   ]
# ]
select Articles2 --match_columns comment.comment.content --query mroonga --output_columns &quot;_id, _score, *&quot;
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         1
#       ],
#       [
#         [
#           &quot;_id&quot;,
#           &quot;UInt32&quot;
#         ],
#         [
#           &quot;_score&quot;,
#           &quot;Int32&quot;
#         ],
#         [
#           &quot;comment&quot;,
#           &quot;Comments2&quot;
#         ],
#         [
#           &quot;content&quot;,
#           &quot;Text&quot;
#         ]
#       ],
#       [
#         2,
#         1,
#         2,
#         &quot;Groonga is useful!&quot;
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
<p>As a result, the first query matches two article because of Comments2 table has two records which contains 'mroonga' as keyword.</p>
<p>On the other hand, the second one matches one article only because of Replies2 table has only one record which contains 'mroonga' as keyword, and there is one record which contains same keyword and refers to the record in Comments2 table.</p>
</div>
<div class="section" id="id5">
<h2>4.7.4. インデックスの重み<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<p>執筆中です。</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">4.7. match_columnsパラメータ</a><ul>
<li><a class="reference internal" href="#id1">4.7.1. 複数のカラムを対象とした全文検索</a><ul>
<li><a class="reference internal" href="#id2">4.7.1.1. カラムごとにインデックスを付与する場合</a></li>
<li><a class="reference internal" href="#id3">4.7.1.2. 複数のカラムにまたがったインデックスを付与する場合</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id4">4.7.2. インデックス名を指定した全文検索</a></li>
<li><a class="reference internal" href="#nested-index-search-among-related-table-by-column-index">4.7.3. Nested index search among related table by column index</a></li>
<li><a class="reference internal" href="#id5">4.7.4. インデックスの重み</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">4.6. タグ検索・参照関係の逆引き</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="patricia_trie.html"
                        title="next chapter">4.8. パトリシア木による前方一致検索</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/tutorial/match_columns.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <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">
      <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="patricia_trie.html" title="4.8. パトリシア木による前方一致検索"
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="4.6. タグ検索・参照関係の逆引き"
             >previous</a> |</li>
        <li><a href="../index.html">groonga v3.0.5 documentation</a> &raquo;</li>
          <li><a href="../tutorial.html" >4. Tutorial</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2013, Brazil, Inc.
    </div>
  </body>
</html>