using Tsearch2 for chemical text - Mailing list pgsql-general

From Rajarshi Guha
Subject using Tsearch2 for chemical text
Date
Msg-id B598BF62-435A-44D6-B602-5C6077333858@indiana.edu
Whole thread Raw
Responses Re: using Tsearch2 for chemical text  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: using Tsearch2 for chemical text  ("Dann Corbit" <DCorbit@connx.com>)
Re: using Tsearch2 for chemical text  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-general
Hi, I have a table with about 9M entries. The table has 2 fields: id
and name which are of serial and text types respectively. I have a
ordinary index on the text field which allows me to do searches in
reasonable time. Most of my searches are of the form

select * from mytable where name ~ 'some text query'

I know that the Tsearch2 module will let me have very efficient text
searches. But if I understand correctly, it's based on a language
specific dictionary.

My problem is that the name column contains names of chemicals. Now
for many cases this may simply be a number (1674-56-2) and in other
cases it may be an alphanumeric string (such as (-)O-acetylcarnitine
or 1,2-cis-dihydroxybenzoate). In some cases it is a well-known word
(say viagra or calcium  chloride or pentathol).

My question is: will Tsearch2 be able to handle this type of text? Or
will it be hampered by the fact that the bulk of the rows do not
correspond to ordinary English

-------------------------------------------------------------------
Rajarshi Guha  <rguha@indiana.edu>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04  06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
My Ethicator machine must have had a built-in moral
compromise spectral phantasmatron! I'm a genius."
                 -Calvin



pgsql-general by date:

Previous
From: Geoffrey
Date:
Subject: upgrade to 8.2.? or implement Slony, which first?
Next
From: Tom Lane
Date:
Subject: Re: using Tsearch2 for chemical text