Here's my set up.
Game model
title
description
Distributer
title
link
DistributerGame associated model
game_id
distributer_id
link
I'm trying to add the define_index block to my DistributerGame model.
define_index do
join distributer_game.game
# fields
indexes game.title, :as => :game_title
# attributes
has game_id, :type => :integer, :as => :game_id
has distributer_id, :type => :integer, :as => :distributer_id, :facet
=> true
end
when i try to index i get the following error:
Cannot automatically map attribute sphinx_internal_id in DistributerGame 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'm guessing this has somethingt o do with having no primary key? but have
no idea how to move forwards. Any help would be REALLy appreciated.
Thanks,
Matt
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/thinking-sphinx/-/rgsHtigTdAYJ.
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.