I am using Rails 3 sunspot solr. I want to restrict Objects to be indexed. e.g. Index Posts where ids ranges from 1..1000. After that it should not be index.
Finally I found my answer
searchable :if => :id_less_than_1000? do
...
end
def id_less_than_1000?
self.id < Post.maximum(:id)
end