Re: Searching a DB index.. possible?
От | Richard Huxton |
---|---|
Тема | Re: Searching a DB index.. possible? |
Дата | |
Msg-id | 4B743C69.805@archonet.com обсуждение исходный текст |
Ответ на | Re: Searching a DB index.. possible? (Moe <mohamed5432154321@gmail.com>) |
Список | 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
В списке pgsql-general по дате отправления: