summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorRob Hoelz <[email protected]>2014-04-14 23:18:33 -0500
committerAndrew Dolgov <[email protected]>2014-04-23 04:49:54 +0000
commitbaaf4c3043f428ec009dd48b85e1c2d6cb8abee4 (patch)
tree7bdf437023fad735a58d149c4177b70b20630b97 /classes
parent87ddd5e1f9465a24fdb087356e31ab8fe73bdf0a (diff)
Make search mechanism pluggable
Currently, TinyTinyRSS can use raw SQL or the Sphinx search engine for searching. It would be nice if other search engines (such as Xapian) could be used, or if features of the underlying SQL engine (such as MySQL's FULLTEXT indexes) could be leveraged. This commit makes searching into a plugin hook, falling back to the builtin behavior if no search plugin is active. The Sphinx search behavior has been broken out into a plugin.
Diffstat (limited to 'classes')
-rw-r--r--classes/feeds.php2
-rw-r--r--classes/pluginhost.php1
2 files changed, 2 insertions, 1 deletions
diff --git a/classes/feeds.php b/classes/feeds.php
index ca470c032..89acb0d0b 100644
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -1147,7 +1147,7 @@ class Feeds extends Handler_Protected {
print "<div class=\"dlgButtons\">";
- if (!SPHINX_ENABLED) {
+ if (count(PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SEARCH)) == 0) {
print "<div style=\"float : left\">
<a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/wiki/SearchSyntax\">".__("Search syntax")."</a>
</div>";
diff --git a/classes/pluginhost.php b/classes/pluginhost.php
index 19f8b563b..4582c314a 100644
--- a/classes/pluginhost.php
+++ b/classes/pluginhost.php
@@ -39,6 +39,7 @@ class PluginHost {
const HOOK_FETCH_FEED = 22;
const HOOK_QUERY_HEADLINES = 23;
const HOOK_HOUSE_KEEPING = 24;
+ const HOOK_SEARCH = 25;
const KIND_ALL = 1;
const KIND_SYSTEM = 2;