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() → 英語
|
length (tsvector) → integer
tsvector内の語彙の数を返します。
长さ ('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演算子を生成し、他の句読点は無視される。 これは、いくつかの一般的なweb検索ツールの動作に近い。 websearch_to_tsquery('english' 、'"fat rat" またはcat dog') → 'fat' <-> 'rat' | 'cat' & 'dog'
|
querytree (tsquery) → text
tsqueryのインデックス可能な部分の表現を生成します。 空またはTだけの結果は、インデックス不可能なクエリを示します。
querytree('foo & !) bar'::tsquery) → 'foo'
|
seitweight (vector tsvector, weight "char") → tsvector
指定した重みをvectorの各要素に割り当てます。 seitweight ('fat:2,4 cat:3 rat:5B'::tsvector、'A') → 'cat':3A 'fat ':2A、4A 'rat':5A
|
seitweight (vector tsvector、weight "char" 、lexemes text[]) → tsvector
指定されたウェイトを、語彙素にリストされたベクトルの要素に割り当てます。 seweight ('fat:2,4 cat:3 rat:5,6B '::tsvector, 'A', '{cat,rat}') → 'cat':3A 'fat':2,4 'rat':5A,6A
|
ストリップ (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に変換し、指定された設定またはデフォルトの設定に従って単語を正規化します。 次に、結果をドキュメント順に連結して出力を生成します。 位置情報は、ストリング値の各対の間に1つのストップワードが存在するかのように生成される。 (入力がjsonbの場合、JSONオブジェクトのフィールドの「ドキュメント順序」は実装に依存することに注意してください。例の違いを確認してください。) 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に変換します。 次に、結果をドキュメント順に連結して出力を生成します。 選択されたアイテムの各ペア間に1つのストップワードが存在するかのように位置情報が生成される。 (入力がjsonbの場合、JSONオブジェクトのフィールドの「ドキュメント順序」は実装に依存することに注意してください。) フィルターは、"string" (すべての文字列値を含める) 、"numeric" (すべての数値を含める) 、"boolean" (すべてのブール値を含める) 、"key" (すべてのキーを含める) 、または "all" (上記のすべてを含む) 。 特殊なケースとして、フィルターはこれらのキーワードの1つである単純な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
指定された語彙素の出現をベクトルから削除します。 ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, 'fat') → 'cat':3 'rat':5A
|
ts_delete (vector tsvector, lexemes text[]) → tsvector
ベクトルから語彙素内の語彙素の出現を削除します。
ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, ARRAY['fat','rat']) → 'cat':3
|
ts_filter (vector tsvector, weights "char"[]) → tsvector
ベクトルから指定された重みを持つ要素のみを選択します。
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内のクエリの一致を省略形式で表示します。これはtsvectorではなく生のテキストでなければなりません。 ドキュメント内の単語は、クエリに一致する前に、指定された構成またはデフォルトの構成に従って正規化されます。
ts_headline('The fat cat atate the rat.'、'cat') → The fat <b>cat</b> tate the rat.
|
ts_headline ( [config regconfig ,] document json, query tsquery [, options text] ) → text
ts_headline ( [config regconfig ,] document jsonb, query tsquery [, options text] ) → text
JSONドキュメント内の文字列値で発生するクエリの一致を省略形式で表示します。 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
ベクトルがクエリにどれだけ一致するかを示すスコアを計算します。
ts_rank(to_tsvector('raining cats and dogs'), 'cat') → 0.06079271
|
ts_rank_cd ( [weights real[] ,] vector tsvector, query tsquery [, normalization integer] ) → real
カバー密度アルゴリズムを使用して、ベクトルがクエリにどれだけよく一致するかを示すスコアを計算します。 ts_rank_cd(to_tsvector('raining cats and dogs'), 'cat') → 0.1
|
ts_rewrite (query tsquery, target tsquery, replacement tsquery) → tsquery
targetの出現をクエリ内の代替に置き換えます。
ts_rewrite('a & b'::tsquery、'a'::tsquery、'foo | bar'::tsquery) → 'b' & ( 'foo' | 'bar' )
|
ts_rewrite (query tsquery, select text) → tsquery
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の一致を検索するフレーズクエリを作成します。このクエリは、正確に距離のある語彙で発生します。
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) →
lexeme | 位置 | 重み
------- ----------- ----------------
cat | {3} | {D}
fat | {2,4} | {D、D}
rat | {5} | {A}
|