Skip to main content
deleted 12 characters in body
Source Link
user1822
user1822

when I only have english. I use such way.

1. add a new english_column to store tsvector. 
2. create gin index on the english_column.
3. create trigger on insert or update.
  1. add a new english_column to store tsvector.
  2. create gin index on the english_column.
  3. create trigger on insert or update.

However. When I want to support other language. This method need create 3 new column. And query the pattern for 3 different language like

select * from where 
   english_column @@ to_tsquery('english', pattern) or 
   german_column  @@ to_tsquery('german', pattern) 

Can I keep only one new index column to support multi language?

something change like this

CREATE TEXT SEARCH DICTIONARY multi_stem_nostop (
    Template = snowball
  , Language = english, german, spanish
);

CREATE TEXT SEARCH CONFIGURATION public.multi_nostop ( COPY = pg_catalog.english, pg_catalog.german );

Or I got misunderstanding for the dictionary?

when I only have english. I use such way.

1. add a new english_column to store tsvector. 
2. create gin index on the english_column.
3. create trigger on insert or update.

However. When I want to support other language. This method need create 3 new column. And query the pattern for 3 different language like

select * from where 
   english_column @@ to_tsquery('english', pattern) or 
   german_column  @@ to_tsquery('german', pattern) 

Can I keep only one new index column to support multi language?

something change like this

CREATE TEXT SEARCH DICTIONARY multi_stem_nostop (
    Template = snowball
  , Language = english, german, spanish
);

CREATE TEXT SEARCH CONFIGURATION public.multi_nostop ( COPY = pg_catalog.english, pg_catalog.german );

Or I got misunderstanding for the dictionary?

when I only have english. I use such way.

  1. add a new english_column to store tsvector.
  2. create gin index on the english_column.
  3. create trigger on insert or update.

However. When I want to support other language. This method need create 3 new column. And query the pattern for 3 different language like

select * from where 
   english_column @@ to_tsquery('english', pattern) or 
   german_column  @@ to_tsquery('german', pattern) 

Can I keep only one new index column to support multi language?

something change like this

CREATE TEXT SEARCH DICTIONARY multi_stem_nostop (
    Template = snowball
  , Language = english, german, spanish
);

CREATE TEXT SEARCH CONFIGURATION public.multi_nostop ( COPY = pg_catalog.english, pg_catalog.german );

Or I got misunderstanding for the dictionary?

Source Link
jiamo
  • 139
  • 6

The good method for full text search on one column may contain multi languages?

when I only have english. I use such way.

1. add a new english_column to store tsvector. 
2. create gin index on the english_column.
3. create trigger on insert or update.

However. When I want to support other language. This method need create 3 new column. And query the pattern for 3 different language like

select * from where 
   english_column @@ to_tsquery('english', pattern) or 
   german_column  @@ to_tsquery('german', pattern) 

Can I keep only one new index column to support multi language?

something change like this

CREATE TEXT SEARCH DICTIONARY multi_stem_nostop (
    Template = snowball
  , Language = english, german, spanish
);

CREATE TEXT SEARCH CONFIGURATION public.multi_nostop ( COPY = pg_catalog.english, pg_catalog.german );

Or I got misunderstanding for the dictionary?