Since this is a fix to a released version, we should probably have a
CHANGES entry?

-Yonik
http://www.lucidimagination.com



On Tue, Jul 12, 2011 at 4:17 PM,  <m...@apache.org> wrote:
> Author: mvg
> Date: Tue Jul 12 20:17:37 2011
> New Revision: 1145748
>
> URL: http://svn.apache.org/viewvc?rev=1145748&view=rev
> Log:
> fixed bug when start is bigger than rows and format is simple that zero 
> documents are returned even if there are documents to display.
>
> Modified:
>    
> lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/search/Grouping.java
>    
> lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/TestGroupingSearch.java
>
> Modified: 
> lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/search/Grouping.java
> URL: 
> http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/search/Grouping.java?rev=1145748&r1=1145747&r2=1145748&view=diff
> ==============================================================================
> --- 
> lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/search/Grouping.java
>  (original)
> +++ 
> lucene/dev/branches/branch_3x/solr/src/java/org/apache/solr/search/Grouping.java
>  Tue Jul 12 20:17:37 2011
> @@ -541,10 +541,6 @@ public class Grouping {
>       }
>
>       int len = docsGathered - offset;
> -      if (offset > len) {
> -        len = 0;
> -      }
> -
>       int[] docs = ArrayUtils.toPrimitive(ids.toArray(new 
> Integer[ids.size()]));
>       float[] docScores = ArrayUtils.toPrimitive(scores.toArray(new 
> Float[scores.size()]));
>       DocSlice docSlice = new DocSlice(offset, len, docs, docScores, 
> getMatches(), maxScore);
>
> Modified: 
> lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/TestGroupingSearch.java
> URL: 
> http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/TestGroupingSearch.java?rev=1145748&r1=1145747&r2=1145748&view=diff
> ==============================================================================
> --- 
> lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/TestGroupingSearch.java
>  (original)
> +++ 
> lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/TestGroupingSearch.java
>  Tue Jul 12 20:17:37 2011
> @@ -227,6 +227,21 @@ public class TestGroupingSearch extends
>     );
>   }
>
> +  @Test
> +  public void testGroupingSimpleFormatStartBiggerThanRows() throws Exception 
> {
> +    assertU(add(doc("id", "1")));
> +    assertU(add(doc("id", "2")));
> +    assertU(add(doc("id", "3")));
> +    assertU(add(doc("id", "4")));
> +    assertU(add(doc("id", "5")));
> +    assertU(commit());
> +
> +    assertJQ(
> +        req("q", "*:*", "start", "2", "rows", "1", "group", "true", 
> "group.field", "id", "group.main", "true"),
> +        "/response=={'numFound':5,'start':2,'docs':[{'id':'3'}]}"
> +    );
> +  }
> +
>   static String f = "foo_s1";
>   static String f2 = "foo2_i";
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to