array_to_tsvector ( text[] ) → tsvector 將詞素數群組轉換為tsvector。給定的字串按原樣使用,不做進一步處理。 array_to_tsvector('{fat,cat,rat}'::text[]) → 'cat' 'fat' 'rat'
|
get_current_ts_config ( ) → regconfig 返回當前預設文本搜尋配置的OID(由 default_text_search_config 所設定的) 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) | cat'::tsquery) → 5
|
plainto_tsquery ( [ config regconfig, ] query text ) → tsquery 將文本轉換為tsquery,根據指定的或預設配置對單詞進行標準化。 字串中的任何標點符號都會被忽略(它不決定查詢操作符)。結果查詢匹配文本中包含所有非停止詞的文檔。 plainto_tsquery('english', 'The Fat Rats') → 'fat' & 'rat'
|
phraseto_tsquery ( [ config regconfig, ] query text ) → tsquery 將文本轉換為tsquery,根據指定的或預設配置對單詞進行標準化。 字串中的任何標點符號都會被忽略(它不決定查詢操作符)。結果查詢匹配包含文本中所有非停止詞的短語。 phraseto_tsquery('english', 'The Fat Rats') → 'fat' <-> 'rat'
phraseto_tsquery('english', 'The Cat and Rats') → 'cat' <2> 'rat'
|
websearch_to_tsquery ( [ config regconfig, ] query text ) → tsquery 將文本轉換為tsquery,根據指定的或預設配置對單詞進行標準化。引用的單詞序列被轉換為短語測試。 “or”一詞被理解為產生OR操作符,而破折號產生NOT操作符;其他標點符號被忽略。這類似於一些常見的網路搜尋工具的行為。 websearch_to_tsquery('english', '"fat rat" or cat dog') → 'fat' <-> 'rat' | 'cat' & 'dog'
|
querytree ( tsquery ) → text 產生tsquery的可轉位部分的表示。結果為空白或僅為T表示不可索引查詢。 querytree('foo & ! bar'::tsquery) → 'foo'
|
setweight ( vector tsvector, weight "char" ) → tsvector 將指定的weight賦給vector的每個元素。 setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A') → 'cat':3A 'fat':2A,4A 'rat':5A
|
setweight ( vector tsvector, weight "char", lexemes text[] ) → tsvector 將指定的weight賦給列在lexemes中的vector元素。 setweight('fat:2,4 cat:3 rat:5,6B'::tsvector, 'A', '{cat,rat}') → 'cat':3A 'fat':2,4 'rat':5A,6A
|
strip ( tsvector ) → tsvector 從tsvector中移除位置和權重。 strip('fat:2,4 cat:3 rat:5A'::tsvector) → 'cat' 'fat' 'rat'
|
to_tsquery ( [ config regconfig, ] query text ) → tsquery 將文本轉換為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
|
to_tsvector ( [ config regconfig, ] document json ) → tsvector
to_tsvector ( [ config regconfig, ] document jsonb ) → tsvector
將JSON文檔中的每個字串值轉換為tsvector,根據指定的或預設配置對單詞進行標準化。 然後將結果按文檔順序串連起來以產生輸出。位置資訊就像在每對字串值之間存在一個停止詞一樣產生。 (注意,當輸入為jsonb時,JSON對象的欄位的“document order”取決於實現;請觀察這些例子中的差異) to_tsvector('english', '{"aa": "The Fat Rats", "b": "dog"}'::json) → 'dog':5 'fat':2 'rat':3
to_tsvector('english', '{"aa": "The Fat Rats", "b": "dog"}'::jsonb) → 'dog':1 'fat':4 'rat':5
|
json_to_tsvector ( [ config regconfig, ] document json, filter jsonb ) → tsvector jsonb_to_tsvector ( [ config regconfig, ] document jsonb, filter jsonb ) → tsvector 選擇filter請求的JSON文檔中的每個項,並將每個項轉換為tsvector,根據指定的或預設配置對單詞進行標準化。 然後將結果按文檔順序串連起來以產生輸出。位置資訊就像在每對選定的專案之間存在一個停止詞一樣產生。 (注意,當輸入為jsonb時,JSON對象欄位的“document order”取決於實現) filter必須是一個jsonb數組,其中包含0個或多個關鍵字: "string"(包括所有字串值), "numeric"(包括所有數值),"boolean"(包括所有布爾值),"key"(包括所有鍵),或 "all"(包括以上所有關鍵字)。 作為一種特殊情況,該filter也可以是這些關鍵字之一的簡單JSON值。 json_to_tsvector('english', '{"a": "The Fat Rats", "b": 123}'::json, '["string", "numeric"]') → '123':5 'fat':2 'rat':3
json_to_tsvector('english', '{"cat": "The Fat Rats", "dog": 123}'::json, '"all"') → '123':9 'cat':1 'dog':7 'fat':4 'rat':5
|
ts_delete ( vector tsvector, lexeme text ) → tsvector 從vector中刪除任何出現的給定lexeme。 ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, 'fat') → 'cat':3 'rat':5A
|
ts_delete ( vector tsvector, lexemes text[] ) → tsvector
從vector中刪除lexemes中出現的任何詞位。 ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, ARRAY['fat','rat']) → 'cat':3
|
ts_filter ( vector tsvector, weights "char"[] ) → tsvector 只從vector中選擇具有給定weights的元素。 ts_filter('fat:2,4 cat:3b,7c rat:5A'::tsvector, '{a,b}') → 'cat':3B 'rat':5A
|
ts_headline ( [ config regconfig, ] document text, query tsquery [, options text ] ) → text 以縮寫形式顯示document中query的匹配項,該匹配項必須是原始文本,而不是tsvector。 在匹配查詢之前,文檔中的單詞將根據指定的或預設的配置進行正常化。 ts_headline('The fat cat ate the rat.', 'cat') → The fat <b>cat</b> ate the rat.
|
ts_headline ( [ config regconfig, ] document json, query tsquery [, options text ] ) → text
ts_headline ( [ config regconfig, ] document jsonb, query tsquery [, options text ] ) → text
以縮寫形式顯示匹配JSONdocument中字串值中的query。 ts_headline('{"cat":"raining cats and dogs"}'::jsonb, 'cat') → {"cat": "raining <b>cats</b> and dogs"}
|
ts_rank ( [ weights real[], ] vector tsvector, query tsquery [, normalization integer ] ) → real 計算一個分數,顯示vector與query的匹配程度。 ts_rank(to_tsvector('raining cats and dogs'), 'cat') → 0.06079271
|
ts_rank_cd ( [ weights real[], ] vector tsvector, query tsquery [, normalization integer ] ) → real 使用覆蓋密度演算法計算一個分數,顯示vector與query的匹配程度。 ts_rank_cd(to_tsvector('raining cats and dogs'), 'cat') → 0.1
|
ts_rewrite ( query tsquery, target tsquery, substitute tsquery ) → tsquery 在query中使用 substitute替換出現的target。 ts_rewrite('a & b'::tsquery, 'a'::tsquery, 'foo|bar'::tsquery) → 'b' & ( 'foo' | 'bar' )
|
ts_rewrite ( query tsquery, select text ) → tsquery
根據目標替換部分query,並替換通過執行SELECT命令獲得的查詢。 SELECT ts_rewrite('a & b'::tsquery, 'SELECT t,s FROM aliases') → 'b' & ( 'foo' | 'bar' )
|
tsquery_phrase ( query1 tsquery, query2 tsquery ) → tsquery 構造一個短語查詢,在連續的詞位上搜尋query1和query2的匹配項(與<->操作符相同)。 tsquery_phrase(to_tsquery('fat'), to_tsquery('cat')) → 'fat' <-> 'cat'
|
tsquery_phrase ( query1 tsquery, query2 tsquery, distance integer ) → tsquery
構造一個短語查詢,用於搜尋query1和query2的匹配項,這些匹配項恰好出現在distance詞位之間。 tsquery_phrase(to_tsquery('fat'), to_tsquery('cat'), 10) → 'fat' <10> 'cat'
|
tsvector_to_array ( tsvector ) → text[] 將tsvector轉換為詞位的數組。 tsvector_to_array('fat:2,4 cat:3 rat:5A'::tsvector) → {cat,fat,rat}
|
unnest ( tsvector ) → setof record ( lexeme text, positions smallint[], weights text ) 將tsvector展開為一組行,每個行對應一個詞位。 select * from unnest('cat:3 fat:2,4 rat:5A'::tsvector) →
|