Thread: accessing the words in a full text index

accessing the words in a full text index

From
"Massa, Harald Armin"
Date:

I want to provide a "suggest word as you type" feature in an application (like google suggest). 
All the documents are - of course - stored within a PostgreSQL database, within TEXT columns.

To provide those suggestions, I need a list of all words, together with a number indicating the number of occurences. (to show that "fire" is more likely for start of "fi" then "finally")

Those informations should allready be present within the Full Text Index if I create one for that column. Also FTI should take care of transfering words from phrases.

SO: can I access this information anyhow via SQL-functions? 

Or do I have to store that information additionallly by myself in a helper table?

Best wishes,

Harald




--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
no fx, no carrier pigeon
-
%s is too gigantic of an industry to bend to the whims of reality

Re: accessing the words in a full text index

From
Dimitri Fontaine
Date:
"Massa, Harald Armin" <chef@ghum.de> writes:

> I want to provide a "suggest word as you type" feature in an application (like google suggest). 
> All the documents are - of course - stored within a PostgreSQL
> database, within TEXT columns.

See pg_trgm.

  http://www.postgresql.org/docs/8.4/static/pgtrgm.html

Regards,
--
dim