diff options
author | Adolfo Fitoria <fitoria@fitoria-laptop.(none)> | 2009-12-15 16:57:37 -0600 |
---|---|---|
committer | Adolfo Fitoria <fitoria@fitoria-laptop.(none)> | 2009-12-15 16:57:37 -0600 |
commit | 9d1fb9890b97beb55461ca34f9757bc685461130 (patch) | |
tree | 1f8f0552ba6f4ca092aaa5a5347f0ad07433f1de /sphinx/sphinx.conf | |
parent | ebb0f636ae8f7db4e7a2e7470e449af3d96b15c0 (diff) | |
parent | 82d35490db90878f013523c4d1a5ec3af2df8b23 (diff) | |
download | askbot-9d1fb9890b97beb55461ca34f9757bc685461130.tar.gz askbot-9d1fb9890b97beb55461ca34f9757bc685461130.tar.bz2 askbot-9d1fb9890b97beb55461ca34f9757bc685461130.zip |
Merge branch 'master' of git://github.com/evgenyfadeev/CNPROG into evgenyfadeev/master
Conflicts:
INSTALL
LICENSE
TODO
cnprog.wsgi
context.py
development.log
forum/feed.py
forum/forms.py
forum/management/commands/send_email_alerts.py
forum/managers.py
forum/models.py
forum/templatetags/extra_filters.py
forum/templatetags/extra_tags.py
forum/urls.py
forum/views.py
locale/en/LC_MESSAGES/django.mo
locale/en/LC_MESSAGES/django.po
middleware/__init__.py
middleware/anon_user.py
settings.py
settings_local.py.dist
templates/about.html
templates/authopenid/complete.html
templates/authopenid/external_legacy_login_info.html
templates/base.html
templates/base_content.html
templates/content/js/com.cnprog.admin.js
templates/content/js/com.cnprog.i18n.js
templates/content/js/com.cnprog.post.js
templates/content/js/com.cnprog.utils.js
templates/content/js/wmd/wmd.js
templates/content/style/style.css
templates/question.html
templates/questions.html
templates/unanswered.html
templates/user_email_subscriptions.html
templates/user_reputation.html
templates/user_stats.html
templates/user_votes.html
Diffstat (limited to 'sphinx/sphinx.conf')
-rw-r--r-- | sphinx/sphinx.conf | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/sphinx/sphinx.conf b/sphinx/sphinx.conf new file mode 100644 index 00000000..bf4bdc8b --- /dev/null +++ b/sphinx/sphinx.conf @@ -0,0 +1,127 @@ +#if you have many posts, it's best to configure another index for new posts and +#periodically merge the diff index to the main +#this is not important until you get to hundreds of thousands posts + +source src_cnprog +{ + # data source + type = mysql + sql_host = localhost + sql_user = cnprog #replace with your db username + sql_pass = secret #replace with your db password + sql_db = cnprog #replace with your db name + # these two are optional + #sql_port = 3306 + #sql_sock = /var/lib/mysql/mysql.sock + + # pre-query, executed before the main fetch query + sql_query_pre = SET NAMES utf8 + + # main document fetch query - change the table names if you are using a prefix + # this query creates a flat document from each question that includes only latest + # revisions of the question and all of it's answers + sql_query = SELECT q.id as id, q.title AS title, q.tagnames as tags, qr.text AS text, answers_combined.text AS answers \ + FROM question AS q \ + INNER JOIN \ + ( \ + SELECT MAX(id) as id, question_id \ + FROM question_revision \ + GROUP BY question_id \ + ) \ + AS mqr \ + ON q.id=mqr.question_id \ + INNER JOIN question_revision AS qr ON qr.id=mqr.id \ + LEFT JOIN \ + ( \ + SELECT GROUP_CONCAT(answer_current.text SEPARATOR '. ') AS text, \ + question_id \ + FROM \ + ( \ + SELECT a.question_id as question_id, ar.text as text \ + FROM answer AS a \ + INNER JOIN \ + ( \ + SELECT MAX(id) as id, answer_id \ + FROM answer_revision \ + GROUP BY answer_id \ + ) \ + AS mar \ + ON mar.answer_id = a.id \ + INNER JOIN answer_revision AS ar ON ar.id=mar.id \ + WHERE a.deleted=0 \ + ) \ + AS answer_current \ + GROUP BY question_id \ + ) \ + AS answers_combined ON q.id=answers_combined.question_id \ + WHERE q.deleted=0; + + # optional - used by command-line search utility to display document information + sql_query_info = SELECT title, id FROM question WHERE id=$id +} + +index cnprog { + # which document source to index + source = src_cnprog + + # this is path and index file name without extension + # you may need to change this path or create this folder + path = /var/data/sphinx/cnprog_main + + # docinfo (ie. per-document attribute values) storage strategy + docinfo = extern + + # morphology + morphology = stem_en + + # stopwords file + #stopwords = /var/data/sphinx/stopwords.txt + + # minimum word length + min_word_len = 1 + + # uncomment next 2 lines to allow wildcard (*) searches + #min_infix_len = 1 + #enable_star = 1 + + # charset encoding type + charset_type = utf-8 +} + +# indexer settings +indexer +{ + # memory limit (default is 32M) + mem_limit = 64M +} + +# searchd settings +searchd +{ + # IP address on which search daemon will bind and accept + # optional, default is to listen on all addresses, + # ie. address = 0.0.0.0 + address = 127.0.0.1 + + # port on which search daemon will listen + port = 3312 + + # searchd run info is logged here - create or change the folder + log = /var/log/sphinx/searchd.log + + # all the search queries are logged here + query_log = /var/log/sphinx/query.log + + # client read timeout, seconds + read_timeout = 5 + + # maximum amount of children to fork + max_children = 30 + + # a file which will contain searchd process ID + pid_file = /var/log/sphinx/searchd.pid + + # maximum amount of matches this daemon would ever retrieve + # from each index and serve to client + max_matches = 1000 +} |