sphinx-awlex.conf 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #
  2. # Minimal Sphinx configuration sample (clean, simple, functional)
  3. #
  4. source awlex-db
  5. {
  6. type = mysql
  7. sql_host = localhost
  8. sql_user = awlex
  9. sql_pass = VskbIskJ
  10. sql_db = awlex
  11. sql_port = 3306 # optional, default is 3306
  12. sql_query_pre = SET NAMES utf8
  13. }
  14. #--------------- more detailed query ---------------------------------------
  15. #---------------------------------------------------------------------------
  16. source src_items : awlex-db
  17. {
  18. sql_query = \
  19. SELECT \
  20. i.id, \
  21. i.caption, \
  22. i.description, \
  23. i.category_id, \
  24. cat.title AS category, \
  25. i.subcategory_id, \
  26. subcat.title AS subcategory, \
  27. pic.path AS pictures, \
  28. i.created_at \
  29. FROM items AS i \
  30. JOIN categories AS cat ON cat.id = i.category_id \
  31. JOIN subcategories AS subcat ON subcat.id = i.subcategory_id \
  32. LEFT JOIN \
  33. (SELECT item_id, GROUP_CONCAT(path SEPARATOR ", ") AS path FROM pictures GROUP BY item_id) as pic \
  34. ON pic.item_id = i.id \
  35. GROUP BY i.id;
  36. sql_field_string = caption
  37. sql_field_string = description
  38. sql_attr_uint = category_id
  39. sql_field_string = category
  40. sql_attr_uint = subcategory_id
  41. sql_field_string = subcategory
  42. sql_field_string = pictures
  43. sql_attr_timestamp = created_at
  44. }
  45. index items
  46. {
  47. source = src_items
  48. path = /home/awlex/public_html/awlex_site/storage/sphinx/data/items/items_index
  49. #morphology = stem_ru
  50. morphology = lemmatize_ru_all, stem_en
  51. min_word_len = 3
  52. min_infix_len = 2
  53. ignore_chars = U+AD
  54. blend_chars = +, &, U+23
  55. blend_mode = trim_tail, skip_pure
  56. charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+0430..U+044F, U+401->U+0435, U+451->U+0435
  57. }
  58. index items_rt
  59. {
  60. type = rt
  61. rt_mem_limit = 128M
  62. path = /home/awlex/public_html/awlex_site/storage/sphinx/data/items/items_rt
  63. rt_field = caption
  64. rt_field = description
  65. rt_attr_uint = subcategory_id
  66. }
  67. #--------------- less bud not worse ----------------------------------------
  68. #---------------------------------------------------------------------------
  69. source src_items_light : awlex-db
  70. {
  71. sql_query = SELECT * FROM items
  72. sql_field_string = caption
  73. sql_field_string = description
  74. sql_attr_uint = subcategory_id
  75. }
  76. index items_light : items
  77. {
  78. source = src_items_light
  79. path = /home/awlex/public_html/awlex_site/storage/sphinx/data/items_light/items_light_index
  80. }
  81. index items_light_rt
  82. {
  83. type = rt
  84. rt_mem_limit = 128M
  85. path = /home/awlex/public_html/awlex_site/storage/sphinx/data/items_light/items_light_rt
  86. rt_field = caption
  87. rt_field = description
  88. rt_attr_uint = subcategory_id
  89. }
  90. #---------------------------------------------------------------------------
  91. common {
  92. lemmatizer_base = /home/awlex/public_html/awlex_site/sphinx-3.0.2/dict
  93. }
  94. indexer
  95. {
  96. mem_limit = 128M
  97. lemmatizer_cache = 256M # cache it all
  98. }
  99. searchd
  100. {
  101. listen = 9312
  102. listen = 9306:mysql41
  103. log = /home/awlex/public_html/awlex_site/storage/sphinx/log/searchd.log
  104. query_log = /home/awlex/public_html/awlex_site/storage/sphinx/log/query.log
  105. read_timeout = 5
  106. max_children = 20
  107. pid_file = /home/awlex/public_html/awlex_site/storage/sphinx/log/searchd.pid
  108. seamless_rotate = 1
  109. preopen_indexes = 1
  110. unlink_old = 1
  111. workers = threads # for RT to work
  112. binlog_path = /home/awlex/public_html/awlex_site/storage/sphinx/data/binlog
  113. }