You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2016/07/12 14:08:08 UTC
lucene-solr:branch_6_0: add points to back compat indices
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6_0 a1756f6de -> c33e1bb6b
add points to back compat indices
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c33e1bb6
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c33e1bb6
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c33e1bb6
Branch: refs/heads/branch_6_0
Commit: c33e1bb6bdf40a15415ffe7cc07e854fe0d2cda0
Parents: a1756f6
Author: Mike McCandless <mi...@apache.org>
Authored: Tue Jul 12 10:07:49 2016 -0400
Committer: Mike McCandless <mi...@apache.org>
Committed: Tue Jul 12 10:07:49 2016 -0400
----------------------------------------------------------------------
.../index/TestBackwardsCompatibility.java | 36 +++++++++++++++++++
.../org/apache/lucene/index/index.6.0.0-cfs.zip | Bin 13713 -> 15807 bytes
.../apache/lucene/index/index.6.0.0-nocfs.zip | Bin 13714 -> 15806 bytes
.../org/apache/lucene/index/index.6.0.1-cfs.zip | Bin 13723 -> 15820 bytes
.../apache/lucene/index/index.6.0.1-nocfs.zip | Bin 13732 -> 15823 bytes
5 files changed, 36 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c33e1bb6/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index 7f656a6..a87fde7 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -38,13 +38,18 @@ import java.util.regex.Pattern;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.document.BinaryDocValuesField;
+import org.apache.lucene.document.BinaryPoint;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.DoubleDocValuesField;
+import org.apache.lucene.document.DoublePoint;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.FloatDocValuesField;
+import org.apache.lucene.document.FloatPoint;
+import org.apache.lucene.document.IntPoint;
import org.apache.lucene.document.LegacyIntField;
import org.apache.lucene.document.LegacyLongField;
+import org.apache.lucene.document.LongPoint;
import org.apache.lucene.document.NumericDocValuesField;
import org.apache.lucene.document.SortedDocValuesField;
import org.apache.lucene.document.SortedNumericDocValuesField;
@@ -672,6 +677,8 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
final boolean is42Index = MultiFields.getMergedFieldInfos(reader).fieldInfo("dvSortedSet") != null;
// true if this is a 4.9+ index
final boolean is49Index = MultiFields.getMergedFieldInfos(reader).fieldInfo("dvSortedNumeric") != null;
+ // true if this index has points (>= 6.0)
+ final boolean hasPoints = MultiFields.getMergedFieldInfos(reader).fieldInfo("intPoint1d") != null;
assert is40Index;
@@ -803,6 +810,23 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
hits = searcher.search(new TermQuery(new Term("utf8", "ab\ud917\udc17cd")), 1000).scoreDocs;
assertEquals(34, hits.length);
+ if (hasPoints) {
+ doTestHits(searcher.search(IntPoint.newRangeQuery("intPoint1d", 0, 34), 1000).scoreDocs, 34, searcher.getIndexReader());
+ doTestHits(searcher.search(IntPoint.newRangeQuery("intPoint2d", new int[] {0, 0}, new int[] {34, 68}), 1000).scoreDocs, 34, searcher.getIndexReader());
+ doTestHits(searcher.search(FloatPoint.newRangeQuery("floatPoint1d", 0f, 34f), 1000).scoreDocs, 34, searcher.getIndexReader());
+ doTestHits(searcher.search(FloatPoint.newRangeQuery("floatPoint2d", new float[] {0f, 0f}, new float[] {34f, 68f}), 1000).scoreDocs, 34, searcher.getIndexReader());
+ doTestHits(searcher.search(LongPoint.newRangeQuery("longPoint1d", 0, 34), 1000).scoreDocs, 34, searcher.getIndexReader());
+ doTestHits(searcher.search(LongPoint.newRangeQuery("longPoint2d", new long[] {0, 0}, new long[] {34, 68}), 1000).scoreDocs, 34, searcher.getIndexReader());
+ doTestHits(searcher.search(DoublePoint.newRangeQuery("doublePoint1d", 0.0, 34.0), 1000).scoreDocs, 34, searcher.getIndexReader());
+ doTestHits(searcher.search(DoublePoint.newRangeQuery("doublePoint2d", new double[] {0.0, 0.0}, new double[] {34.0, 68.0}), 1000).scoreDocs, 34, searcher.getIndexReader());
+
+ byte[] bytes1 = new byte[4];
+ byte[] bytes2 = new byte[] {0, 0, 0, (byte) 34};
+ doTestHits(searcher.search(BinaryPoint.newRangeQuery("binaryPoint1d", bytes1, bytes2), 1000).scoreDocs, 34, searcher.getIndexReader());
+ byte[] bytes3 = new byte[] {0, 0, 0, (byte) 68};
+ doTestHits(searcher.search(BinaryPoint.newRangeQuery("binaryPoint2d", new byte[][] {bytes1, bytes1}, new byte[][] {bytes2, bytes3}), 1000).scoreDocs, 34, searcher.getIndexReader());
+ }
+
reader.close();
}
@@ -956,6 +980,18 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
doc.add(new NumericDocValuesField("dvShort", (short)id));
doc.add(new SortedSetDocValuesField("dvSortedSet", ref));
doc.add(new SortedNumericDocValuesField("dvSortedNumeric", id));
+
+ doc.add(new IntPoint("intPoint1d", id));
+ doc.add(new IntPoint("intPoint2d", id, 2*id));
+ doc.add(new FloatPoint("floatPoint1d", (float) id));
+ doc.add(new FloatPoint("floatPoint2d", (float) id, (float) 2*id));
+ doc.add(new LongPoint("longPoint1d", id));
+ doc.add(new LongPoint("longPoint2d", id, 2*id));
+ doc.add(new DoublePoint("doublePoint1d", (double) id));
+ doc.add(new DoublePoint("doublePoint2d", (double) id, (double) 2*id));
+ doc.add(new BinaryPoint("binaryPoint1d", bytes));
+ doc.add(new BinaryPoint("binaryPoint2d", bytes, bytes));
+
// a field with both offsets and term vectors for a cross-check
FieldType customType3 = new FieldType(TextField.TYPE_STORED);
customType3.setStoreTermVectors(true);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c33e1bb6/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.0-cfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.0-cfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.0-cfs.zip
index 009a446..c8622df 100644
Binary files a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.0-cfs.zip and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.0-cfs.zip differ
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c33e1bb6/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.0-nocfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.0-nocfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.0-nocfs.zip
index 695ee9a..3c245d1 100644
Binary files a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.0-nocfs.zip and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.0-nocfs.zip differ
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c33e1bb6/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.1-cfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.1-cfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.1-cfs.zip
index 3b5f00b..f10f1a8 100644
Binary files a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.1-cfs.zip and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.1-cfs.zip differ
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c33e1bb6/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.1-nocfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.1-nocfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.1-nocfs.zip
index dc5dc8c..d45b7fd 100644
Binary files a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.1-nocfs.zip and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.6.0.1-nocfs.zip differ