Sorry Pat, got another one for you :)

I think :source => :query generates an incorrect config file when the
attribute being indexed is through a has_and_belongs_to_many association.

As I understand it, the query should return a list of edition_id, tag_id
pairs?

My index definition for my Edition class contains the following
attribute line:

  has tags(:id), :as => :tag_ids, :source => :query

which generates this line in my sphinx config:

  sql_attr_multi = uint tag_ids from query; SELECT `tags`.`edition_id` * 12 + 0 
AS `id`, `tags`.`id` AS `tag_ids` FROM `tags`

This is close, but my tags table doesn't have an edition_id field. 

To confuse TS even more, if I try the following line in my edition:

  has supplier.tags(:id), :as => :tag_ids, :source => :query

I get this line in my config:

  sql_attr_multi = uint tag_ids from query; SELECT 
`tags_suppliers`.`supplier_id` * 12 + 0 AS `id`, `tags_suppliers`.`id` AS 
`tag_ids` FROM `tags_suppliers`

The first field should be the edition id, and the second refers to a non
exiting tags_suppliers.id.

-- James Healy <jimmy-at-deefa-dot-com>  Wed, 13 May 2009 18:10:59 +1000

--~--~---------~--~----~------------~-------~--~----~
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