postgresql - Can I disable dictionary in postgres ts_vector / ts_query full text search? -
i need text search on machine language. if use of available text search dictonaries, ts_vectors messing up.
ex. move -> becomes mov , searching failing.
any idea how index non- lingual words?
thanks!
have tried simple
dictionary empty stop word file?
create empty stop word file $(pg_config --sharedir)/tsearch_data/empty.stop
, run:
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 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 machine;
then can get:
test=> select * ts_debug('machine', 'move'); alias | description | token | dictionaries | dictionary | lexemes -----------+-----------------+-------+--------------+------------+--------- asciiword | word, ascii | move | {machine} | machine | {move} (1 row)
if want configuration default (so don't have specify 'machine'
time), change parameter default_text_search_config
appropriately.
Comments
Post a Comment