<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # 9.13\. 文本檢索函數和操作符 [Table 9-36](#calibre_link-2223),[Table 9-37](#calibre_link-2224) 和[Table 9-38](#calibre_link-2225)概述了提供全文檢索函數和操作符。 詳見[Chapter 12](#calibre_link-426) PostgreSQL文本檢索功能的說明。 **Table 9-36\. 文本檢索操作符** | 操作符 | 描述 | 示例 | 結果 | | --- | --- | --- | --- | | `@@` | `tsvector` 匹配 `tsquery` ? | `to_tsvector('fat cats ate rats') @@ to_tsquery('cat & rat')` | `t` | | `@@@` | 棄用的`@@`的同義詞 | `to_tsvector('fat cats ate rats') @@@ to_tsquery('cat & rat')` | `t` | | `&#124;&#124;` | 連接`tsvector`s | `'a:1 b:2'::tsvector &#124;&#124; 'c:1 d:2 b:3'::tsvector` | `'a':1 'b':2,5 'c':3 'd':4` | | `&&` | `tsquery`與 | `'fat &#124; rat'::tsquery && 'cat'::tsquery` | `( 'fat' &#124; 'rat' ) & 'cat'` | | `&#124;&#124;` | `tsquery`或 | `'fat &#124; rat'::tsquery &#124;&#124; 'cat'::tsquery` | `( 'fat' &#124; 'rat' ) &#124; 'cat'` | | `!!` | `tsquery`非 | `!! 'cat'::tsquery` | `!'cat'` | | `@&gt;` | `tsquery` 包含另一個? | `'cat'::tsquery @&gt; 'cat & rat'::tsquery` | `f` | | `&lt;@` | `tsquery` 包含于 ? | `'cat'::tsquery &lt;@ 'cat & rat'::tsquery` | `t` | > **Note:** `tsquery`的操作符只考慮兩個查詢列出的項的情況,忽略組合的操作符。 除了顯示在表中的操作符,還為類型`tsvector`和`tsquery` 定義了普通的B-tree比較操作符(`=`, `&lt;`等)。 它們對于文本檢索不是很有用,但是允許使用。例如,建在這些類型列上的唯一索引。 **Table 9-37\. 文本檢索函數** | 函數 | 返回類型 | 描述 | 示例 | 結果 | | --- | --- | --- | --- | --- | | ``get_current_ts_config()`` | `regconfig` | 獲取文本檢索的默認配置 | `get_current_ts_config()` | `english` | | ``length(```tsvector`) | `integer` | `tsvector`的單詞數 | `length('fat:2,4 cat:3 rat:5A'::tsvector)` | `3` | | ``numnode(```tsquery`) | `integer` | `tsquery`中的單詞加上操作符的數量 | `numnode('(fat & rat) &#124; cat'::tsquery)` | `5` | | ``plainto_tsquery([ ```_config_` `regconfig` , ] `_query_` `text`) | `tsquery` | 產生`tsquery`忽略標點 | `plainto_tsquery('english', 'The Fat Rats')` | `'fat' & 'rat'` | | ``querytree(```_query_` `tsquery`) | `text` | 獲取`tsquery`可索引的部分 | `querytree('foo & ! bar'::tsquery)` | `'foo'` | | ``setweight(```tsvector`, `"char"`) | `tsvector` | 給`tsvector`的每個元素賦予權值 | `setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A')` | `'cat':3A 'fat':2A,4A 'rat':5A` | | ``strip(```tsvector`) | `tsvector` | 刪除`tsvector`中的位置和權值 | `strip('fat:2,4 cat:3 rat:5A'::tsvector)` | `'cat' 'fat' 'rat'` | | ``to_tsquery([ ```_config_` `regconfig` , ] `_query_` `text`) | `tsquery` | 標準化單詞并轉換為`tsquery` | `to_tsquery('english', 'The & Fat & Rats')` | `'fat' & 'rat'` | | ``to_tsvector([ ```_config_` `regconfig` , ] `_document_` `text`) | `tsvector` | 減少文檔中的文本到 `tsvector` | `to_tsvector('english', 'The Fat Rats')` | `'fat':2 'rat':3` | | ``ts_headline([ ```_config_` `regconfig`, ] `_document_` `text`, `_query_` `tsquery` [, `_options_` `text` ]) | `text` | 顯示一個查詢的匹配項 | `ts_headline('x y z', 'z'::tsquery)` | `x y &lt;b&gt;z&lt;/b&gt;` | | ``ts_rank([ ```_weights_` `float4[]`, ] `_vector_` `tsvector`, `_query_` `tsquery` [, `_normalization_` `integer` ]) | `float4` | 文檔查詢排名 | `ts_rank(textsearch, query)` | `0.818` | | ``ts_rank_cd([ ```_weights_` `float4[]`, ] `_vector_` `tsvector`, `_query_` `tsquery` [, `_normalization_` `integer` ]) | `float4` | 排序文件查詢使用覆蓋密度 | `ts_rank_cd('{0.1, 0.2, 0.4, 1.0}', textsearch, query)` | `2.01317` | | ``ts_rewrite(```_query_` `tsquery`, `_target_` `tsquery`, `_substitute_` `tsquery`) | `tsquery` | 替換帶有查詢的替代目標 | `ts_rewrite('a & b'::tsquery, 'a'::tsquery, 'foo&#124;bar'::tsquery)` | `'b' & ( 'foo' &#124; 'bar' )` | | ``ts_rewrite(```_query_` `tsquery`, `_select_` `text`) | `tsquery` | 從一條`SELECT`命令的替代目標做替換 | `SELECT ts_rewrite('a & b'::tsquery, 'SELECT t,s FROM aliases')` | `'b' & ( 'foo' &#124; 'bar' )` | | ``tsvector_update_trigger()`` | `trigger` | 自動更新`tsvector`列的觸發器函數 | `CREATE TRIGGER ... tsvector_update_trigger(tsvcol, 'pg_catalog.swedish', title, body)` | | ``tsvector_update_trigger_column()`` | `trigger` | 自動更新`tsvector`列的觸發器函數 | `CREATE TRIGGER ... tsvector_update_trigger_column(tsvcol, configcol, title, body)` | > **Note:** 所有的文本檢索函數,接受一個選項`regconfig`參數。當這個參數忽略, 使用由[default_text_search_config](#calibre_link-1138)指定的配置。 [Table 9-38](#calibre_link-2225)單獨列出的函數, 因為他們通常不用于每天的文本檢索操作。它們有助于開發調試新文本檢索配置。 **Table 9-38\. 文本檢索調試函數** | 函數 | 返回類型 | 描述 | 示例 | 結果 | | --- | --- | --- | --- | --- | | ``ts_debug([ ```_config_` `regconfig`, ] `_document_` `text`, OUT `_alias_` `text`, OUT `_description_` `text`, OUT `_token_` `text`, OUT `_dictionaries_` `regdictionary[]`, OUT `_dictionary_` `regdictionary`, OUT `_lexemes_` `text[]`) | `setof record` | 測試一個配置 | `ts_debug('english', 'The Brightest supernovaes')` | `(asciiword,"Word, all ASCII",The,{english_stem},english_stem,{}) ...` | | ``ts_lexize(```_dict_` `regdictionary`, `_token_` `text`) | `text[]` | 測試一個數據字典 | `ts_lexize('english_stem', 'stars')` | `{star}` | | ``ts_parse(```_parser_name_` `text`, `_document_` `text`, OUT `_tokid_` `integer`, OUT `_token_` `text`) | `setof record` | 測試一個解析 | `ts_parse('default', 'foo - bar')` | `(1,foo) ...` | | ``ts_parse(```_parser_oid_` `oid`, `_document_` `text`, OUT `_tokid_` `integer`, OUT `_token_` `text`) | `setof record` | 測試一個解析 | `ts_parse(3722, 'foo - bar')` | `(1,foo) ...` | | ``ts_token_type(```_parser_name_` `text`, OUT `_tokid_` `integer`, OUT `_alias_` `text`, OUT `_description_` `text`) | `setof record` | 由解析器獲取分詞類型的定義 | `ts_token_type('default')` | `(1,asciiword,"Word, all ASCII") ...` | | ``ts_token_type(```_parser_oid_` `oid`, OUT `_tokid_` `integer`, OUT `_alias_` `text`, OUT `_description_` `text`) | `setof record` | 由解析器獲取分詞類型的定義 | `ts_token_type(3722)` | `(1,asciiword,"Word, all ASCII") ...` | | ``ts_stat(```_sqlquery_` `text`, [ `_weights_` `text`, ] OUT `_word_` `text`, OUT `_ndoc_` `integer`, OUT `_nentry_` `integer`) | `setof record` | 獲取`tsvector`列的統計數據 | `ts_stat('SELECT vector from apod')` | `(foo,10,15) ...` |
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看