2016-06-28 1 views

答えて

2

空のストップワードファイルを使用してsimple辞書を試しましたか?

空のストップワードファイル$(pg_config --sharedir)/tsearch_data/empty.stopを作成し、実行します。

CREATE TEXT SEARCH DICTIONARY machine (
    TEMPLATE = pg_catalog.simple, 
    STOPWORDS = empty 
); 

CREATE TEXT SEARCH CONFIGURATION machine (
    PARSER = default 
); 

ALTER TEXT SEARCH CONFIGURATION machine 
    ADD MAPPING FOR asciiword, word, numword, asciihword, hword, 
        numhword, hword_asciipart, hword_part, 
        hword_numpart, email, protocol, url, host, 
        url_path, file, sfloat, float, int, uint, 
        version, tag, entity, blank 
    WITH machine; 

次に、あなたが得ることができる:

test=> SELECT * FROM ts_debug('machine', 'move'); 
    alias | description | token | dictionaries | dictionary | lexemes 
-----------+-----------------+-------+--------------+------------+--------- 
asciiword | Word, all ASCII | move | {machine} | machine | {move} 
(1 row) 

あなたは、デフォルトでこの設定をしたい場合は(あなたが'machine'を指定する必要はありません常に)、パラメータdefault_text_search_configを適切に変更します。

+0

ありがとう!しかし、これはXMLフィールドで動作しますか? –

+1

それはXMLでうまくいくはずです。 –

関連する問題