packages: phorum-mod-sphinx_search/sphinx.conf - revamp config

glen glen at pld-linux.org
Tue Jun 15 00:43:55 CEST 2010


Author: glen                         Date: Mon Jun 14 22:43:55 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- revamp config

---- Files affected:
packages/phorum-mod-sphinx_search:
   sphinx.conf (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: packages/phorum-mod-sphinx_search/sphinx.conf
diff -u packages/phorum-mod-sphinx_search/sphinx.conf:1.1 packages/phorum-mod-sphinx_search/sphinx.conf:1.2
--- packages/phorum-mod-sphinx_search/sphinx.conf:1.1	Wed Apr 14 15:40:17 2010
+++ packages/phorum-mod-sphinx_search/sphinx.conf	Tue Jun 15 00:43:50 2010
@@ -1,170 +1,142 @@
 #
-# Sphinx configuration for phorum5 search
-#
-# Please refer to doc/sphinx.html for complete documentation.
+# Sphinx configuration for Phorum 5
 #
 
 #############################################################################
-## data source definition
+## phony source. common defaults for other sources
 #############################################################################
 source phorum5_base
 {
-	# data source type
-	# for now, known types are 'mysql' and 'xmlpipe'
-	# MUST be defined
-	type                    = mysql
-
-	sql_query = set names utf8
-
-	# some straightforward parameters for 'mysql' source type
-	sql_host                = localhost
-	sql_user                = mysql
-	sql_pass                = 
-	sql_db                  = phorum5
-	sql_port                = 3306    # optional, default is 3306
-
-	# optional, default is empty
-	sql_attr_uint           = forum_id
-	sql_attr_timestamp      = datestamp
-	sql_query_info          = SELECT * FROM documents WHERE id=$id
-}
-
-index phorum5_base
-{
-	source                  = phorum5_base
+  type                = mysql
 
-	# morphology
-	# default is not to use any
-	morphology              = none
+  sql_host            = localhost
+  sql_user            = mysql
+  sql_pass            =
+  sql_db              = phorum5
+  sql_port            = 3306
 
-	# stopwords file
-	stopwords               =
+  # optional, default is empty
+  sql_attr_uint       = forum_id
+  sql_attr_timestamp  = datestamp
 
-	# whether to strip HTML tags from incoming documents
-	# known values are 0 (do not strip) and 1 (do strip)
-	# optional, default is 0
-	html_strip              = 0
+  # document info query, ONLY for CLI search (ie. testing and debugging)
+  # optional, default is empty
+  # must contain $id macro and must fetch the document by that id
+  # integer document ID field MUST be the first selected column
+  sql_query_info      = SELECT message_id, forum_id, datestamp, author, subject, body FROM phorum_messages WHERE message_id=$id
+}
 
-	# what HTML attributes to index if stripping HTML
-	# optional, default is empty (do not index anything)
-	#
-	# html_index_attrs      = img=alt,title; a=title;
+#############################################################################
+## phony index. common defaults for other deltas
+#############################################################################
+index phorum5_base
+{
+  source              = phorum5_base
 
-	# minimum word length
-	min_word_len            = 2
+  # document attribute values (docinfo) storage mode
+  # optional, default is 'extern'
+  # known values are 'none', 'extern' and 'inline'
+  docinfo             = extern
 
-	# charset encoding type
-	# known types are 'sbcs' (Single Byte CharSet) and 'utf-8'
-	charset_type            = utf-8
+  # minimum indexed word length
+  # default is 1 (index everything)
+  min_word_len        = 3
 
-	path                    = /var/lib/sphinx/phorum5/base
+  # charset encoding type
+  # optional, default is 'sbcs'
+  # known types are 'sbcs' (Single Byte CharSet) and 'utf-8'
+  charset_type        = utf-8
 }
 
+# messages
 source phorum5_msg : phorum5_base
 {
-	sql_query_pre           = REPLACE INTO sph_counter SELECT 1, 'message', MAX(message_id) FROM phorum_messages WHERE status=2
-	sql_query               = \
-			SELECT message_id, forum_id, datestamp, author, subject, body \
-			FROM phorum_messages \
-			WHERE message_id<=( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'message' ) and status=2
+  sql_query_pre       = SET NAMES utf8
+  sql_query_pre       = REPLACE INTO sph_counter SELECT 1, 'message', MAX(message_id) FROM phorum_messages WHERE status=2
 
+  sql_query           = \
+      SELECT message_id, forum_id, datestamp, author, subject, body \
+      FROM phorum_messages \
+      WHERE \
+        message_id <= (SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'message') and status=2
 }
 
-source phorum5_msg_delta : phorum5_base
-{
-	# main document fetch query
-	# you can specify any number of fields
-	#
-	# mandatory
-	sql_query               = \
-			SELECT message_id, forum_id, datestamp, author, subject, body \
-			FROM phorum_messages \
-			WHERE message_id>( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'message' ) and status=2
+source phorum5_msg_d : phorum5_base
+{
+  sql_query_pre       = SET NAMES utf8
+  sql_query           = \
+      SELECT message_id, forum_id, datestamp, author, subject, body \
+      FROM phorum_messages \
+      WHERE \
+        message_id > (SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'message') and status=2
 }
 
-index phorum5_msg : phorum5_base
+# authors
+source phorum5_author : phorum5_base
 {
-	# which document source to index
-	source                  = phorum5_msg
-
-	# this is path and index file name without extension
-	# files <indexpath>.spi/spd/spr will be created by indexer
-	path                    = /var/lib/sphinx/phorum5/phorum5_msg
-
-	charset_type            = utf-8
-
+  sql_query_pre       = SET NAMES utf8
+  sql_query_pre       = REPLACE INTO sph_counter SELECT 1, 'author', MAX(message_id) FROM phorum_messages WHERE status=2
+  sql_query           = \
+      SELECT message_id, forum_id, datestamp, author \
+      FROM phorum_messages \
+      WHERE \
+        message_id <= (SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'author') and status=2
+}
+
+source phorum5_author_d : phorum5_base
+{
+  sql_query_pre       = SET NAMES utf8
+  sql_query           = \
+      SELECT message_id, forum_id, datestamp, author \
+      FROM phorum_messages \
+      WHERE \
+        message_id > (SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'author') and status=2
 }
 
-index phorum5_msg_d : phorum5_base
+# messages
+index phorum5_msg : phorum5_base
 {
-	# which document source to index
-	source                  = phorum5_msg_delta
-
-	# this is path and index file name without extension
-	# files <indexpath>.spi/spd/spr will be created by indexer
-	path                    = /var/lib/sphinx/phorum5/phorum5_msg_d
-
-	charset_type            = utf-8
+  source              = phorum5_msg
+  path                = /var/lib/sphinx/phorum5_msg
 }
 
-source phorum5_author : phorum5_base
+index phorum5_msg_d : phorum5_base
 {
-	sql_query_pre           = REPLACE INTO sph_counter SELECT 1, 'author', MAX(message_id) FROM phorum_messages WHERE status=2
-	sql_query               = \
-			SELECT message_id, forum_id, datestamp, author \
-			FROM phorum_messages \
-			WHERE message_id<=( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'author' ) and status=2
-}
-
-source phorum5_author_delta : phorum5_base
-{
-	# main document fetch query
-	# you can specify any number of fields
-	#
-	# mandatory
-	sql_query               = \
-			SELECT message_id, forum_id, datestamp, author \
-			FROM phorum_messages \
-			WHERE message_id>( SELECT max_doc_id FROM sph_counter WHERE counter_id=1 and type = 'author' ) and status=2
-
+  source              = phorum5_msg_d
+  path                = /var/lib/sphinx/phorum5_msg_d
 }
 
+# author
 index phorum5_author : phorum5_base
 {
-	source              = phorum5_author
-	path                = /var/lib/sphinx/phorum5/phorum5_author
-	charset_type        = utf-8
+  source              = phorum5_author
+  path                = /var/lib/sphinx/phorum5_author
 }
 
-
-index phorum5_author_delta : phorum5_base
+index phorum5_author_d : phorum5_base
 {
-	source              = phorum5_author_delta
-	path                = /var/lib/sphinx/phorum5/phorum5_author_delta
-	charset_type        = utf-8
+  source              = phorum5_author_d
+  path                = /var/lib/sphinx/phorum5_author_d
 }
 
-
 #############################################################################
 ## indexer settings
 #############################################################################
-
 indexer
 {
-	# memory limit, in bytes, kiloytes (16384K) or megabytes (256M)
-	# optional, default is 32M, max is 2047M, recommended is 256M to 1024M
-	mem_limit           = 32M
-
-	# maximum IO calls per second (for I/O throttling)
-	# optional, default is 0 (unlimited)
-	#
-	# max_iops          = 40
-
-
-	# maximum IO call size, bytes (for I/O throttling)
-	# optional, default is 0 (unlimited)
-	#
-	# max_iosize        = 1048576
+  # memory limit, in bytes, kiloytes (16384K) or megabytes (256M)
+  # optional, default is 32M, max is 2047M, recommended is 256M to 1024M
+  mem_limit          = 128M
+
+  # maximum IO calls per second (for I/O throttling)
+  # optional, default is 0 (unlimited)
+  #
+  # max_iops          = 40
+
+  # maximum IO call size, bytes (for I/O throttling)
+  # optional, default is 0 (unlimited)
+  #
+  # max_iosize        = 1048576
 }
 
 #############################################################################
@@ -173,53 +145,52 @@
 
 searchd
 {
-	# IP address to bind on
-	# optional, default is 0.0.0.0 (ie. listen on all interfaces)
-	#
-	# address           = 127.0.0.1
-	# address           = 192.168.0.1
-
-
-	# searchd TCP port number
-	# mandatory, default is 3312
-	port                = 3312
-
-	# log file, searchd run info is logged here
-	# optional, default is 'searchd.log'
-	log                 = /var/log/sphinx/searchd.log
-
-	# query log file, all search queries are logged here
-	# optional, default is empty (do not log queries)
-	query_log           = /var/log/sphinx/query.log
-
-	# client read timeout, seconds
-	# optional, default is 5
-	read_timeout        = 5
-
-	# maximum amount of children to fork (concurrent searches to run)
-	# optional, default is 0 (unlimited)
-	max_children        = 30
-
-	# PID file, searchd process ID file name
-	# mandatory
-	pid_file            = /var/run/sphinx/searchd.pid
-
-	# max amount of matches the daemon ever keeps in RAM, per-index
-	# WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL
-	# default is 1000 (just like Google)
-	max_matches         = 1000
-
-	# seamless rotate, prevents rotate stalls if precaching huge datasets
-	# optional, default is 1
-	seamless_rotate     = 1
-
-	# whether to forcibly preopen all indexes on startup
-	# optional, default is 0 (do not preopen)
-	preopen_indexes     = 0
-
-	# whether to unlink .old index copies on succesful rotation.
-	# optional, default is 1 (do unlink)
-	unlink_old          = 1
+  # IP address to bind on
+  # optional, default is 0.0.0.0 (ie. listen on all interfaces)
+  #
+  # address           = 127.0.0.1
+  # address           = 192.168.0.1
+
+  # searchd TCP port number
+  # mandatory, default is 9312
+  port                = 9312
+
+  # log file, searchd run info is logged here
+  # optional, default is 'searchd.log'
+  log                 = /var/log/sphinx/searchd.log
+
+  # query log file, all search queries are logged here
+  # optional, default is empty (do not log queries)
+  query_log           = /var/log/sphinx/query.log
+
+  # client read timeout, seconds
+  # optional, default is 5
+  read_timeout        = 5
+
+  # maximum amount of children to fork (concurrent searches to run)
+  # optional, default is 0 (unlimited)
+  max_children        = 30
+
+  # PID file, searchd process ID file name
+  # mandatory
+  pid_file            = /var/run/sphinx/searchd.pid
+
+  # max amount of matches the daemon ever keeps in RAM, per-index
+  # WARNING, THERE'S ALSO PER-QUERY LIMIT, SEE SetLimits() API CALL
+  # default is 1000 (just like Google)
+  max_matches         = 1000
+
+  # seamless rotate, prevents rotate stalls if precaching huge datasets
+  # optional, default is 1
+  seamless_rotate     = 1
+
+  # whether to forcibly preopen all indexes on startup
+  # optional, default is 0 (do not preopen)
+  preopen_indexes     = 0
+
+  # whether to unlink .old index copies on succesful rotation.
+  # optional, default is 1 (do unlink)
+  unlink_old          = 1
 }
 
-# --eof--
+# vim:ts=2:sw=2:et
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/phorum-mod-sphinx_search/sphinx.conf?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list