In the examples for sunspot sunspot.github.com, a belongs_to :blog
association is indexed inside a searchable
block with integer :blog_id
. Later, the search can be constrained to a particular blog using with(:blog_id, 1)
.
If have done this, except the association is for a retailer
and the index is on retailer_id
. Yet, when searching, there are no results returned as soon as I use with(:retailer_id, 4)
. If this condition is left off, all of the results returned have a retailer_id = 4
.
I have reindexed, numerous times. I've tried both sunspot_rails 1.3.3 and 2.0.0.
All of the other text
fields appear to be indexing fine.
The query displayed in the Rails logs, going to solr, appears to include the proper fields.
What else might cause this?