From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | Moe <mohamed5432154321(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Searching a DB index.. possible? |
Date: | 2010-02-11 17:20:41 |
Message-ID: | 4B743C69.805@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 11/02/10 17:11, Moe wrote:
>> You might want to summarize down to a separate (word,frequency) table.
>> Particularly if you don't want stemming to interfere with your suggestions.
>
> Stemming is ok. That's fine.
>
> How would this normally be implemented? Should I go through my text word by
> word myself, or the already existing index and copy over to a new table? Not
> sure how this would be managable. Every change to something would require a
> word count down, and then a word up after.
I wouldn't bother keeping it 100% up-to-date. You only want the
most-plausible suggestions anyway. Have a look at the ts_stat() function.
http://www.postgresql.org/docs/8.4/interactive/textsearch-features.html
Run it overnight, and summarise to a separate table, then just use
"like" against it.
Otherwise, like you say, your database will spend most of its time
adding up word counts etc.
--
Richard Huxton
Archonet Ltd
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Kretschmer | 2010-02-11 17:24:33 | Re: Postgres Triggers issue |
Previous Message | A. Kretschmer | 2010-02-11 17:15:19 | Re: Postgres Triggers issue |