You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by eh...@apache.org on 2008/07/13 20:30:57 UTC

svn commit: r676396 - in /lucene/solr/trunk/client/ruby/solr-ruby: CHANGES.yml lib/solr/request/standard.rb

Author: ehatcher
Date: Sun Jul 13 11:30:57 2008
New Revision: 676396

URL: http://svn.apache.org/viewvc?rev=676396&view=rev
Log:
SOLR-627: Add shards support to Standard request

Modified:
    lucene/solr/trunk/client/ruby/solr-ruby/CHANGES.yml
    lucene/solr/trunk/client/ruby/solr-ruby/lib/solr/request/standard.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=676396&r1=676395&r2=676396&view=diff
==============================================================================
--- lucene/solr/trunk/client/ruby/solr-ruby/CHANGES.yml (original)
+++ lucene/solr/trunk/client/ruby/solr-ruby/CHANGES.yml Sun Jul 13 11:30:57 2008
@@ -6,6 +6,7 @@
     - Fixed modify_document_test.rb so as to not be brittle with Hash ordering
     - Added support for alternate field highlighting to Solr::Request::Standard (and thus DisMax)
     - Added facet.offset support to Solr::Request::Standard/Dismax
+    - Added shards parameter to Solr::Request::Standard
   
 v0.0.5:
   release_date: 2007-08-27

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=676396&r1=676395&r2=676396&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 Sun Jul 13 11:30:57 2008
@@ -12,7 +12,7 @@
 
 class Solr::Request::Standard < Solr::Request::Select
 
-  VALID_PARAMS = [:query, :sort, :default_field, :operator, :start, :rows,
+  VALID_PARAMS = [:query, :sort, :default_field, :operator, :start, :rows, :shards,
     :filter_queries, :field_list, :debug_query, :explain_other, :facets, :highlighting, :mlt]
   
   def initialize(params)
@@ -38,6 +38,8 @@
     @params[:rows] = params[:rows].to_i if params[:rows]
     
     @params[:field_list] ||= ["*","score"]
+    
+    @params[:shards] ||= []
   end
   
   def to_hash
@@ -59,6 +61,7 @@
     hash[:fl] = @params[:field_list].join(',')
     hash[:debugQuery] = @params[:debug_query]
     hash[:explainOther] = @params[:explain_other]
+    hash[:shards] = @params[:shards].join(',') unless @params[:shards].empty?
     
     # facet parameter processing
     if @params[:facets]