Search Postgresql Archives

Re: tsearch2: more than one index per table?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 23 November 2005 06:55, Rick Schumeyer wrote:
> I apologize if I'm being dense, but I'm not completely following the
> explanation.  It is true that my pg_ts_cfg.locale is set to en_US.UTF-8.
>
> It was my understanding that specifying "default" as in
>

That takes the locale that is specified in the tsearch2 configuration called 
"default";

take a look at this :

ftstest=# select * from pg_ts_cfg;
     ts_name     | prs_name |    locale
-----------------+----------+--------------
 default         | default  | C
 default_russian | default  | ru_RU.KOI8-R
 simple          | default  |
 custom          | default  |

If you don't have a record in that table that matches the server encoding 
(en_US.UTF-8), you need to create a new configuration to use that locale.  
That's all describe in the link I sent before.

If you have a configuration you always want to use you can just switch to that 
configuration.

If you do something like this :

ftstest=# select set_curcfg('simple');
 set_curcfg
------------

(1 row)

ftstest=# select to_tsvector('simple', 'a simple test');
        to_tsvector
---------------------------
 'a':1 'test':3 'simple':2
(1 row)

ftstest=# select to_tsvector('a simple test');
        to_tsvector
---------------------------
 'a':1 'test':3 'simple':2
(1 row)

ftstest=# select to_tsvector('default', 'a simple test');
    to_tsvector
--------------------
 'test':3 'simpl':2
(1 row)


The second example does not specify a configuration, but because you set in 
the set_curcfg statement it knows to use the "simple" configuration.



> UPDATE t SET idxB=to_tsvector('default', b);
>

This forces a configuration called "default"

> UPDATE t SET idxB=to_tsvector(b); -- no 'default'
>

This doesn't tell it which configuration to use, so it tries to find one that 
matches your locale (en_US.UTF-8).  There probably isn't one in pg_ts_cfg, so 
it gives the error.




hth,



Andy


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux