I have gotten sorting working from my rails application using acts_as_solr for text fields, as seen below with Title.
I am having problems getting it to work for date.
My model has the following
class Article < ActiveRecord::Base
acts_as_solr :fields[:title, {:title_s=> :string}, {:created_at_d => :date}]
def title_s
self.title
end
def created_at_d
self.created_at
end
The following is being sent to the solr server:
path=/select params={wt=ruby&rows=10start=0&sort=created_at_d_d+asc&fl=pk_i,score&q=(+searchtext)..........
The solr code
Article.paginate_all_by_solr(searchString, :order=> "created_at_d asc", :page = page, :per_page => results_per_page, :total_entrieds => count)
Is there something obvious I am doing wrong? I am not sure that the {:created_at_d => :date} in the model is the correct way to set up the index for dates.
When I just coin it off of :created_at, I get the error around tokenized fields similar to that when I tried to sort against :title.