Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AE39F200B4B for ; Thu, 21 Jul 2016 15:37:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ACE04160A94; Thu, 21 Jul 2016 13:37:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D853B160A7C for ; Thu, 21 Jul 2016 15:37:25 +0200 (CEST) Received: (qmail 80451 invoked by uid 500); 21 Jul 2016 13:37:24 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 80179 invoked by uid 99); 21 Jul 2016 13:37:24 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2016 13:37:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0946CE680D; Thu, 21 Jul 2016 13:37:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sarowe@apache.org To: commits@lucene.apache.org Date: Thu, 21 Jul 2016 13:37:28 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [06/51] [abbrv] lucene-solr:apiv2: add points to back compat indices archived-at: Thu, 21 Jul 2016 13:37:26 -0000 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/1e794e0e Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1e794e0e Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1e794e0e Branch: refs/heads/apiv2 Commit: 1e794e0ee26d17bdd8669a77592bbafaf758af18 Parents: 5def78b Author: Mike McCandless Authored: Tue Jul 12 10:07:49 2016 -0400 Committer: Mike McCandless Committed: Tue Jul 12 10:14:24 2016 -0400 ---------------------------------------------------------------------- .../index/TestBackwardsCompatibility.java | 36 +++++++++++++++++++ .../org/apache/lucene/index/index.6.0.0-cfs.zip | Bin 13744 -> 15807 bytes .../apache/lucene/index/index.6.0.0-nocfs.zip | Bin 13749 -> 15806 bytes .../org/apache/lucene/index/index.6.0.1-cfs.zip | Bin 13734 -> 15820 bytes .../apache/lucene/index/index.6.0.1-nocfs.zip | Bin 13735 -> 15823 bytes 5 files changed, 36 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1e794e0e/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 11096e4..8226022 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; @@ -700,6 +705,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; @@ -831,6 +838,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(); } @@ -983,6 +1007,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/1e794e0e/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 2993970..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/1e794e0e/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 55b5cc1..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/1e794e0e/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 4b8161f..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/1e794e0e/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 051b0ad..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