mirror of https://github.com/apache/lucene.git
SOLR-2626, LUCENE-2831: fix offset bug in cutover to AtomicReaderContext
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1140859 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4a3b510739
commit
e5addc06d3
|
@ -76,9 +76,8 @@ public class FileFloatSource extends ValueSource {
|
|||
|
||||
@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) {
|
||||
|
|
|
@ -65,11 +65,25 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
|
|||
// 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
|
||||
|
|
Loading…
Reference in New Issue