You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Simon Willnauer <si...@googlemail.com> on 2011/06/29 09:04:56 UTC
Re: svn commit: r1140859 - in /lucene/dev/trunk/solr/src:
java/org/apache/solr/search/function/FileFloatSource.java test/org/apache/solr/search/function/TestFunctionQuery.java
Good catch yonik!
thanks for fixing this!
On Tue, Jun 28, 2011 at 11:39 PM, <yo...@apache.org> wrote:
> Author: yonik
> Date: Tue Jun 28 21:39:01 2011
> New Revision: 1140859
>
> URL: http://svn.apache.org/viewvc?rev=1140859&view=rev
> Log:
> SOLR-2626, LUCENE-2831: fix offset bug in cutover to AtomicReaderContext
>
> Modified:
> lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FileFloatSource.java
> lucene/dev/trunk/solr/src/test/org/apache/solr/search/function/TestFunctionQuery.java
>
> Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FileFloatSource.java
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FileFloatSource.java?rev=1140859&r1=1140858&r2=1140859&view=diff
> ==============================================================================
> --- lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FileFloatSource.java (original)
> +++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/function/FileFloatSource.java Tue Jun 28 21:39:01 2011
> @@ -76,9 +76,8 @@ public class FileFloatSource extends Val
>
> @Override
> public DocValues getValues(Map context, AtomicReaderContext readerContext) throws IOException {
> - int offset = 0;
> + final int off = readerContext.docBase;
> ReaderContext topLevelContext = ReaderUtil.getTopLevelContext(readerContext);
> - final int off = offset;
>
> final float[] arr = getCachedFloats(topLevelContext.reader);
> return new FloatDocValues(this) {
>
> Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/search/function/TestFunctionQuery.java
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/search/function/TestFunctionQuery.java?rev=1140859&r1=1140858&r2=1140859&view=diff
> ==============================================================================
> --- lucene/dev/trunk/solr/src/test/org/apache/solr/search/function/TestFunctionQuery.java (original)
> +++ lucene/dev/trunk/solr/src/test/org/apache/solr/search/function/TestFunctionQuery.java Tue Jun 28 21:39:01 2011
> @@ -65,11 +65,25 @@ public class TestFunctionQuery extends S
> // lrf.args.put("version","2.0");
> for (float val : values) {
> String s = Float.toString(val);
> +
> if (field!=null) assertU(adoc("id", s, field, s));
> else assertU(adoc("id", s));
> +
> + if (random.nextInt(100) < 20) {
> + if (field!=null) assertU(adoc("id", s, field, s));
> + else assertU(adoc("id", s));
> + }
> +
> + if (random.nextInt(100) < 20) {
> + assertU(commit());
> +
> + }
> +
> +
> // System.out.println("added doc for " + val);
> }
> - assertU(optimize()); // squeeze out any possible deleted docs
> + // assertU(optimize()); // squeeze out any possible deleted docs
> + assertU(commit());
> }
>
> // replace \0 with the field name and create a parseable string
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org