Guest User

Untitled

a guest
May 5th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. #rake task to start sphinx indexing.
  2.  
  3. sudo rake us:in
  4. (in /rails_root)
  5. $ indexer --config 'path_to_development.conf' --all
  6. sh: -c: line 0: unexpected EOF while looking for matching `''
  7. sh: -c: line 1: syntax error: unexpected end of file
  8.  
  9.  
  10.  
  11. #Here is my default.base file
  12.  
  13.  
  14. <% path = "/opt/local/var/db/sphinx/" %>
  15.  
  16.  
  17. # Indexing options
  18. indexer
  19. {
  20. mem_limit = 32M
  21.  
  22. # Ultrasphinx-specific key
  23. delta = <%= 12.hours %>
  24. }
  25.  
  26. # Daemon options
  27. searchd
  28. {
  29. # What interface the search daemon should listen on and where to store its logs
  30. address = localhost
  31. port = 3313
  32. seamless_rotate = 1
  33. log = <%= path %>log/searchd.log
  34. query_log = <%= path %>log/query.log
  35. read_timeout = 5
  36. max_children = 300
  37. pid_file = <%= path %>log/searchd.pid
  38. max_matches = 100000
  39. }
  40.  
  41. # Client options
  42. client
  43. {
  44. # Name of the Aspell dictionary (two letters max)
  45. #dictionary_name = ap
  46.  
  47. # How your application connects to the search daemon (not necessarily the same as above)
  48. server_host = localhost
  49. server_port = 3313
  50. }
  51.  
  52. # Individual SQL source options
  53. source
  54. {
  55. sql_ranged_throttle = 0
  56. sql_range_step = 5000
  57. sql_query_post =
  58. }
  59.  
  60. # Index building options
  61. index
  62. {
  63. path = <%= path %>
  64. docinfo = extern # Just leave this alone
  65. morphology = stem_en
  66. stopwords = # <%= path %>/ap-stopwords.txt
  67. min_word_len = 1
  68.  
  69. # HTML-specific options
  70. html_strip = 0
  71. html_index_attrs =
  72.  
  73. # Enable these if you need wildcard searching. They will slow down indexing significantly.
  74. #min_infix_len = 1
  75. #enable_star = 1
  76.  
  77. charset_type = utf-8 # or sbcs (Single Byte Character Set)
  78. charset_table = 0..9, A..Z->a..z, -, @, _, ., &, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F,U+C5->U+E5, U+E5, U+C4->U+E4, U+E4, U+D6->U+F6, U+F6, U+16B, U+0c1->a, U+0c4->a, U+0c9->e, U+0cd->i, U+0d3->o, U+0d4->o, U+0da->u, U+0dd->y, U+0e1->a, U+0e4->a, U+0e9->e, U+0ed->i, U+0f3->o, U+0f4->o, U+0fa->u, U+0fd->y, U+104->U+105, U+105, U+106->U+107, U+10c->c, U+10d->c, U+10e->d, U+10f->d, U+116->U+117, U+117, U+118->U+119, U+11a->e, U+11b->e, U+12E->U+12F, U+12F, U+139->l, U+13a->l, U+13d->l, U+13e->l, U+141->U+142, U+142, U+143->U+144, U+144,U+147->n, U+148->n, U+154->r, U+155->r, U+158->r, U+159->r, U+15A->U+15B, U+15B, U+160->s, U+160->U+161, U+161->s, U+164->t, U+165->t, U+16A->U+16B, U+16B, U+16e->u, U+16f->u, U+172->U+173, U+173, U+179->U+17A, U+17A, U+17B->U+17C, U+17C, U+17d->z, U+17e->z,
  79. }
  80.  
  81.  
  82. # here is my model
  83.  
  84. class DischargeRecord < ActiveRecord::Base
  85.  
  86. has_many :procedures, :dependent => :destroy
  87. has_many :diagnoses, :dependent => :destroy
  88.  
  89. is_indexed :fields => ['oshpd_id']
  90.  
  91.  
  92. end
  93.  
  94.  
  95.  
  96.  
  97.  
  98. #if needed here is the generated development.conf file
  99.  
  100.  
  101. # Auto-generated at Tue Sep 02 16:40:31 -0600 2008.
  102. # Hand modifications will be overwritten.
  103. # /Users/paulsmith1/Desktop/MyRailsApps/Rigby's Healthcare Projects/oshpd_database/config/ultrasphinx/default.base
  104. indexer {
  105. mem_limit = 64M
  106. }
  107.  
  108. searchd {
  109. read_timeout = 5
  110. max_children = 300
  111. log = /opt/local/var/db/sphinx/log/searchd.log
  112. port = 3313
  113. max_matches = 100000
  114. query_log = /opt/local/var/db/sphinx/log/query.log
  115. seamless_rotate = 1
  116. pid_file = /opt/local/var/db/sphinx/log/searchd.pid
  117. address = 0.0.0.0
  118. }
  119.  
  120. # Source configuration
  121.  
  122. source discharge_records_main
  123. {
  124. sql_range_step = 5000
  125. sql_query_post =
  126. sql_ranged_throttle = 0
  127.  
  128. type = mysql
  129. sql_query_pre = SET SESSION group_concat_max_len = 65535
  130. sql_query_pre = SET NAMES utf8
  131.  
  132. sql_db = oshpd_development
  133. sql_host = localhost
  134. sql_pass =
  135. sql_sock = /private/tmp/mysql.sock
  136. sql_user = root
  137. sql_query_range = SELECT MIN(id) , MAX(id) FROM discharge_records
  138. sql_query = SELECT (discharge_records.id * 1 + 0) AS id, 'DischargeRecord' AS class, 0 AS class_id, discharge_records.oshpd_id AS oshpd_id FROM discharge_records WHERE discharge_records.id >= $start AND discharge_records.id <= $end GROUP BY discharge_records.id
  139.  
  140. sql_attr_uint = class_id
  141. sql_query_info = SELECT * FROM discharge_records WHERE discharge_records.id = (($id - 0) / 1)
  142. }
  143.  
  144.  
  145. # Index configuration
  146.  
  147. index main
  148. {
  149. source = discharge_records_main
  150. charset_type = utf-8
  151. html_index_attrs =
  152. charset_table = 0..9, A..Z->a..z, -, _, ., &, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F,U+C5->U+E5, U+E5, U+C4->U+E4, U+E4, U+D6->U+F6, U+F6, U+16B, U+0c1->a, U+0c4->a, U+0c9->e, U+0cd->i, U+0d3->o, U+0d4->o, U+0da->u, U+0dd->y, U+0e1->a, U+0e4->a, U+0e9->e, U+0ed->i, U+0f3->o, U+0f4->o, U+0fa->u, U+0fd->y, U+104->U+105, U+105, U+106->U+107, U+10c->c, U+10d->c, U+10e->d, U+10f->d, U+116->U+117, U+117, U+118->U+119, U+11a->e, U+11b->e, U+12E->U+12F, U+12F, U+139->l, U+13a->l, U+13d->l, U+13e->l, U+141->U+142, U+142, U+143->U+144, U+144,U+147->n, U+148->n, U+154->r, U+155->r, U+158->r, U+159->r, U+15A->U+15B, U+15B, U+160->s, U+160->U+161, U+161->s, U+164->t, U+165->t, U+16A->U+16B, U+16B, U+16e->u, U+16f->u, U+172->U+173, U+173, U+179->U+17A, U+17A, U+17B->U+17C, U+17C, U+17d->z, U+17e->z,
  153. min_word_len = 1
  154. # enable_star = 1
  155. stopwords =
  156. html_strip = 0
  157. path = /opt/local/var/db/sphinx//sphinx_index_main
  158. docinfo = extern
  159. morphology = stem_en
  160. # min_infix_len = 1
  161. }
Add Comment
Please, Sign In to add comment