خرید بک لینک

Vote count: 0

The postgres documentation here explains the numhword parser as one that matches Hyphenated word, letters and digits. The example they give for this is postgres-beta1 and this matches nicely. However, somethnig such as postgres-9-beta1 does not match, and i can't seem to find a default parser that will work with this. SQL below.

Is my best choice something that parsed just on spaces? Is there such a default parser? (It seems test_parser doesn't ship with 9.5 anymore...)

I want to tokenize alphanumerics, hyphenated. Am I stuck with regular expressions for the time being, or is there a straightforward way to create a customer parser (without dropping down into C) ?

CREATE TEXT SEARCH DICTIONARY simple_nostem_no_stop (TEMPLATE = pg_catalog.simple);
CREATE TEXT SEARCH CONFIGURATION test_id_search ( COPY = pg_catalog.simple );

alter text search configuration test_id_search
drop mapping for asciihword, asciiword, email, file, float, host, hword, hword_asciipart, hword_numpart, hword_part, int, numhword, numword, sfloat, uint, url, url_path, version, word  ;

ALTER TEXT SEARCH CONFIGURATION test_id_search
ALTER MAPPING FOR numhword WITH simple_nostem_no_stop;

dF+ test_id_search

Text search configuration "public.test_id_search"
Parser: "pg_catalog.default"
Token    |     Dictionaries
---------+-----------------------
numhword | simple_nostem_no_stop

/* This works as i hoped, per the docs:  */
    test_db=# select to_tsvector('test_id_search', ' postgresql-beta1 ') ;
    to_tsvector
    ----------------------
    'postgresql-beta1':1
    (1 row)

/* This doesn't seem to work? */
    test_db=# select to_tsvector('test_id_search', ' postgresql-9-beta1 ') ;
    to_tsvector
    -------------

    (1 row)

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 10 ارديبهشت 1395 ساعت: 3:31

صفحه بندی