Sophie

Sophie

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

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




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


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>7.5. grn_expr &mdash; groonga v1.2.6ドキュメント</title>
    
    <link rel="stylesheet" href="_static/groonga.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '1.2.6',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/translations.js"></script>
    <link rel="shortcut icon" href="_static/favicon.ico"/>
    <link rel="top" title="groonga v1.2.6ドキュメント" href="index.html" />
    <link rel="up" title="7. リファレンスマニュアル" href="reference.html" />
    <link rel="next" title="7.6. 組み込み関数一覧" href="functions.html" />
    <link rel="prev" title="7.4. 疑似カラム (pseudo_column)" href="pseudo_column.html" /> 
  </head>
  <body>
<div class="header">
  <h1 class="title">
    <a id="top-link" href="index.html">
      <span class="project">groonga</span>
      <span class="separator">-</span>
      <span class="description">オープンソースのカラムストア機能付き全文検索エンジン</span>
    </a>
  </h1>

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

    <div class="related">
      <h3>ナビゲーション</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="総合索引"
             accesskey="I">索引</a></li>
        <li class="right" >
          <a href="functions.html" title="7.6. 組み込み関数一覧"
             accesskey="N">次へ</a> |</li>
        <li class="right" >
          <a href="pseudo_column.html" title="7.4. 疑似カラム (pseudo_column)"
             accesskey="P">前へ</a> |</li>
        <li><a href="index.html">groonga v1.2.6ドキュメント</a> &raquo;</li>
          <li><a href="reference.html" accesskey="U">7. リファレンスマニュアル</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="grn-expr">
<h1>7.5. grn_expr<a class="headerlink" href="#grn-expr" title="このヘッドラインへのパーマリンク">¶</a></h1>
<div class="section" id="id1">
<h2>7.5.1. 名前<a class="headerlink" href="#id1" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>grn_expr - 検索条件やデータベースへの操作を表現するデータ構造(読み方:&quot;ぐるんしき&quot;)</p>
</div>
<div class="section" id="id2">
<h2>7.5.2. 説明<a class="headerlink" href="#id2" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>grn_exprは、検索条件やデータベースへの操作を表現するために使用されるデータ構造の形式です。</p>
<p>データベースの中から特定の条件を満たすレコードを取り出すために、様々な条件をand,or,notなどの演算子で結合して自由に表現することができます。grn_exprは、一連のAPI関数を呼ぶことによって組み立てることができます。特定の文字列形式には依存していません。組み込みコマンドselectのqueryパラメータでは、検索エンジンのユーザがフォームで入力する文字列を直接受け取ることを想定して、文字列からgrn_exprを生成しています。また、多くの組み込みコマンドで共通に使用するために、ECMAScript形式の文字列からgrn_exprを生成するAPI関数grn_expr_parse()を用意しています。grn_expr_parseでパースできる文字列を特にscript形式のgrn_exprと呼びます。</p>
<p>grn_exprを使うことによって非常に柔軟に検索条件を記述することができます。類似文書検索や近傍検索のような高度な検索もすべてgrn_exprによって記述できます。また、全文検索クエリにおいて、特定の文字列を含むレコードのスコアを細かく制御したり、検索結果数の多寡に応じてより検索漏れの少ないアルゴリズムで再検索するような機能も、grn_exprとgrn_table_select()API関数を組み合わせることによって自由に定義できます。</p>
</div>
<div class="section" id="scriptgrn-expr">
<h2>7.5.3. script形式のgrn_expr<a class="headerlink" href="#scriptgrn-expr" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>ECMAScript風の構文で検索条件やレコードへの操作を記述します。</p>
<p>式中のIDENTIFIER(識別子)は、以下のいずれかを指します。</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">引数名:</th><td class="field-body">grn_exprが受け取る引数の名前</td>
</tr>
<tr class="field-even field"><th class="field-name">カラム名:</th><td class="field-body">操作対象としているレコードのカラム名</td>
</tr>
<tr class="field-odd field"><th class="field-name">型名・関数名・テーブル名:</th><td class="field-body">データベースに定義された型・テーブル・関数の名前</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="id3">
<h2>7.5.4. 例<a class="headerlink" href="#id3" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>script形式でcolumn1の値が'hoge'に等しいという条件</p>
<blockquote>
<div>column1 == &quot;hoge&quot;</div></blockquote>
<p class="rubric">脚注</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">目次</a></h3>
  <ul>
<li><a class="reference internal" href="#">7.5. grn_expr</a><ul>
<li><a class="reference internal" href="#id1">7.5.1. 名前</a></li>
<li><a class="reference internal" href="#id2">7.5.2. 説明</a></li>
<li><a class="reference internal" href="#scriptgrn-expr">7.5.3. script形式のgrn_expr</a></li>
<li><a class="reference internal" href="#id3">7.5.4. 例</a></li>
</ul>
</li>
</ul>

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