Advertisement
Guest User

Sphinx Config

a guest
Oct 31st, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.85 KB | None | 0 0
  1. #
  2. # Minimal Sphinx configuration sample (clean, simple, functional)
  3. #
  4.  
  5. source articles
  6. {
  7.         type                    = mysql
  8.  
  9.         sql_host                = localhost
  10.         sql_user                = username
  11.         sql_pass                = mypassword
  12.         sql_db                  = mydatabase
  13.         sql_port                = 3306  # optional, default is 3306
  14.  
  15.         sql_query               = SELECT ID, 1 AS table_id, Title, Title AS Titless, Description FROM articles
  16.         sql_attr_uint           = table_id
  17. }
  18.  
  19. index articles
  20. {
  21.         source                  = articles
  22.         path                    = data/articles
  23.         docinfo                 = extern
  24.         charset_type            = utf-8
  25.         min_word_len            = 3
  26.         min_prefix_len          = 0
  27.         min_infix_len           = 3
  28. }
  29.  
  30. source publications
  31. {
  32.         type                    = mysql
  33.  
  34.         sql_host                = localhost
  35.         sql_user                = username
  36.         sql_pass                = mypassword
  37.         sql_db                  = mydatabase
  38.         sql_port                = 3306  # optional, default is 3306
  39.  
  40.         sql_query               = SELECT Title_ID, 2 AS table_id, Title, PageTitle, PageContent, Description FROM publications
  41.         sql_attr_uint           = table_id
  42. }
  43.  
  44. index publications
  45. {
  46.         source                  = publications
  47.         path                    = data/publications
  48.         docinfo                 = extern
  49.         charset_type            = utf-8
  50.         min_word_len            = 3
  51.         min_prefix_len          = 0
  52.         min_infix_len           = 3
  53. }
  54.  
  55. source library_content
  56. {
  57.         type                    = mysql
  58.  
  59.         sql_host                = localhost
  60.         sql_user                = username
  61.         sql_pass                = mypassword
  62.         sql_db                  = mydatabase
  63.         sql_port                = 3306  # optional, default is 3306
  64.  
  65.         sql_query               = SELECT articles.ID, articles.Title, library_article_content.ArticleID, 3 AS table_id, library_article_content.FileText FROM library_article_content \
  66.                                   INNER JOIN articles ON articles.id = library_article_content.ArticleID \
  67.                                   WHERE ( \
  68.                                 (       SELECT Live FROM publications \
  69.                                         WHERE publications.Title_ID=articles.PublicationID \
  70.                                 ) = 1 \
  71.                                 OR isNULL(articles.PublicationID) \
  72.                                 OR ( \
  73.                                         articles.PublicationID = -1 \
  74.                                         AND ( \
  75.                                                 SELECT COUNT(*) \
  76.                                                 FROM library_article_content \
  77.                                                 WHERE library_article_content.ArticleID=articles.ID \
  78.                                         ) = 0 \
  79.                                     ) \
  80.                             )
  81.         sql_attr_uint           = table_id
  82. }
  83.  
  84. index library_content
  85. {
  86.         source                  = library_content
  87.         path                    = data/library_content
  88.         docinfo                 = extern
  89.         charset_type            = utf-8
  90.         min_word_len            = 3
  91.         min_prefix_len          = 0
  92.         min_infix_len           = 3
  93. }
  94.  
  95. source tt_content
  96. {
  97.         type                    = mysql
  98.  
  99.         sql_host                = localhost
  100.         sql_user                = username
  101.         sql_pass                = mypassword
  102.         sql_db                  = mydatabase
  103.         sql_port                = 3306  # optional, default is 3306
  104.  
  105.         sql_query               = SELECT articles.ID, articles.Title, tt_article_content.ArticleID, 4 AS table_id, \
  106.                                     tt_article_content.PageContent FROM tt_article_content \
  107.                                 INNER JOIN articles ON articles.id = tt_article_content.ArticleID \
  108.                                   WHERE ( \
  109.                                 (       SELECT Live FROM publications \
  110.                                         WHERE publications.Title_ID=articles.PublicationID \
  111.                                 ) = 1 \
  112.                                 OR isNULL(articles.PublicationID) \
  113.                                 OR ( \
  114.                                         articles.PublicationID = -1 \
  115.                                         AND ( \
  116.                                                 SELECT COUNT(*) \
  117.                                                 FROM tt_article_content \
  118.                                                 WHERE tt_article_content.ArticleID=articles.ID \
  119.                                         ) = 0 \
  120.                                 ) \
  121.                         )
  122.         sql_attr_uint           = table_id
  123. }
  124.  
  125. index tt_content
  126. {
  127.         source                  = tt_content
  128.         path                    = data/tt_content
  129.         docinfo                 = extern
  130.         charset_type            = utf-8
  131.         min_word_len            = 3
  132.         min_prefix_len          = 0
  133.         min_infix_len           = 3
  134. }
  135.  
  136. indexer
  137. {
  138.         mem_limit               = 32M
  139. }
  140.  
  141. searchd
  142. {
  143.         listen                  = 9312
  144.         listen                  = 3312:mysql41
  145.         log                     = /var/log/searchd.log
  146.         query_log               = /var/log/query.log
  147.         read_timeout            = 5
  148.         max_children            = 0
  149.         pid_file                = /var/log/searchd.pid
  150.         max_matches             = 1000
  151.         seamless_rotate         = 1
  152.         preopen_indexes         = 1
  153.         unlink_old              = 1
  154.         workers                 = threads # for RT to work
  155.         binlog_path             = /var/data
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement