Sophie

Sophie

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

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>8.11.5. html_untag &mdash; groonga v3.0.5ドキュメント</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>
    <script type="text/javascript" src="../../_static/translations.js"></script>
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
    <link rel="top" title="groonga v3.0.5ドキュメント" href="../../index.html" />
    <link rel="up" title="8.11. 関数" href="../function.html" />
    <link rel="next" title="8.11.6. now" href="now.html" />
    <link rel="prev" title="8.11.4. geo_in_rectangle" href="geo_in_rectangle.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/reference/functions/html_untag.html"><img src="../../_static/us.png" alt="English">English page</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="now.html" title="8.11.6. now"
             accesskey="N">次へ</a> |</li>
        <li class="right" >
          <a href="geo_in_rectangle.html" title="8.11.4. geo_in_rectangle"
             accesskey="P">前へ</a> |</li>
        <li><a href="../../index.html">groonga v3.0.5ドキュメント</a> &raquo;</li>
          <li><a href="../../reference.html" >8. リファレンスマニュアル</a> &raquo;</li>
          <li><a href="../function.html" accesskey="U">8.11. 関数</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="html-untag">
<h1>8.11.5. html_untag<a class="headerlink" href="#html-untag" title="このヘッドラインへのパーマリンク">¶</a></h1>
<div class="section" id="summary">
<h2>8.11.5.1. 概要<a class="headerlink" href="#summary" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p><tt class="docutils literal"><span class="pre">html_untag</span></tt> はHTMLタグをHTMLから除去したテキストを出力します。</p>
<p><tt class="docutils literal"><span class="pre">html_untag</span></tt> は <a class="reference internal" href="../commands/select.html"><em>select</em></a> で記載されている <tt class="docutils literal"><span class="pre">--output_columns</span></tt> で使います。</p>
</div>
<div class="section" id="syntax">
<h2>8.11.5.2. 構文<a class="headerlink" href="#syntax" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p><tt class="docutils literal"><span class="pre">html_untag</span></tt> は引数を一つだけとります。 それは <tt class="docutils literal"><span class="pre">column</span></tt> です。</p>
<div class="highlight-none"><div class="highlight"><pre>html_untag(column)
</pre></div>
</div>
</div>
<div class="section" id="usage">
<h2>8.11.5.3. 使い方<a class="headerlink" href="#usage" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>使い方を示すために使うスキーマ定義とサンプルデータは以下の通りです。</p>
<p>サンプルスキーマ:</p>
<p>実行例:</p>
<div class="highlight-none"><div class="highlight"><pre>table_create WebClips TABLE_NO_KEY
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create WebClips url COLUMN_SCALAR ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create WebClips content COLUMN_SCALAR ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create WebClips tag COLUMN_VECTOR ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
</pre></div>
</div>
<p>サンプルデータ:</p>
<p>実行例:</p>
<div class="highlight-none"><div class="highlight"><pre>load --table WebClips
[
{&quot;_key&quot;: 1, &quot;url&quot;: &quot;http://groonga.org&quot;, &quot;tag&quot;: [&quot;groonga&quot;], &quot;content&quot;: &quot;groonga is &lt;span class=&#39;emphasize&#39;&gt;fast&lt;/span&gt;&quot;},
{&quot;_key&quot;: 2, &quot;url&quot;: &quot;http://mroonga.org&quot;, &quot;tag&quot;: [&quot;mroonga&quot;], &quot;content&quot;: &quot;mroonga is &lt;span class=\&quot;emphasize\&quot;&gt;fast&lt;/span&gt;&quot;},
]
# [[0, 1337566253.89858, 0.000355720520019531], 2]
</pre></div>
</div>
<p>カラムの本文からHTMLタグを除去する <tt class="docutils literal"><span class="pre">html_untag</span></tt> 関数の簡単な例はこちらです。</p>
<p>実行例:</p>
<div class="highlight-none"><div class="highlight"><pre>select WebClips --output_columns &quot;_key, html_untag(content)&quot; --command_version 2
# [
#   [
#     0,
#     1337566253.89858,
#     0.000355720520019531
#   ],
#   [
#     [
#       [
#         2
#       ],
#       [
#         [
#           &quot;html_untag&quot;,
#           &quot;null&quot;
#         ]
#       ],
#       [
#         &quot;groonga is fast&quot;
#       ],
#       [
#         &quot;mroonga is fast&quot;
#       ]
#     ]
#   ]
# ]
</pre></div>
</div>
<p>上記クエリを実行すると、&quot;class&quot; 属性つきの &quot;span&quot; タグが除去されているのがわかります。<tt class="docutils literal"><span class="pre">html_untag</span></tt> 関数を使うのには <tt class="docutils literal"><span class="pre">--command_vesion</span> <span class="pre">2</span></tt> を指定しなければならないことに注意してください。</p>
</div>
<div class="section" id="parameters">
<h2>8.11.5.4. 引数<a class="headerlink" href="#parameters" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p>必須引数が一つあり、それは <tt class="docutils literal"><span class="pre">column</span></tt> です。</p>
<div class="section" id="column">
<h3>8.11.5.4.1. <tt class="docutils literal"><span class="pre">column</span></tt><a class="headerlink" href="#column" title="このヘッドラインへのパーマリンク">¶</a></h3>
<p>テーブルのカラムを指定します。</p>
</div>
</div>
<div class="section" id="return-value">
<h2>8.11.5.5. 戻り値<a class="headerlink" href="#return-value" title="このヘッドラインへのパーマリンク">¶</a></h2>
<p><tt class="docutils literal"><span class="pre">html_untag</span></tt> はカラムの本文からHTMLタグを除去したテキストを返します。</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="#">8.11.5. html_untag</a><ul>
<li><a class="reference internal" href="#summary">8.11.5.1. 概要</a></li>
<li><a class="reference internal" href="#syntax">8.11.5.2. 構文</a></li>
<li><a class="reference internal" href="#usage">8.11.5.3. 使い方</a></li>
<li><a class="reference internal" href="#parameters">8.11.5.4. 引数</a><ul>
<li><a class="reference internal" href="#column">8.11.5.4.1. <tt class="docutils literal"><span class="pre">column</span></tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#return-value">8.11.5.5. 戻り値</a></li>
</ul>
</li>
</ul>

  <h4>前のトピックへ</h4>
  <p class="topless"><a href="geo_in_rectangle.html"
                        title="前の章へ">8.11.4. geo_in_rectangle</a></p>
  <h4>次のトピックへ</h4>
  <p class="topless"><a href="now.html"
                        title="次の章へ">8.11.6. now</a></p>
  <h3>このページ</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/reference/functions/html_untag.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" />
      <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="now.html" title="8.11.6. now"
             >次へ</a> |</li>
        <li class="right" >
          <a href="geo_in_rectangle.html" title="8.11.4. geo_in_rectangle"
             >前へ</a> |</li>
        <li><a href="../../index.html">groonga v3.0.5ドキュメント</a> &raquo;</li>
          <li><a href="../../reference.html" >8. リファレンスマニュアル</a> &raquo;</li>
          <li><a href="../function.html" >8.11. 関数</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2013, Brazil, Inc.
    </div>
  </body>
</html>