Guest User

Untitled

a guest
Apr 16th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.55 KB | None | 0 0
  1. #I'm using Rails 2.0.2 and Sphinx 0.9.8-svn-r1065
  2.  
  3. class Contact < ActiveRecord::Base
  4. has_many :postal_addresses, :dependent => :delete_all
  5. has_many :email_addresses, :dependent => :delete_all
  6. has_many :phone_numbers, :dependent => :delete_all
  7. has_many :tasks, :dependent => :delete_all
  8. belongs_to :user
  9. belongs_to :event
  10.  
  11. has_many :contact_notes
  12. has_many :event_comments
  13.  
  14. belongs_to :member_role
  15. belongs_to :role_description
  16.  
  17. has_many :events_and_comments
  18. has_many :events, :through => :events_and_comments#, :unique => true
  19.  
  20. #for sphinx
  21. is_indexed :fields => ['first_name', 'last_name', 'grad_year'],
  22. :include => [{:association_name => 'postal_addresses', :field => 'city'}]
  23. #:include => [
  24. # {:association_name => 'postal_addresses', :field => 'city', :as => 'city'},
  25. # {:association_name => 'postal_addresses', :field => 'state', :as => 'state'},
  26. # {:association_name => 'postal_addresses', :field => 'zipcode', :as => 'zipcode'}
  27. #]
  28.  
  29. validates_presence_of :first_name, :last_name, :member_role_id
  30.  
  31. def fullname
  32. "#{self.first_name} #{self.last_name}"
  33. end
  34.  
  35. def fullname_with_prefix
  36. "#{self.title} #{self.first_name} #{self.last_name} #{self.suffix}"
  37. end
  38.  
  39. end
  40.  
  41. #returns this error
  42. rake ultrasphinx:configure
  43. (in /home/somewhere)
  44. Rebuilding configurations for development environment
  45. Available models are Contact
  46. Generating SQL
  47. rake aborted!
  48. Unidentified association macro :has_many. Please use the :association_sql key to manually specify the JOIN syntax.
  49.  
  50. (See full trace by running task with --trace)
  51.  
  52. # I don't see any documentation for association_sql, am I just doing this wrong?
  53.  
  54. #here is my default.base as well
  55.  
  56.  
  57. #
  58. # Sphinx/Ultrasphinx user-configurable options.
  59. #
  60. # Copy this file to RAILS_ROOT/config/ultrasphinx. You can use individual
  61. # namespaces if you want (e.g. development.base, production.base,
  62. # test.base).
  63. #
  64. # This file should not be handed directly to Sphinx. Use the rake task
  65. #
  66. # rake ultrasphinx::configure
  67. #
  68. # to generate a parallel default.conf file. This is the file that Sphinx itself will
  69. # use. The Ultrasphinx rake tasks automatically pass the correct file to
  70. # to Sphinx.
  71. #
  72. # It is safe to edit .base files by hand. It is not safe to edit the generated
  73. # .conf files. Do not symlink the .conf file to the .base file! I don't know why
  74. # people think they need to do that. It's wrong.
  75. #
  76.  
  77. indexer
  78. {
  79. # Indexer running options
  80. mem_limit = 256M
  81. }
  82.  
  83. searchd
  84. {
  85. # Daemon options
  86. # What interface the search daemon should listen on and where to store its logs
  87. address = 0.0.0.0
  88. port = 3312
  89. seamless_rotate = 1
  90. log = /opt/local/var/db/sphinx/log/searchd.log
  91. query_log = /opt/local/var/db/sphinx/log/query.log
  92. read_timeout = 5
  93. max_children = 300
  94. pid_file = /opt/local/var/db/sphinx/log/searchd.pid
  95. max_matches = 3000
  96. }
  97.  
  98. client
  99. {
  100. # Client options
  101. # Name of the Aspell dictionary (two letters max)
  102. dictionary_name = ap
  103. # How your application connects to the search daemon (not necessarily the same as above)
  104. server_host = localhost
  105. server_port = 3312
  106. }
  107.  
  108. source
  109. {
  110. # Individual SQL source options
  111. sql_range_step = 5000
  112. strip_html = 0
  113. index_html_attrs =
  114. sql_query_post =
  115. }
  116.  
  117. index
  118. {
  119. # Index building options
  120. path = /opt/local/var/db/sphinx/
  121. docinfo = extern # just leave this alone
  122. morphology = stem_en
  123. stopwords = # /path/to/stopwords.txt
  124. min_word_len = 1
  125.  
  126. # Enable these if you need wildcard searching. They will slow down indexing significantly.
  127. min_infix_len = 1
  128. enable_star = 1
  129.  
  130. charset_type = utf-8 # or sbcs (Single Byte Character Set)
  131. 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,
  132. }
Add Comment
Please, Sign In to add comment