Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/oscon_tsearch2/to_tsquery.html
Дата изменения: Unknown
Дата индексирования: Sat Dec 22 10:28:02 2007
Кодировка:

Поисковые слова: южная атлантическая аномалия
Open Source Convention
 Previous   Next 

Function to_tsquery

Converts a boolean search condition containing words into a tsquery (text search query) data type of lexemes or word stems that has been processed by dictionaries specified by a configuration.

to_tsquery([configuration OID | TEXT, ] query TEXT) RETURNS TSQUERY

  • If specified, 'configuration' is the oid or text name of a configuration listed in table pg_ts_cfg.
  • 'query' is a text string of words join by boolean operators such as '|', '&', and '!' which stand for 'or', 'and', and 'not', respectively.
SELECT set_curcfg('default');

 set_curcfg
------------

(1 row)

SELECT * 
FROM to_tsquery('database | query');
     
     to_tsquery
---------------------
 'databas' | 'queri'
(1 row)

SELECT line 
FROM ts_readme 
WHERE ts_vec @@ to_tsquery('database & query');
                                     
				     line
-------------------------------------------------------------------------------
     tsearch2 as a storage, while database engine is used as a query executor
     (documents could be stored in file system), database and query engine.
(2 rows)

SELECT line 
FROM ts_readme 
WHERE ts_vec @@ to_tsquery('database & (query | index) & !storage');

                                     line
-------------------------------------------------------------------------------
           superimposed signature (see "Index Structures for Databases
     (documents could be stored in file system), database and query engine.
(2 rows)