Advertisement
Guest User

Untitled

a guest
Jun 8th, 2012
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.01 KB | None | 0 0
  1. #
  2. # Sphinx configuration for MediaWiki
  3. #
  4. # Based on examples by Paul Grinberg at http://www.mediawiki.org/wiki/Extension:SphinxSearch
  5. # and Hank at http://www.ralree.info/2007/9/15/fulltext-indexing-wikipedia-with-sphinx
  6. # Modified by Svemir Brkic for http://www.newworldencyclopedia.org/
  7. #
  8. # Released under GNU General Public License (see http://www.fsf.org/licenses/gpl.html)
  9. #
  10. # Latest version available at http://www.mediawiki.org/wiki/Extension:SphinxSearch
  11.  
  12. # data source definition for the main index
  13. source src_wiki_main
  14. {
  15. # data source
  16. type = mysql
  17. sql_host = localhost
  18. sql_db = database
  19. sql_user = user
  20. sql_pass = password
  21. # these two are optional
  22. #sql_port = 3306
  23. #sql_sock = /var/lib/mysql/mysql.sock
  24.  
  25. # pre-query, executed before the main fetch query
  26. sql_query_pre = SET NAMES utf8
  27.  
  28. # main document fetch query - change the table names if you are using a prefix
  29. sql_query = SELECT page_id, page_title, page_namespace, page_is_redirect, old_id, old_text FROM IES_page, IES_revision, IES_text WHERE rev_id=page_latest AND old_id=rev_text_id
  30.  
  31. # attribute columns
  32. sql_attr_uint = page_namespace
  33. sql_attr_uint = page_is_redirect
  34. sql_attr_uint = old_id
  35.  
  36. # collect all category ids for category filtering
  37. sql_attr_multi = uint category from query; SELECT cl_from, page_id AS category FROM IES_categorylinks, IES_page WHERE page_title=cl_to AND page_namespace=14
  38.  
  39. # used by command-line search utility to display document information
  40. sql_query_info = SELECT page_title, page_namespace FROM IES_page WHERE page_id=$id
  41. }
  42.  
  43. # data source definition for the incremental index
  44. source src_wiki_incremental : src_wiki_main
  45. {
  46. # adjust this query based on the time you run the full index
  47. # in this case, full index runs at 7 AM UTC
  48. sql_query = SELECT page_id, page_title, page_namespace, page_is_redirect, old_id, old_text FROM IES_page, IES_revision, IES_text WHERE rev_id=page_latest AND old_id=rev_text_id AND page_touched>=DATE_FORMAT(CURDATE(), '%Y%m%d070000')
  49.  
  50. # all other parameters are copied from the parent source
  51. }
  52.  
  53. # main index definition
  54. index wiki_main
  55. {
  56. # which document source to index
  57. source = src_wiki_main
  58.  
  59. # this is path and index file name without extension
  60. # you may need to change this path or create this folder
  61. path = /var/data/sphinx/wiki_main
  62.  
  63. # docinfo (ie. per-document attribute values) storage strategy
  64. docinfo = extern
  65.  
  66. # morphology
  67. morphology = stem_en
  68.  
  69. # stopwords file
  70. #stopwords = /var/data/sphinx/stopwords.txt
  71.  
  72. # minimum word length
  73. min_word_len = 1
  74.  
  75. # allow wildcard (*) searches
  76. min_infix_len = 1
  77. enable_star = 1
  78.  
  79. # charset encoding type
  80. charset_type = utf-8
  81.  
  82. # charset definition and case folding rules "table"
  83. charset_table = 0..9, A..Z->a..z, a..z, \
  84. U+C0->a, U+C1->a, U+C2->a, U+C3->a, U+C4->a, U+C5->a, U+C6->a, \
  85. U+C7->c,U+E7->c, U+C8->e, U+C9->e, U+CA->e, U+CB->e, U+CC->i, \
  86. U+CD->i, U+CE->i, U+CF->i, U+D0->d, U+D1->n, U+D2->o, U+D3->o, \
  87. U+D4->o, U+D5->o, U+D6->o, U+D8->o, U+D9->u, U+DA->u, U+DB->u, \
  88. U+DC->u, U+DD->y, U+DE->t, U+DF->s, \
  89. U+E0->a, U+E1->a, U+E2->a, U+E3->a, U+E4->a, U+E5->a, U+E6->a, \
  90. U+E7->c,U+E7->c, U+E8->e, U+E9->e, U+EA->e, U+EB->e, U+EC->i, \
  91. U+ED->i, U+EE->i, U+EF->i, U+F0->d, U+F1->n, U+F2->o, U+F3->o, \
  92. U+F4->o, U+F5->o, U+F6->o, U+F8->o, U+F9->u, U+FA->u, U+FB->u, \
  93. U+FC->u, U+FD->y, U+FE->t, U+FF->s,
  94.  
  95. }
  96.  
  97. # incremental index definition
  98. index wiki_incremental : wiki_main
  99. {
  100. path = /var/data/sphinx/wiki_incremental
  101. source = src_wiki_incremental
  102. }
  103.  
  104.  
  105. # indexer settings
  106. indexer
  107. {
  108. # memory limit (default is 32M)
  109. mem_limit = 64M
  110. }
  111.  
  112. # searchd settings
  113. searchd
  114. {
  115. # IP address and port on which search daemon will bind and accept
  116. listen = 127.0.0.1:9312
  117.  
  118. # searchd run info is logged here - create or change the folder
  119. log = /var/log/sphinx/searchd.log
  120.  
  121. # all the search queries are logged here
  122. query_log = /var/log/sphinx/query.log
  123.  
  124. # client read timeout, seconds
  125. read_timeout = 5
  126.  
  127. # maximum amount of children to fork
  128. max_children = 30
  129.  
  130. # a file which will contain searchd process ID
  131. pid_file = /var/log/sphinx/searchd.pid
  132.  
  133. # maximum amount of matches this daemon would ever retrieve
  134. # from each index and serve to client
  135. max_matches = 1000
  136. }
  137.  
  138. # --eof--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement