packages: phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec, phorum-mo...

glen glen at pld-linux.org
Wed Apr 14 15:40:23 CEST 2010


Author: glen                         Date: Wed Apr 14 13:40:23 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add sphinx conf. kind of works here

---- Files affected:
packages/phorum-mod-sphinx_search:
   phorum-mod-sphinx_search.spec (1.3 -> 1.4) , sphinx.conf (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec
diff -u packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec:1.3 packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec:1.4
--- packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec:1.3	Wed Apr 14 15:34:36 2010
+++ packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec	Wed Apr 14 15:40:17 2010
@@ -5,12 +5,13 @@
 Summary:	Sphinx Fulltext-Search Module
 Name:		phorum-mod-%{module}
 Version:	1.0.0
-Release:	0.2
+Release:	0.3
 License:	Apache-like
 Group:		Applications/WWW
 Source0:	http://www.phorum.org/phorum5/file.php/download/62/3354/sphinx_search_%{version}.tar.gz
 # Source0-md5:	fd6bafce5d77c1baf90bf5f5e157bfb8
 Source1:	sph_counter.sql
+Source2:	sphinx.conf
 Patch0:		paths.patch
 Patch1:		errors.patch
 URL:		http://www.phorum.org/phorum5/read.php?62,136982,138325
@@ -42,6 +43,7 @@
 %setup -qc
 mv %{module}/* .
 cp -a %{SOURCE1} .
+cp -a %{SOURCE2} .
 %{__sed} -i -e 's,\r$,,' *.php *.txt README Changelog
 %patch0 -p1
 %patch1 -p1
@@ -55,18 +57,17 @@
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{moduledir}
-cp -a *.txt *.php sph_counter.sql $RPM_BUILD_ROOT%{moduledir}
+cp -a *.txt *.php $RPM_BUILD_ROOT%{moduledir}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc README Changelog
+%doc README Changelog sphinx.conf sph_counter.sql
 %dir %{moduledir}
 %{moduledir}/*.php
 %{moduledir}/info.txt
-%{moduledir}/sph_counter.sql
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -74,6 +75,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.4  2010/04/14 13:40:17  glen
+- add sphinx conf. kind of works here
+
 Revision 1.3  2010/04/14 13:34:36  glen
 - error reporing properly
 - add sph_counter table structure from doc

================================================================
Index: packages/phorum-mod-sphinx_search/sphinx.conf
diff -u /dev/null packages/phorum-mod-sphinx_search/sphinx.conf:1.1
--- /dev/null	Wed Apr 14 15:40:23 2010
+++ packages/phorum-mod-sphinx_search/sphinx.conf	Wed Apr 14 15:40:17 2010
@@ -0,0 +1,225 @@
+#
+# Sphinx configuration for phorum5 search
+#
+# Please refer to doc/sphinx.html for complete documentation.
+#
+
+#############################################################################
+## data source definition
+#############################################################################
+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
+
+	# morphology
+	# default is not to use any
+	morphology              = none
+
+	# stopwords file
+	stopwords               =
+
+	# 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
+
+	# what HTML attributes to index if stripping HTML
+	# optional, default is empty (do not index anything)
+	#
+	# html_index_attrs      = img=alt,title; a=title;
+
+	# minimum word length
+	min_word_len            = 2
+
+	# charset encoding type
+	# known types are 'sbcs' (Single Byte CharSet) and 'utf-8'
+	charset_type            = utf-8
+
+	path                    = /var/lib/sphinx/phorum5/base
+}
+
+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
+
+}
+
+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
+}
+
+index phorum5_msg : 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
+
+}
+
+index phorum5_msg_d : 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_author : 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
+
+}
+
+index phorum5_author : phorum5_base
+{
+	source              = phorum5_author
+	path                = /var/lib/sphinx/phorum5/phorum5_author
+	charset_type        = utf-8
+}
+
+
+index phorum5_author_delta : phorum5_base
+{
+	source              = phorum5_author_delta
+	path                = /var/lib/sphinx/phorum5/phorum5_author_delta
+	charset_type        = utf-8
+}
+
+
+#############################################################################
+## 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
+}
+
+#############################################################################
+## searchd settings
+#############################################################################
+
+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
+}
+
+# --eof--
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/phorum-mod-sphinx_search/phorum-mod-sphinx_search.spec?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list