lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject svn commit: r803735 - in /lucene/solr/trunk/client/ruby/solr-ruby: CHANGES.yml lib/solr/request/standard.rb test/unit/standard_request_test.rb
Date Wed, 12 Aug 2009 22:48:44 GMT
Author: ehatcher
Date: Wed Aug 12 22:48:43 2009
New Revision: 803735

URL: http://svn.apache.org/viewvc?rev=803735&view=rev
Log:
Update standard request to modern sort parameter style

Modified:
    lucene/solr/trunk/client/ruby/solr-ruby/CHANGES.yml
    lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/request/standard.rb
    lucene/solr/trunk/client/ruby/solr-ruby/test/unit/standard_request_test.rb

Modified: lucene/solr/trunk/client/ruby/solr-ruby/CHANGES.yml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/ruby/solr-ruby/CHANGES.yml?rev=803735&r1=803734&r2=803735&view=diff
==============================================================================
--- lucene/solr/trunk/client/ruby/solr-ruby/CHANGES.yml (original)
+++ lucene/solr/trunk/client/ruby/solr-ruby/CHANGES.yml Wed Aug 12 22:48:43 2009
@@ -1,3 +1,8 @@
+v0.0.8:
+  release_date: TBD
+  changes:
+    - Updated Solr::Request::Standard to use modern style sort parameter rather
+    
 v0.0.7:
   release_date: 2009-03-06
   changes:

Modified: lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/request/standard.rb
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/request/standard.rb?rev=803735&r1=803734&r2=803735&view=diff
==============================================================================
--- lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/request/standard.rb (original)
+++ lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/request/standard.rb Wed Aug 12 22:48:43
2009
@@ -46,11 +46,11 @@
     hash = {}
     
     # standard request param processing
-    sort = @params[:sort].collect do |sort|
+    hash[:sort] = @params[:sort].collect do |sort|
       key = sort.keys[0]
       "#{key.to_s} #{sort[key] == :descending ? 'desc' : 'asc'}"
     end.join(',') if @params[:sort]
-    hash[:q] = sort ? "#{@params[:query]};#{sort}" : @params[:query]
+    hash[:q] = @params[:query]
     hash["q.op"] = @params[:operator]
     hash[:df] = @params[:default_field]
 

Modified: lucene/solr/trunk/client/ruby/solr-ruby/test/unit/standard_request_test.rb
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/ruby/solr-ruby/test/unit/standard_request_test.rb?rev=803735&r1=803734&r2=803735&view=diff
==============================================================================
--- lucene/solr/trunk/client/ruby/solr-ruby/test/unit/standard_request_test.rb (original)
+++ lucene/solr/trunk/client/ruby/solr-ruby/test/unit/standard_request_test.rb Wed Aug 12
22:48:43 2009
@@ -95,8 +95,9 @@
   end
 
   def test_basic_sort
-    request = Solr::Request::Standard.new(:query => 'query', :sort => [{:title =>
:descending}])
-    assert_equal 'query;title desc', request.to_hash[:q]
+    request = Solr::Request::Standard.new(:query => 'query', :sort => [{:title =>
:descending}, {:date => :ascending}])
+    assert_equal 'query', request.to_hash[:q]
+    assert_equal 'title desc,date asc', request.to_hash[:sort]
   end
   
   def test_highlighting



Mime
View raw message