Advertisement
Guest User

Untitled

a guest
Apr 1st, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.84 KB | None | 0 0
  1. #!/usr/local/bin/php -q
  2. <?php
  3. error_reporting(0);
  4. $path_to_config = "/home/animelic/public_html";
  5. if ( file_exists( $path_to_config . '/wp-config.php') ) {
  6.  
  7. /** The config file resides in ABSPATH */
  8. require_once( $path_to_config . '/wp-config.php' );
  9.  
  10. } elseif ( file_exists( dirname($path_to_config) . '/wp-config.php' ) && ! file_exists( dirname($path_to_config) . '/wp-settings.php' ) ) {
  11.  
  12. /** The config file resides one level above ABSPATH but is not part of another install*/
  13. require_once( dirname($path_to_config) . '/wp-config.php' );
  14.  
  15. }
  16. ini_set('short_open_tag', 0);
  17. ?>
  18. ##########################
  19. # WARNING: it is not original sphinx.conf - this file adopted to sphinx
  20. # which installed by wordpress Sphinx Search plugin.
  21. # Don't use this file as example of sphinx configuration,
  22. # better visit the official doc page at http://www.sphinxsearch.com/doc.html
  23. ##########################
  24.  
  25.  
  26. source wp_main_posts
  27. {
  28. type = mysql
  29. sql_host = <?php echo DB_HOST."\n"?>
  30. sql_user = <?php echo DB_USER."\n"?>
  31. sql_pass = <?php echo DB_PASSWORD."\n"?>
  32. sql_db = <?php echo DB_NAME."\n"?>
  33. sql_sock = /var/lib/mysql/mysql.sock
  34. sql_port = 3306 # optional, default is 3306
  35. sql_query_pre = SET NAMES utf8
  36. sql_query_pre = REPLACE INTO <?php echo $table_prefix?>sph_counter SELECT 1, IF(0 < MAX(id), MAX(id), 1) FROM wp_posts
  37. sql_query_range = SELECT IF(0 < MIN(id), MIN(id), 1),( SELECT max_doc_id FROM <?php echo $table_prefix?>sph_counter WHERE counter_id=1 ) FROM wp_posts
  38. sql_range_step = 1000
  39.  
  40. sql_query = select \
  41. p.ID*2+1 as ID, \
  42. 0 as comment_ID,\
  43. p.ID as post_ID,\
  44. p.post_title as title, \
  45. alternativeNames.meta_value as alternativeNames, \
  46. p.post_content as body, \
  47. t.name as category, \
  48. IF(p.post_type = 'post', 1, 0) as isPost, \
  49. 0 as isComment, \
  50. IF(p.post_type = 'page', 1, 0) as isPage, \
  51. IF(p.post_type = 'post', 0, IF(p.post_type = 'page', 1, 2)) as post_type, \
  52. UNIX_TIMESTAMP(post_date) AS date_added \
  53. from \
  54. wp_posts as p \
  55. left join \
  56. wp_term_relationships tr on (p.ID = tr.object_id) \
  57. left join \
  58. wp_term_taxonomy tt on (tt.term_taxonomy_id = tr.term_taxonomy_id and tt.taxonomy = 'category') \
  59. left join \
  60. wp_terms t on (tt.term_id = t.term_id) \
  61. left join \
  62. wp_postmeta alternativeNames on (p.ID = alternativeNames.post_id and bio_meta.meta_key = 'alternativeNames') \
  63. where \
  64. p.id>=$start AND p.id<=$end and \
  65. p.post_status = 'publish' \
  66. union ALL \
  67. select \
  68. c.comment_ID*2 as ID, \
  69. c.comment_ID as comment_ID,\
  70. c.comment_post_ID as post_ID,\
  71. '' as title, \
  72. '' as alternativeNames, \
  73. c.comment_content as body, \
  74. '' as category, \
  75. 0 as isPost, \
  76. 1 as isComment, \
  77. 0 as isPage, \
  78. 2 as post_type, \
  79. UNIX_TIMESTAMP(comment_date) AS date_added \
  80. from \
  81. wp_comments as c \
  82. where \
  83. c.comment_id <= ( SELECT max_doc_id FROM wp_sph_counter WHERE counter_id=2 ) and \
  84. c.comment_approved = '1';
  85.  
  86. sql_attr_uint = comment_ID
  87. sql_attr_uint = post_ID
  88. sql_attr_uint = isPost
  89. sql_attr_uint = isPage
  90. sql_attr_uint = isComment
  91. sql_attr_uint = post_type
  92. sql_attr_timestamp = date_added
  93. }
  94.  
  95. source wp_main_comments
  96. {
  97. type = mysql
  98. sql_host = <?php echo DB_HOST."\n"?>
  99. sql_user = <?php echo DB_USER."\n"?>
  100. sql_pass = <?php echo DB_PASSWORD."\n"?>
  101. sql_db = <?php echo DB_NAME."\n"?>
  102. sql_sock = /var/lib/mysql/mysql.sock
  103. sql_port = 3306 # optional, default is 3306
  104. sql_query_pre = SET NAMES utf8
  105. sql_query_pre = REPLACE INTO <?php echo $table_prefix?>sph_counter SELECT 2, IF(0 < MAX(comment_id), MAX(comment_id), 1) FROM wp_comments
  106. sql_query_range = SELECT IF(0 < MIN(comment_id), MIN(comment_id), 1),( SELECT max_doc_id FROM <?php echo $table_prefix?>sph_counter WHERE counter_id=2 ) FROM wp_comments
  107. sql_range_step = 1000
  108.  
  109. sql_query = select \
  110. c.comment_ID*2 as ID, \
  111. c.comment_ID as comment_ID,\
  112. c.comment_post_ID as post_ID,\
  113. '' as title, \
  114. c.comment_content as body, \
  115. '' as category, \
  116. 0 as isPost, \
  117. 1 as isComment, \
  118. 0 as isPage, \
  119. 2 as post_type, \
  120. UNIX_TIMESTAMP(comment_date) AS date_added \
  121. from \
  122. wp_comments as c \
  123. where \
  124. c.comment_id>=$start AND c.comment_id<=$end and \
  125. c.comment_approved = '1';
  126.  
  127. sql_attr_uint = comment_ID
  128. sql_attr_uint = post_ID
  129. sql_attr_uint = isPost
  130. sql_attr_uint = isPage
  131. sql_attr_uint = isComment
  132. sql_attr_uint = post_type
  133. sql_attr_timestamp = date_added
  134. }
  135.  
  136. source wp_delta_posts : wp_main_posts
  137. {
  138. sql_query_range = SELECT ( SELECT max_doc_id FROM <?php echo $table_prefix?>sph_counter where counter_id = 1 ), IF ( 0 < MAX(id), MAX(id), 1) FROM wp_posts
  139. sql_range_step = 1000
  140. sql_query_pre = SET NAMES utf8
  141.  
  142. sql_query = select \
  143. p.ID*2+1 as ID, \
  144. 0 as comment_ID,\
  145. p.ID as post_ID,\
  146. p.post_title as title, \
  147. p.post_content as body, \
  148. t.name as category, \
  149. IF(p.post_type = 'post', 1, 0) as isPost, \
  150. 0 as isComment, \
  151. IF(p.post_type = 'page', 1, 0) as isPage, \
  152. IF(p.post_type = 'post', 0, IF(p.post_type = 'page', 1, 2)) as post_type, \
  153. UNIX_TIMESTAMP(post_date) AS date_added \
  154. from \
  155. wp_posts as p \
  156. left join \
  157. wp_term_relationships tr on (p.ID = tr.object_id) \
  158. left join \
  159. wp_term_taxonomy tt on (tt.term_taxonomy_id = tr.term_taxonomy_id and tt.taxonomy = 'category') \
  160. left join \
  161. wp_terms t on (tt.term_id = t.term_id) \
  162. where \
  163. p.id>$start AND p.id<=$end and \
  164. p.post_status = 'publish' \
  165. group by p.ID ;
  166. }
  167.  
  168. source wp_delta_comments : wp_main_comments
  169. {
  170. sql_query_range = SELECT ( SELECT max_doc_id FROM <?php echo $table_prefix?>sph_counter where counter_id = 2 ), IF ( 0 < MAX(comment_id), MAX(comment_id), 1) FROM wp_comments
  171. sql_range_step = 1000
  172. sql_query_pre = SET NAMES utf8
  173.  
  174. sql_query = select \
  175. c.comment_ID*2 as ID, \
  176. c.comment_ID as comment_ID,\
  177. c.comment_post_ID as post_ID,\
  178. '' as title, \
  179. c.comment_content as body, \
  180. '' as category, \
  181. 0 as isPost, \
  182. 1 as isComment, \
  183. 0 as isPage, \
  184. 2 as post_type, \
  185. UNIX_TIMESTAMP(comment_date) AS date_added \
  186. from \
  187. wp_comments as c \
  188. where \
  189. c.comment_id>$start AND c.comment_id<=$end and \
  190. c.comment_approved = '1';
  191. }
  192.  
  193. index wp_main
  194. {
  195. source = wp_main_posts
  196. source = wp_main_comments
  197. path = /home/animelic/public_html/wp-content/uploads/sphinx/var/data/wp_main
  198. docinfo = extern
  199. morphology = stem_enru
  200. html_strip = 1
  201. charset_type = utf-8
  202. charset_table = 0..9,U+41..U+5a->U+61..U+7a, U+61..U+7a, U+aa, U+b5, U+ba, U+c0..U+d6->U+e0..U+f6, U+d8..U+de->U+f8..U+fe, U+df..U+f6, U+f8..U+ff, U+100..U+12f/2, U+130->U+69, U+131, U+132..U+137/2, U+138, U+139..U+148/2, U+149, U+14a..U+177/2, U+178->U+ff, U+179..U+17e/2, U+17f..U+180, U+181->U+253, U+182..U+185/2, U+186->U+254, U+187..U+188/2, U+189..U+18a->U+256..U+257, U+18b..U+18c/2, U+18d, U+18e->U+1dd, U+18f->U+259, U+190->U+25b, U+191..U+192/2, U+193->U+260, U+194->U+263, U+195, U+196->U+269, U+197->U+268, U+198..U+199/2, U+19a..U+19b, U+19c->U+26f, U+19d->U+272, U+19e, U+19f->U+275, U+1a0..U+1a5/2, U+1a6->U+280, U+1a7..U+1a8/2, U+1a9->U+283, U+1aa..U+1ab, U+1ac..U+1ad/2, U+1ae->U+288, U+1af..U+1b0/2, U+1b1..U+1b2->U+28a..U+28b, U+1b3..U+1b6/2, U+1b7->U+292, U+1b8..U+1b9/2, U+1ba..U+1bb, U+1bc..U+1bd/2, U+1be..U+1c3, U+1c4->U+1c6, U+1c5..U+1c6/2, U+1c7->U+1c9, U+1c8..U+1c9/2, U+1ca->U+1cc, U+1cb..U+1dc/2, U+1dd, U+1de..U+1ef/2, U+1f0, U+1f1->U+1f3, U+1f2..U+1f5/2, U+1f6->U+195, U+1f7->U+1bf, U+1f8..U+21f/2, U+220->U+19e, U+221, U+222..U+233/2, U+234..U+23a, U+23b..U+23c/2, U+23d->U+19a, U+23e..U+240, U+241->U+294, U+250..U+2c1, U+2c6..U+2d1, U+2e0..U+2e4, U+2ee, U+37a, U+386..U+389->U+3ac..U+3af, U+38c..U+38e->U+3cc..U+3ce, U+390, U+391..U+3a1->U+3b1..U+3c1, U+3a3..U+3ab->U+3c3..U+3cb, U+3ac..U+3ce, U+3d0..U+3d7, U+3d8..U+3ef/2, U+3f0..U+3f3, U+3f4->U+3b8, U+3f5, U+3f7..U+3f8/2, U+3f9->U+3f2, U+3fa..U+3fb/2, U+3fc..U+3ff, U+400..U+40f->U+450..U+45f, U+410..U+42f->U+430..U+44f, U+430..U+45f, U+460..U+481/2, U+48a..U+4bf/2, U+4c0, U+4c1..U+4ce/2, U+4d0..U+4f9/2, U+500..U+50f/2, U+531..U+556->U+561..U+586, U+559, U+561..U+587, U+5d0..U+5ea, U+5f0..U+5f2, U+621..U+63a, U+640..U+64a, U+66e..U+66f, U+671..U+6d3, U+6d5, U+6e5..U+6e6, U+6ee..U+6ef, U+6fa..U+6fc, U+6ff, U+e01..U+e30, U+e32..U+e33, U+e40..U+e46, U+e81..U+e82, U+e84, U+e87..U+e88, U+e8a, U+e8d, U+e94..U+e97, U+e99..U+e9f, U+ea1..U+ea3, U+ea5, U+ea7, U+eaa..U+eab, U+ead..U+eb0, U+eb2..U+eb3, U+ebd, U+ec0..U+ec4, U+ec6, U+edc..U+edd, U+1000..U+1021, U+1023..U+1027, U+1029..U+102a, U+1050..U+1055, U+10a0..U+10c5->U+2d00..U+2d25, U+10d0..U+10fa, U+10fc, U+2d00..U+2d25, U+1d00..U+1dbf, U+1e00..U+1e95/2, U+1e96..U+1e9b, U+1ea0..U+1ef9/2, U+3005..U+3006, U+3031..U+3035, U+303b..U+303c, U+3041..U+3096, U+309d..U+309f, U+30a1..U+30fa, U+30fc..U+30ff, U+31f0..U+31ff
  203.  
  204. }
  205.  
  206. index wp_delta : wp_main
  207. {
  208. source = wp_delta_posts
  209. source = wp_delta_comments
  210. path = /home/animelic/public_html/wp-content/uploads/sphinx/var/data/wp_delta
  211. }
  212.  
  213. index wp_
  214. {
  215. type = distributed
  216. local = wp_main
  217. local = wp_delta
  218. }
  219.  
  220. source wp_stats
  221. {
  222. type = mysql
  223. sql_host = <?php echo DB_HOST."\n"?>
  224. sql_user = <?php echo DB_USER."\n"?>
  225. sql_pass = <?php echo DB_PASSWORD."\n"?>
  226. sql_db = <?php echo DB_NAME."\n"?>
  227. sql_sock = /var/lib/mysql/mysql.sock
  228. sql_port = 3306 # optional, default is 3306
  229. sql_query_pre = SET NAMES utf8
  230.  
  231. sql_query = select id, keywords, status, crc32(keywords) as keywords_crc,\
  232. UNIX_TIMESTAMP(date_added) as date_added \
  233. from <?php echo $table_prefix?>sph_stats;
  234.  
  235. sql_attr_uint = status
  236. sql_attr_uint = keywords_crc
  237. sql_attr_timestamp = date_added
  238. }
  239.  
  240. index wp_stats
  241. {
  242. source = wp_stats
  243. path = /home/animelic/public_html/wp-content/uploads/sphinx/var/data/wp_stats
  244. docinfo = extern
  245. morphology = stem_enru
  246. html_strip = 1
  247. charset_type = utf-8
  248. charset_table = 0..9,U+41..U+5a->U+61..U+7a, U+61..U+7a, U+aa, U+b5, U+ba, U+c0..U+d6->U+e0..U+f6, U+d8..U+de->U+f8..U+fe, U+df..U+f6, U+f8..U+ff, U+100..U+12f/2, U+130->U+69, U+131, U+132..U+137/2, U+138, U+139..U+148/2, U+149, U+14a..U+177/2, U+178->U+ff, U+179..U+17e/2, U+17f..U+180, U+181->U+253, U+182..U+185/2, U+186->U+254, U+187..U+188/2, U+189..U+18a->U+256..U+257, U+18b..U+18c/2, U+18d, U+18e->U+1dd, U+18f->U+259, U+190->U+25b, U+191..U+192/2, U+193->U+260, U+194->U+263, U+195, U+196->U+269, U+197->U+268, U+198..U+199/2, U+19a..U+19b, U+19c->U+26f, U+19d->U+272, U+19e, U+19f->U+275, U+1a0..U+1a5/2, U+1a6->U+280, U+1a7..U+1a8/2, U+1a9->U+283, U+1aa..U+1ab, U+1ac..U+1ad/2, U+1ae->U+288, U+1af..U+1b0/2, U+1b1..U+1b2->U+28a..U+28b, U+1b3..U+1b6/2, U+1b7->U+292, U+1b8..U+1b9/2, U+1ba..U+1bb, U+1bc..U+1bd/2, U+1be..U+1c3, U+1c4->U+1c6, U+1c5..U+1c6/2, U+1c7->U+1c9, U+1c8..U+1c9/2, U+1ca->U+1cc, U+1cb..U+1dc/2, U+1dd, U+1de..U+1ef/2, U+1f0, U+1f1->U+1f3, U+1f2..U+1f5/2, U+1f6->U+195, U+1f7->U+1bf, U+1f8..U+21f/2, U+220->U+19e, U+221, U+222..U+233/2, U+234..U+23a, U+23b..U+23c/2, U+23d->U+19a, U+23e..U+240, U+241->U+294, U+250..U+2c1, U+2c6..U+2d1, U+2e0..U+2e4, U+2ee, U+37a, U+386..U+389->U+3ac..U+3af, U+38c..U+38e->U+3cc..U+3ce, U+390, U+391..U+3a1->U+3b1..U+3c1, U+3a3..U+3ab->U+3c3..U+3cb, U+3ac..U+3ce, U+3d0..U+3d7, U+3d8..U+3ef/2, U+3f0..U+3f3, U+3f4->U+3b8, U+3f5, U+3f7..U+3f8/2, U+3f9->U+3f2, U+3fa..U+3fb/2, U+3fc..U+3ff, U+400..U+40f->U+450..U+45f, U+410..U+42f->U+430..U+44f, U+430..U+45f, U+460..U+481/2, U+48a..U+4bf/2, U+4c0, U+4c1..U+4ce/2, U+4d0..U+4f9/2, U+500..U+50f/2, U+531..U+556->U+561..U+586, U+559, U+561..U+587, U+5d0..U+5ea, U+5f0..U+5f2, U+621..U+63a, U+640..U+64a, U+66e..U+66f, U+671..U+6d3, U+6d5, U+6e5..U+6e6, U+6ee..U+6ef, U+6fa..U+6fc, U+6ff, U+e01..U+e30, U+e32..U+e33, U+e40..U+e46, U+e81..U+e82, U+e84, U+e87..U+e88, U+e8a, U+e8d, U+e94..U+e97, U+e99..U+e9f, U+ea1..U+ea3, U+ea5, U+ea7, U+eaa..U+eab, U+ead..U+eb0, U+eb2..U+eb3, U+ebd, U+ec0..U+ec4, U+ec6, U+edc..U+edd, U+1000..U+1021, U+1023..U+1027, U+1029..U+102a, U+1050..U+1055, U+10a0..U+10c5->U+2d00..U+2d25, U+10d0..U+10fa, U+10fc, U+2d00..U+2d25, U+1d00..U+1dbf, U+1e00..U+1e95/2, U+1e96..U+1e9b, U+1ea0..U+1ef9/2, U+3005..U+3006, U+3031..U+3035, U+303b..U+303c, U+3041..U+3096, U+309d..U+309f, U+30a1..U+30fa, U+30fc..U+30ff, U+31f0..U+31ff
  249. }
  250.  
  251. indexer
  252. {
  253. mem_limit = 32M
  254. }
  255.  
  256. searchd
  257. {
  258. port = 9313
  259. read_timeout = 5
  260. max_children = 30
  261. pid_file = /home/animelic/public_html/wp-content/uploads/sphinx/var/log/searchd.pid
  262. max_matches = 100000
  263. log = /home/animelic/public_html/wp-content/uploads/sphinx/var/log/searchd.log
  264. query_log = /home/animelic/public_html/wp-content/uploads/sphinx/var/log/query.log
  265. }
  266.  
  267. # --eof--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement