]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
sphinx documentation and sample config file
authormillette <millette@controlyourself.ca>
Mon, 24 Nov 2008 02:30:36 +0000 (21:30 -0500)
committermillette <millette@controlyourself.ca>
Mon, 24 Nov 2008 02:30:36 +0000 (21:30 -0500)
darcs-hash:20081124023036-099f7-d2c32538e8a81170032ba0bc9fc5caf79e2b59a9.gz

README
config.php.sample
sphinx.conf.sample [new file with mode: 0644]

diff --git a/README b/README
index 524a69e647f0f26e7daf003a48a7f9e9308f3677..6163d9320419f5e59c9584a49fdded12bac56775 100644 (file)
--- a/README
+++ b/README
@@ -141,7 +141,11 @@ For some functionality, you will also need the following extensions:
   server to store the data in.
 - Mailparse. Efficient parsing of email requires this extension.
   Submission by email or SMS-over-email uses this extension.
-  
+- Sphinx Search. A client for the sphinx server, an alternative
+  to MySQL or Postgresql fulltext search. You will also need a
+  Sphinx server to serve the search queries.
+
+
 You will almost definitely get 2-3 times better performance from your
 site if you install a PHP bytecode cache/accelerator. Some well-known
 examples are: eaccelerator, Turck mmcache, xcache, apc. Zend Optimizer
@@ -590,6 +594,22 @@ backups of a working Laconica system by backing up the database and
 the Web directory. To backup the database use mysqldump (http://ur1.ca/7xo)
 and to backup the Web directory, try tar.
 
+Sphinx
+------
+
+To use a Sphinx server to search users and notices, you also need
+to install, compile and enable the sphinx pecl extension for php on the
+client side, which itself depends on the sphinx development files.
+"pecl install sphinx" should take care of that. Add "extension=sphinx.so"
+to your php.ini and reload apache to enable it.
+
+You can update your MySQL or Postgresql databases to drop their fulltext
+search indexes, since they're now provided by sphinx.
+
+On the sphinx server side, a script reads the main database and build
+the keyword index. A cron job reads the database and keeps the sphinx
+indexes up to date.
+
 Upgrading
 =========
 
@@ -931,6 +951,17 @@ enabled: Set to true to enable. Default false.
 server: a string with the hostname of the memcached server. Can also
        be an array of hostnames, if you've got more than one server.
 
+sphinx
+------
+
+You can get a significant boost in performance using Sphinx Search
+instead of your database server to search for users and notices.
+(http://sphinxsearch.com/).
+
+enabled: Set to true to enable. Default false.
+server: a string with the hostname of the sphinx server.
+port: an integer with the port number of the sphinx server.
+
 integration
 -----------
 
index 8f195e4642462742ea6aaba4e2e5411ea25eca5c..c2e7bf151a2dd2d7f66db868dcbaacfd1a2e1acd 100644 (file)
@@ -59,7 +59,7 @@ $config['db']['database'] = 'mysql://laconica:microblog@localhost/laconica';
 # sphinx search
 $config['sphinx']['enabled'] = false;
 $config['sphinx']['server'] = 'localhost';
-$config['sphinx']['PORT'] = 3312;
+$config['sphinx']['port'] = 3312;
 
 
 # Users to populate the 'Featured' tab
diff --git a/sphinx.conf.sample b/sphinx.conf.sample
new file mode 100644 (file)
index 0000000..b79adf1
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# Minimal Sphinx configuration sample for laconica
+#
+
+source src1
+{
+       type                                    = mysql
+       sql_host                                = localhost
+       sql_user                                = USERNAME
+       sql_pass                                = PASSWORD
+       sql_db                                  = identi_ca
+       sql_port                                = 3306
+       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_attr_timestamp              = created_ts
+}
+
+
+source src2
+{
+       type                                    = mysql
+       sql_host                                = localhost
+       sql_user                                = USERNAME
+       sql_pass                                = PASSWORD
+       sql_db                                  = identi_ca
+       sql_port                                = 3306
+       sql_query                               = SELECT id, UNIX_TIMESTAMP(created) as created_ts, content FROM notice
+       sql_query_info                  = SELECT * FROM notice where id = $id
+       sql_attr_timestamp              = created_ts
+}
+
+index identica_notices
+{
+       source                                  = src2
+       path                                    = DIRECTORY/data/identica_notices
+       docinfo                                 = extern
+       charset_type                    = utf-8
+       min_word_len                    = 3
+       stopwords                               = DIRECTORY/data/stopwords-en.txt
+}
+
+
+index identica_people
+{
+       source                                  = src1
+       path                                    = DIRECTORY/data/identica_people
+       docinfo                                 = extern
+       charset_type                    = utf-8
+       min_word_len                    = 3
+       stopwords                               = DIRECTORY/data/stopwords-en.txt
+}
+
+indexer
+{
+       mem_limit                               = 32M
+}
+
+searchd
+{
+       port                                    = 3312
+       log                                             = DIRECTORY/log/searchd.log
+       query_log                               = DIRECTORY/log/query.log
+       read_timeout                    = 5
+       max_children                    = 30
+       pid_file                                = DIRECTORY/log/searchd.pid
+       max_matches                             = 1000
+       seamless_rotate                 = 1
+       preopen_indexes                 = 0
+       unlink_old                              = 1
+}
+