.
Friday, 16. January 2009, 15:16:23
Then love, love will tear us apart again
Baby steps to a lovely web
Friday, 16. January 2009, 15:16:23
Friday, 28. November 2008, 10:33:00
Saturday, 8. November 2008, 10:37:29
PURGE MASTER LOGS BEFORE '2008-11-07 22:46:26'
Wednesday, 29. October 2008, 12:28:12
Tuesday, 21. October 2008, 20:04:16
Friday, 17. October 2008, 16:54:22
generate_config_for_modelque gera o arquivo de configuração para você, vale a pena dar uma olhada.
#classe base com informações de conexão
source base
{
type= pgsql
sql_host= 1.1.1.0
sql_user= user
sql_pass= password
sql_db= dbname
sql_port= 5432
}
#índice de notícias de hoje
source news_current : base
{
sql_query= \
SELECT id, section_id, DATE_PART('epoch',published_date) as published_date, headline, story \
FROM news_news WHERE published_date >= (current_date)
sql_attr_uint= section_id
sql_attr_timestamp= published_date
sql_query_info= SELECT * FROM news_news WHERE id=$id
}
index news_latest
{
source= news_current
path= /var/data/news_general
docinfo= extern
charset_type= utf-8
}
#índice de notícias dos últimos 30 dias
source news_thisyear : base
{
sql_query= \
SELECT id, section_id, DATE_PART('epoch',published_date) as published_date, headline, story \
FROM news_news WHERE published_date >= (TIMESTAMP '2008-01-01 00:00:00') \
and published_date < (current_date)
sql_attr_uint= section_id
sql_attr_timestamp= published_date
sql_query_info= SELECT * FROM news_news WHERE id=$id
}
index news_recent
{
source= news_thisyear
path= /var/data/news_recent
docinfo= extern
charset_type= utf-8
}
indexer --nome_indicee pode ficar algum conteúdo desatualizado.
Abstract: We're using Postgresql and Sphinx for our searches and it has been great. Really fast and reliable. We could get it done quickly following David Cramer's post but I want to point some things:
1st: On sphinx.conf, use a base class for your database connection and extends your indexes from it.
2nd: Split big queries that can change and those that probably won't change so soon. We have a News site so we have one index for today, for the last 30 days and one archive. So we just have to index every 5 minute a small amount of data that must be keep up to date, and on bigger intervals for the rest of them.
3rd: To use timestamp fields on your index, make sure you are using DATE_PART('epoch',published_date) so it will be converted to integer as Sphinx expects. There's also a problem with boolean fields as mentioned here.
Thursday, 16. October 2008, 19:27:52
Wednesday, 8. October 2008, 21:14:38
Wednesday, 8. October 2008, 12:24:17
Sunday, 28. September 2008, 14:23:21
Showing posts 41 - 50 of 67.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
|
| ||||||
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Manage your expenses
Your list to getting things done
vegetarian recipes
watch some django videos
weekly django podcast