lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shalin Shekhar Mangar <shalinman...@gmail.com>
Subject Re: format of sort parameter in Solr::Request::Standard
Date Sun, 11 Oct 2009 09:54:09 GMT
On Fri, Oct 9, 2009 at 9:55 PM, Paul Rosen <paul@performantsoftware.com>wrote:

> Hi all,
>
> I'm using solr-ruby 0.0.7 and am having trouble getting Sort to work.
>
> I have the following statement:
>
> req = Solr::Request::Standard.new(:start => start, :rows => max,
>  :sort => [ :title_sort => :ascending ],
>  :query => query, :filter_queries => filter_queries,
>  :field_list => @field_list,
>  :facets => {:fields => @facet_fields, :mincount => 1, :missing => true,
> :limit => -1},
>  :highlighting => {:field_list => ['text'], :fragment_size => 600}, :shards
> => @cores)
>
> That produces no results, but removing the :sort parameter off does give
> results.
>
> Here is the output from solr:
>
> INFO: [merged] webapp=/solr path=/select
> params={wt=ruby&facet.limit=-1&rows=30&start=0&facet=true&facet.mincount=1&q=(rossetti);title_sort+asc&fl=archive,date_label,genre,role_ART,role_AUT,role_EDT,role_PBL,role_TRL,source,image,thumbnail,text_url,title,alternative,uri,url,exhibit_type,license,title_sort,author_sort&qt=standard&facet.missing=true&hl.fl=text&facet.field=genre&facet.field=archive&facet.field=freeculture&hl.fragsize=600&hl=true&shards=localhost:8983/solr/merged}
> status=0 QTime=19
>
> It looks to me like the string should have "&sort=title_sort+asc" instead
> of ";title_sort_asc" tacked on to the query, but I'm not sure about that.
>
>
I'm not a ruby guy but looking at the tests for solr-ruby, I see sort being
specified as follows:
request = Solr::Request::Standard.new(:query => 'query', :sort => [{:title
=> :descending}, {:date => :ascending}])

Hope that helps.
-- 
Regards,
Shalin Shekhar Mangar.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message