Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
This commit is contained in:
commit
2c4486401d
@ -118,12 +118,20 @@ class MySQLSearch extends SearchEngine
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if ('identica_notices' === $this->table) {
|
} else if ('identica_notices' === $this->table) {
|
||||||
$this->target->whereAdd('MATCH(content) ' .
|
|
||||||
'AGAINST (\''.addslashes($q).'\' IN BOOLEAN MODE)');
|
// Don't show imported notices
|
||||||
|
$this->target->whereAdd('notice.is_local != ' . NOTICE_GATEWAY);
|
||||||
|
|
||||||
if (strtolower($q) != $q) {
|
if (strtolower($q) != $q) {
|
||||||
|
$this->target->whereAdd("( MATCH(content) AGAINST ('" . addslashes($q) .
|
||||||
|
"' IN BOOLEAN MODE)) OR ( MATCH(content) " .
|
||||||
|
"AGAINST ('" . addslashes(strtolower($q)) .
|
||||||
|
"' IN BOOLEAN MODE))");
|
||||||
|
} else {
|
||||||
$this->target->whereAdd('MATCH(content) ' .
|
$this->target->whereAdd('MATCH(content) ' .
|
||||||
'AGAINST (\''.addslashes(strtolower($q)).'\' IN BOOLEAN MODE)', 'OR');
|
'AGAINST (\''.addslashes($q).'\' IN BOOLEAN MODE)');
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
throw new ServerException('Unknown table: ' . $this->table);
|
throw new ServerException('Unknown table: ' . $this->table);
|
||||||
@ -160,6 +168,9 @@ class PGSearch extends SearchEngine
|
|||||||
if ('identica_people' === $this->table) {
|
if ('identica_people' === $this->table) {
|
||||||
return $this->target->whereAdd('textsearch @@ plainto_tsquery(\''.addslashes($q).'\')');
|
return $this->target->whereAdd('textsearch @@ plainto_tsquery(\''.addslashes($q).'\')');
|
||||||
} else if ('identica_notices' === $this->table) {
|
} else if ('identica_notices' === $this->table) {
|
||||||
|
|
||||||
|
// XXX: We need to filter out gateway notices (notice.is_local = -2) --Zach
|
||||||
|
|
||||||
return $this->target->whereAdd('to_tsvector(\'english\', content) @@ plainto_tsquery(\''.addslashes($q).'\')');
|
return $this->target->whereAdd('to_tsvector(\'english\', content) @@ plainto_tsquery(\''.addslashes($q).'\')');
|
||||||
} else {
|
} else {
|
||||||
throw new ServerException('Unknown table: ' . $this->table);
|
throw new ServerException('Unknown table: ' . $this->table);
|
||||||
|
@ -24,7 +24,8 @@ SDIR=`dirname $0`
|
|||||||
DIR=`php $SDIR/getpiddir.php`
|
DIR=`php $SDIR/getpiddir.php`
|
||||||
|
|
||||||
for f in jabberhandler ombhandler publichandler smshandler pinghandler \
|
for f in jabberhandler ombhandler publichandler smshandler pinghandler \
|
||||||
xmppconfirmhandler xmppdaemon twitterhandler facebookhandler; do
|
xmppconfirmhandler xmppdaemon twitterhandler facebookhandler \
|
||||||
|
twitterstatusfetcher; do
|
||||||
|
|
||||||
FILES="$DIR/$f.*.pid"
|
FILES="$DIR/$f.*.pid"
|
||||||
for ff in "$FILES" ; do
|
for ff in "$FILES" ; do
|
||||||
|
@ -4,68 +4,68 @@
|
|||||||
|
|
||||||
source src1
|
source src1
|
||||||
{
|
{
|
||||||
type = mysql
|
type = mysql
|
||||||
sql_host = localhost
|
sql_host = localhost
|
||||||
sql_user = USERNAME
|
sql_user = USERNAME
|
||||||
sql_pass = PASSWORD
|
sql_pass = PASSWORD
|
||||||
sql_db = identi_ca
|
sql_db = identi_ca
|
||||||
sql_port = 3306
|
sql_port = 3306
|
||||||
sql_query = SELECT id, UNIX_TIMESTAMP(created) as created_ts, nickname, fullname, location, bio, homepage FROM profile
|
sql_query = SELECT id, UNIX_TIMESTAMP(created) as created_ts, nickname, fullname, location, bio, homepage FROM profile
|
||||||
sql_query_info = SELECT * FROM profile where id = $id
|
sql_query_info = SELECT * FROM profile where id = $id
|
||||||
sql_attr_timestamp = created_ts
|
sql_attr_timestamp = created_ts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
source src2
|
source src2
|
||||||
{
|
{
|
||||||
type = mysql
|
type = mysql
|
||||||
sql_host = localhost
|
sql_host = localhost
|
||||||
sql_user = USERNAME
|
sql_user = USERNAME
|
||||||
sql_pass = PASSWORD
|
sql_pass = PASSWORD
|
||||||
sql_db = identi_ca
|
sql_db = identi_ca
|
||||||
sql_port = 3306
|
sql_port = 3306
|
||||||
sql_query = SELECT id, UNIX_TIMESTAMP(created) as created_ts, content FROM notice
|
sql_query = SELECT id, UNIX_TIMESTAMP(created) as created_ts, content FROM notice
|
||||||
sql_query_info = SELECT * FROM notice where id = $id
|
sql_query_info = SELECT * FROM notice where notice.id = $id AND notice.is_local != -2
|
||||||
sql_attr_timestamp = created_ts
|
sql_attr_timestamp = created_ts
|
||||||
}
|
}
|
||||||
|
|
||||||
index identica_notices
|
index identica_notices
|
||||||
{
|
{
|
||||||
source = src2
|
source = src2
|
||||||
path = DIRECTORY/data/identica_notices
|
path = DIRECTORY/data/identica_notices
|
||||||
docinfo = extern
|
docinfo = extern
|
||||||
charset_type = utf-8
|
charset_type = utf-8
|
||||||
min_word_len = 3
|
min_word_len = 3
|
||||||
stopwords = DIRECTORY/data/stopwords-en.txt
|
stopwords = DIRECTORY/data/stopwords-en.txt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
index identica_people
|
index identica_people
|
||||||
{
|
{
|
||||||
source = src1
|
source = src1
|
||||||
path = DIRECTORY/data/identica_people
|
path = DIRECTORY/data/identica_people
|
||||||
docinfo = extern
|
docinfo = extern
|
||||||
charset_type = utf-8
|
charset_type = utf-8
|
||||||
min_word_len = 3
|
min_word_len = 3
|
||||||
stopwords = DIRECTORY/data/stopwords-en.txt
|
stopwords = DIRECTORY/data/stopwords-en.txt
|
||||||
}
|
}
|
||||||
|
|
||||||
indexer
|
indexer
|
||||||
{
|
{
|
||||||
mem_limit = 32M
|
mem_limit = 32M
|
||||||
}
|
}
|
||||||
|
|
||||||
searchd
|
searchd
|
||||||
{
|
{
|
||||||
port = 3312
|
port = 3312
|
||||||
log = DIRECTORY/log/searchd.log
|
log = DIRECTORY/log/searchd.log
|
||||||
query_log = DIRECTORY/log/query.log
|
query_log = DIRECTORY/log/query.log
|
||||||
read_timeout = 5
|
read_timeout = 5
|
||||||
max_children = 30
|
max_children = 30
|
||||||
pid_file = DIRECTORY/log/searchd.pid
|
pid_file = DIRECTORY/log/searchd.pid
|
||||||
max_matches = 1000
|
max_matches = 1000
|
||||||
seamless_rotate = 1
|
seamless_rotate = 1
|
||||||
preopen_indexes = 0
|
preopen_indexes = 0
|
||||||
unlink_old = 1
|
unlink_old = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user