Advertisement
Guest User

Untitled

a guest
Mar 28th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. indexer
  2. {
  3. mem_limit = 1024M
  4. }
  5.  
  6. searchd
  7. {
  8. #listen = 9312
  9. listen = 9306:mysql41
  10. log = /usr/local/var/log/searchd.log
  11. #query_log = /usr/local/var/log/query.log
  12. read_timeout = 5
  13. max_children = 50
  14. pid_file = /usr/local/var/log/searchd.pid
  15. seamless_rotate = 1
  16. #preopen_indexes = 1
  17. unlink_old = 1
  18. binlog_path = /usr/local/var/data
  19. }
  20.  
  21.  
  22. # Для того чтобы добавить в сфинкс БД делаем следующее:
  23. # Для каждой БД под обрезок добавляем следующую запись в файл /etc/sphinx/sphinx.conf (добавляем в самое начало)
  24. # меняем значения которые записаны так :value например sql_host = :value меняем на sql_host = localhost
  25. > sudo mcedit /etc/sphinx/sphinx.conf
  26.  
  27. source DBConf
  28. {
  29. type = mysql
  30. sql_host = localhost
  31. sql_user = lazy
  32. sql_pass = lolkek
  33. sql_db = huidb
  34. sql_query_pre = SET NAMES utf8
  35. }
  36.  
  37. source Vids : DBConf
  38. {
  39. sql_query = \
  40. SELECT id, title, thumbnail, duration, categories, tags, original_thumbnail_url, views, UNIX_TIMESTAMP(created) as created \
  41. FROM vids
  42. sql_field_string = title
  43. sql_attr_string = thumbnail
  44. sql_attr_uint = duration
  45. sql_field_string = categories
  46. sql_attr_string = tags
  47. sql_attr_string = original_thumbnail_url
  48. sql_attr_uint = views
  49. sql_attr_timestamp = created
  50. }
  51.  
  52. index VidsIndex
  53. {
  54. type = plain
  55. source = Vids
  56. path = /usr/local/var/data/VidsIndexes
  57. #preopen = 1
  58. ondisk_attrs = 1
  59. morphology = stem_en
  60. docinfo = extern
  61. min_word_len = 3
  62. }
  63.  
  64. source Keys : DBConf
  65. {
  66. sql_query = \
  67. SELECT id, title \
  68. FROM searches
  69. sql_field_string = title
  70. }
  71.  
  72. index KeysIndex
  73. {
  74. type = plain
  75. source = Keys
  76. path = /usr/local/var/data/KeysIndexes
  77. #preopen = 1
  78. ondisk_attrs = 1
  79. morphology = stem_en
  80. docinfo = extern
  81. min_word_len = 3
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement