lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject svn commit: r632578 - in /lucene/solr/trunk/client/ruby/solr-ruby: CHANGES.yml lib/solr/request/standard.rb test/unit/standard_request_test.rb
Date Sat, 01 Mar 2008 11:17:29 GMT
Author: ehatcher
Date: Sat Mar  1 03:17:28 2008
New Revision: 632578

URL: http://svn.apache.org/viewvc?rev=632578&view=rev
Log:
SOLR-492: Add facet.offset support to standard/dismax requests

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=632578&r1=632577&r2=632578&view=diff
==============================================================================
--- lucene/solr/trunk/client/ruby/solr-ruby/CHANGES.yml (original)
+++ lucene/solr/trunk/client/ruby/solr-ruby/CHANGES.yml Sat Mar  1 03:17:28 2008
@@ -5,6 +5,7 @@
     - Enabled Solr::Requst::Select to work as a general pass through to any registered request
handler
     - 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
   
 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=632578&r1=632577&r2=632578&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 Sat Mar  1 03:17:28
2008
@@ -71,6 +71,7 @@
       hash["facet.missing"] = @params[:facets][:missing]
       hash["facet.mincount"] = @params[:facets][:mincount]
       hash["facet.prefix"] = @params[:facets][:prefix]
+      hash["facet.offset"] = @params[:facets][:offset]
       if @params[:facets][:fields]  # facet fields are optional (could be facet.query only)
         @params[:facets][:fields].each do |f|
           if f.kind_of? Hash
@@ -82,6 +83,7 @@
             hash["f.#{key}.facet.missing"] = value[:missing]
             hash["f.#{key}.facet.mincount"] = value[:mincount]
             hash["f.#{key}.facet.prefix"] = value[:prefix]
+            hash["f.#{key}.facet.offset"] = value[:offset]
           else
             hash["facet.field"] << f
           end

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=632578&r1=632577&r2=632578&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 Sat Mar  1
03:17:28 2008
@@ -71,10 +71,10 @@
        :facets => {
          :fields => [:genre,           
                      # field that overrides the global facet parameters
-                     {:year => {:limit => 50, :mincount => 0, :missing => false,
:sort => :term, :prefix=>"199"}}], 
+                     {:year => {:limit => 50, :mincount => 0, :missing => false,
:sort => :term, :prefix=>"199", :offset => 7}}], 
          :queries => ["q1", "q2"],
          :prefix => "cat",
-         :limit => 5, :zeros => true, :mincount => 20, :sort => :count  # global
facet parameters
+         :offset => 3, :limit => 5, :zeros => true, :mincount => 20, :sort =>
:count  # global facet parameters
         }
     )
     
@@ -90,6 +90,8 @@
     assert_equal 0, hash["f.year.facet.mincount"]
     assert_equal false, hash["f.year.facet.sort"]
     assert_equal "199", hash["f.year.facet.prefix"]
+    assert_equal 3, hash["facet.offset"]
+    assert_equal 7, hash["f.year.facet.offset"]
   end
 
   def test_basic_sort



Mime
View raw message