summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/search_engines.php17
-rwxr-xr-xscripts/stopdaemons.sh3
2 files changed, 16 insertions, 4 deletions
diff --git a/lib/search_engines.php b/lib/search_engines.php
index 5c84d7c6b..772f41883 100644
--- a/lib/search_engines.php
+++ b/lib/search_engines.php
@@ -118,12 +118,20 @@ class MySQLSearch extends SearchEngine
}
return true;
} 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) {
+ $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) ' .
- 'AGAINST (\''.addslashes(strtolower($q)).'\' IN BOOLEAN MODE)', 'OR');
+ 'AGAINST (\''.addslashes($q).'\' IN BOOLEAN MODE)');
}
+
return true;
} else {
throw new ServerException('Unknown table: ' . $this->table);
@@ -160,6 +168,9 @@ class PGSearch extends SearchEngine
if ('identica_people' === $this->table) {
return $this->target->whereAdd('textsearch @@ plainto_tsquery(\''.addslashes($q).'\')');
} 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).'\')');
} else {
throw new ServerException('Unknown table: ' . $this->table);
diff --git a/scripts/stopdaemons.sh b/scripts/stopdaemons.sh
index 501558658..60ffd83ad 100755
--- a/scripts/stopdaemons.sh
+++ b/scripts/stopdaemons.sh
@@ -24,7 +24,8 @@ SDIR=`dirname $0`
DIR=`php $SDIR/getpiddir.php`
for f in jabberhandler ombhandler publichandler smshandler pinghandler \
- xmppconfirmhandler xmppdaemon twitterhandler facebookhandler; do
+ xmppconfirmhandler xmppdaemon twitterhandler facebookhandler \
+ twitterstatusfetcher; do
FILES="$DIR/$f.*.pid"
for ff in "$FILES" ; do