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}
|