Search Postgresql Archives

Re: TSearch queries with multiple languages

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

 



Gordon Callan <gordon_callan@xxxxxxxxxxx> writes:
> Next we create an index on the ts_vector column:
>  CREATE INDEX node_ts_body on node USING gin(ts_body);

> From the documentation, it seems this index will know what config each row has.  

No, actually the index doesn't know and doesn't care.  The tsvector
representation is language-independent --- it contains "just strings".
All the language-dependent processing happens during reduction of the
document text to tsvector (or reduction of a search string to tsquery).
So if words from different languages happen to reduce to the same
string, searches in both languages will find that entry.

Usually this works the way people want; but if not, you could add an
additional WHERE condition to your queries to match only documents in
the desired language.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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