ANSWERED: set_primary_key "QTLID" in the model to tell model that
pirmary ID is not ID

SEE:
http://groups.google.com/group/thinking-sphinx/browse_thread/thread/fb289d9a4d72de94/c4e16721c3c40480?lnk=gst&q=Cannot+automatically+map+attribute+sphinx_internal_id#c4e16721c3c40480
On Jan 3, 3:30 pm, Benjamin Mulaosmanovic <[email protected]>
wrote:
> I am getting this error when I rake:ts index
>
> Cannot automatically map attribute sphinx_internal_id in QtlTable to
> an
> equivalent Sphinx type (integer, float, boolean, datetime, string as
> ordinal).
> You could try to explicitly convert the column's value in your
> define_index
> block:
>   has "CAST(column AS INT)", :type => :integer, :as => :column
> I can't figure out how to fix this.
>
> Here is my model (note I did not setup this database so don't jump on
> me for terrible conventions):
>
> class QtlTable < ActiveRecord::Base
>    ...
>     define_index do
>       indexes :QTLID
>       has :QTLName
>     end
> end
> Here is what schema looks like for qtl_table:
>
> create_table "qtl_table", :primary_key => "QTLID", :force => true do |
> t|
>   t.string "QTLName",                     :limit => 60,       :default
> => "", :null => false
>   t.string "Parent_1",                    :limit => 60,       :default
> => "", :null => false
>   t.string "Parent_2",                    :limit => 60,       :default
> => "", :null => false
>   t.string "Heritability",                :limit => 60,       :default
> => ""
>   t.text   "Population_size",             :limit => 16777215
>   t.string "Number_plants_bulked",        :limit => 10
>   t.text   "Pop_high_score",              :limit => 16777215
>   t.text   "Pop_low_score",               :limit => 16777215
>   t.string "Loci_tested",                 :limit => 10,       :default
> => ""
>   t.string "Intervals_associated",        :limit => 10,       :default
> => ""
>   t.string "Interval_length",             :limit => 6,        :default
> => ""
>   t.string "Interval_LOD_score",          :limit => 12,       :default
> => ""
>   t.string "Interval_P_value",            :limit => 6,        :default
> => ""
>   t.string "Interval_R2",                 :limit => 6,        :default
> => ""
>   t.string "Genotypic_R2",                :limit => 6,        :default
> => ""
>   t.text   "R2_Definition",               :limit => 16777215
>   t.string "Percent_variation_explained", :limit => 6,        :default
> => ""
>   t.string "First_entered",               :limit => 60,       :default
> => "", :null => false
>   t.string "Last_update",                 :limit => 60,       :default
> => ""
>   t.string "TraitName",                   :limit => 100,      :default
> => ""
>   t.binary "in_new",                      :limit => 1
> end
>
> add_index "qtl_table", ["QTLName"], :name => "QTLName_index"
> add_index "qtl_table", ["TraitName"], :name => "TraitName_index"

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to