diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 468cbd627c0..42d161677b5 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -39,25 +39,28 @@ New Features
* LUCENE-6825: Add low-level support for block-KD trees (Mike McCandless)
-* LUCENE-6852: Add support for dimensionally indexed values to index,
- document and codec APIs, including a simple text implementation.
- (Mike McCandless)
+* LUCENE-6852, LUCENE-6975: Add support for points (dimensionally
+ indexed values) to index, document and codec APIs, including a
+ simple text implementation. (Mike McCandless)
-* LUCENE-6861: Create Lucene60Codec, supporting dimensional values.
+* LUCENE-6861: Create Lucene60Codec, supporting points.
(Mike McCandless)
* LUCENE-6879: Allow to define custom CharTokenizer instances without
subclassing using Java 8 lambdas or method references. (Uwe Schindler)
-* LUCENE-6881: Cutover all BKD implementations to dimensional values
+* LUCENE-6881: Cutover all BKD implementations to points
(Mike McCandless)
* LUCENE-6837: Add N-best output support to JapaneseTokenizer.
(Hiroharu Konno via Christian Moen)
-* LUCENE-6962: Add per-dimension min/max to dimensional values
+* LUCENE-6962: Add per-dimension min/max to points
(Mike McCandless)
+* LUCENE-6975: Add ExactPointQuery, to match a single N-dimensional
+ point (Robert Muir, Mike McCandless)
+
API Changes
* LUCENE-6067: Accountable.getChildResources has a default
@@ -82,18 +85,18 @@ API Changes
McCandless)
* LUCENE-6917: Deprecate and rename NumericXXX classes to
- LegacyNumericXXX in favor of dimensional values (Mike McCandless)
+ LegacyNumericXXX in favor of points (Mike McCandless)
* LUCENE-6947: SortField.missingValue is now protected. You can read its value
using the new SortField.getMissingValue getter. (Adrien Grand)
Optimizations
-* LUCENE-6891: Use prefix coding when writing dimensional values in
+* LUCENE-6891: Use prefix coding when writing points in
each leaf block in the default codec, to reduce the index
size (Mike McCandless)
-* LUCENE-6901: Optimize dimensional values indexing: use faster
+* LUCENE-6901: Optimize points indexing: use faster
IntroSorter instead of InPlaceMergeSorter, and specialize 1D
merging to merge sort the already sorted segments instead of
re-indexing (Mike McCandless)
diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene50/Lucene50Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene50/Lucene50Codec.java
index faf46d03105..95796745f3d 100644
--- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene50/Lucene50Codec.java
+++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene50/Lucene50Codec.java
@@ -21,7 +21,7 @@ import java.util.Objects;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.CompoundFormat;
-import org.apache.lucene.codecs.DimensionalFormat;
+import org.apache.lucene.codecs.PointFormat;
import org.apache.lucene.codecs.DocValuesFormat;
import org.apache.lucene.codecs.FieldInfosFormat;
import org.apache.lucene.codecs.FilterCodec;
@@ -154,8 +154,8 @@ public class Lucene50Codec extends Codec {
}
@Override
- public final DimensionalFormat dimensionalFormat() {
- return DimensionalFormat.EMPTY;
+ public final PointFormat pointFormat() {
+ return PointFormat.EMPTY;
}
private final PostingsFormat defaultFormat = PostingsFormat.forName("Lucene50");
diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene53/Lucene53Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene53/Lucene53Codec.java
index dfd0f223af9..1ec140640f0 100644
--- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene53/Lucene53Codec.java
+++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene53/Lucene53Codec.java
@@ -21,7 +21,7 @@ import java.util.Objects;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.CompoundFormat;
-import org.apache.lucene.codecs.DimensionalFormat;
+import org.apache.lucene.codecs.PointFormat;
import org.apache.lucene.codecs.DocValuesFormat;
import org.apache.lucene.codecs.FieldInfosFormat;
import org.apache.lucene.codecs.FilterCodec;
@@ -160,8 +160,8 @@ public class Lucene53Codec extends Codec {
}
@Override
- public final DimensionalFormat dimensionalFormat() {
- return DimensionalFormat.EMPTY;
+ public final PointFormat pointFormat() {
+ return PointFormat.EMPTY;
}
private final PostingsFormat defaultFormat = PostingsFormat.forName("Lucene50");
diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene54/Lucene54Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene54/Lucene54Codec.java
index bb129ac2c08..4ca25219545 100644
--- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene54/Lucene54Codec.java
+++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene54/Lucene54Codec.java
@@ -21,7 +21,7 @@ import java.util.Objects;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.CompoundFormat;
-import org.apache.lucene.codecs.DimensionalFormat;
+import org.apache.lucene.codecs.PointFormat;
import org.apache.lucene.codecs.DocValuesFormat;
import org.apache.lucene.codecs.FieldInfosFormat;
import org.apache.lucene.codecs.FilterCodec;
@@ -160,8 +160,8 @@ public class Lucene54Codec extends Codec {
}
@Override
- public final DimensionalFormat dimensionalFormat() {
- return DimensionalFormat.EMPTY;
+ public final PointFormat pointFormat() {
+ return PointFormat.EMPTY;
}
private final PostingsFormat defaultFormat = PostingsFormat.forName("Lucene50");
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextBKDReader.java b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextBKDReader.java
index 6e073d60a59..f07c4a3afaf 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextBKDReader.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextBKDReader.java
@@ -20,16 +20,16 @@ package org.apache.lucene.codecs.simpletext;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
-import org.apache.lucene.index.DimensionalValues.IntersectVisitor;
+import org.apache.lucene.index.PointValues.IntersectVisitor;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefBuilder;
import org.apache.lucene.util.StringHelper;
import org.apache.lucene.util.bkd.BKDReader;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.BLOCK_COUNT;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.BLOCK_DOC_ID;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.BLOCK_VALUE;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.BLOCK_COUNT;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.BLOCK_DOC_ID;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.BLOCK_VALUE;
class SimpleTextBKDReader extends BKDReader {
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java
index f8285c16ec1..89cd859b6d9 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextCodec.java
@@ -19,7 +19,7 @@ package org.apache.lucene.codecs.simpletext;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.CompoundFormat;
-import org.apache.lucene.codecs.DimensionalFormat;
+import org.apache.lucene.codecs.PointFormat;
import org.apache.lucene.codecs.DocValuesFormat;
import org.apache.lucene.codecs.FieldInfosFormat;
import org.apache.lucene.codecs.LiveDocsFormat;
@@ -45,7 +45,7 @@ public final class SimpleTextCodec extends Codec {
private final LiveDocsFormat liveDocs = new SimpleTextLiveDocsFormat();
private final DocValuesFormat dvFormat = new SimpleTextDocValuesFormat();
private final CompoundFormat compoundFormat = new SimpleTextCompoundFormat();
- private final DimensionalFormat dimensionalFormat = new SimpleTextDimensionalFormat();
+ private final PointFormat pointFormat = new SimpleTextPointFormat();
public SimpleTextCodec() {
super("SimpleText");
@@ -97,7 +97,7 @@ public final class SimpleTextCodec extends Codec {
}
@Override
- public DimensionalFormat dimensionalFormat() {
- return dimensionalFormat;
+ public PointFormat pointFormat() {
+ return pointFormat;
}
}
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldInfosFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldInfosFormat.java
index dc68f7244c3..109966a9673 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldInfosFormat.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldInfosFormat.java
@@ -232,11 +232,11 @@ public class SimpleTextFieldInfosFormat extends FieldInfosFormat {
}
SimpleTextUtil.write(out, DIM_COUNT);
- SimpleTextUtil.write(out, Integer.toString(fi.getDimensionCount()), scratch);
+ SimpleTextUtil.write(out, Integer.toString(fi.getPointDimensionCount()), scratch);
SimpleTextUtil.writeNewline(out);
SimpleTextUtil.write(out, DIM_NUM_BYTES);
- SimpleTextUtil.write(out, Integer.toString(fi.getDimensionNumBytes()), scratch);
+ SimpleTextUtil.write(out, Integer.toString(fi.getPointNumBytes()), scratch);
SimpleTextUtil.writeNewline(out);
}
SimpleTextUtil.writeChecksum(out, scratch);
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPointFormat.java
similarity index 65%
rename from lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalFormat.java
rename to lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPointFormat.java
index 56e7579808f..089ba4f6f5a 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalFormat.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPointFormat.java
@@ -19,9 +19,9 @@ package org.apache.lucene.codecs.simpletext;
import java.io.IOException;
-import org.apache.lucene.codecs.DimensionalFormat;
-import org.apache.lucene.codecs.DimensionalReader;
-import org.apache.lucene.codecs.DimensionalWriter;
+import org.apache.lucene.codecs.PointFormat;
+import org.apache.lucene.codecs.PointReader;
+import org.apache.lucene.codecs.PointWriter;
import org.apache.lucene.index.SegmentReadState;
import org.apache.lucene.index.SegmentWriteState;
@@ -33,21 +33,21 @@ import org.apache.lucene.index.SegmentWriteState;
* any text editor, and even edit it to alter your index.
*
* @lucene.experimental */
-public final class SimpleTextDimensionalFormat extends DimensionalFormat {
+public final class SimpleTextPointFormat extends PointFormat {
@Override
- public DimensionalWriter fieldsWriter(SegmentWriteState state) throws IOException {
- return new SimpleTextDimensionalWriter(state);
+ public PointWriter fieldsWriter(SegmentWriteState state) throws IOException {
+ return new SimpleTextPointWriter(state);
}
@Override
- public DimensionalReader fieldsReader(SegmentReadState state) throws IOException {
- return new SimpleTextDimensionalReader(state);
+ public PointReader fieldsReader(SegmentReadState state) throws IOException {
+ return new SimpleTextPointReader(state);
}
- /** Extension of dimensional data file */
- static final String DIMENSIONAL_EXTENSION = "dim";
+ /** Extension of points data file */
+ static final String POINT_EXTENSION = "dim";
- /** Extension of dimensional index file */
- static final String DIMENSIONAL_INDEX_EXTENSION = "dii";
+ /** Extension of points index file */
+ static final String POINT_INDEX_EXTENSION = "dii";
}
diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalReader.java b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPointReader.java
similarity index 72%
rename from lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalReader.java
rename to lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPointReader.java
index 800e174a497..222805e8aba 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalReader.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPointReader.java
@@ -22,7 +22,7 @@ import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
-import org.apache.lucene.codecs.DimensionalReader;
+import org.apache.lucene.codecs.PointReader;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.IndexFileNames;
@@ -36,32 +36,32 @@ import org.apache.lucene.util.BytesRefBuilder;
import org.apache.lucene.util.StringHelper;
import org.apache.lucene.util.bkd.BKDReader;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.BLOCK_FP;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.BYTES_PER_DIM;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.FIELD_COUNT;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.FIELD_FP;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.FIELD_FP_NAME;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.INDEX_COUNT;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.MAX_LEAF_POINTS;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.MAX_VALUE;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.MIN_VALUE;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.NUM_DIMS;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.SPLIT_COUNT;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.SPLIT_DIM;
-import static org.apache.lucene.codecs.simpletext.SimpleTextDimensionalWriter.SPLIT_VALUE;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.BLOCK_FP;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.BYTES_PER_DIM;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.FIELD_COUNT;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.FIELD_FP;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.FIELD_FP_NAME;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.INDEX_COUNT;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.MAX_LEAF_POINTS;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.MAX_VALUE;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.MIN_VALUE;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.NUM_DIMS;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.SPLIT_COUNT;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.SPLIT_DIM;
+import static org.apache.lucene.codecs.simpletext.SimpleTextPointWriter.SPLIT_VALUE;
-class SimpleTextDimensionalReader extends DimensionalReader {
+class SimpleTextPointReader extends PointReader {
private final IndexInput dataIn;
final SegmentReadState readState;
final MapprecisionStep
* parameter as well as how numeric fields work under the hood.
* The default implementation returns {@code this} */
- public DimensionalReader getMergeInstance() throws IOException {
+ public PointReader getMergeInstance() throws IOException {
return this;
}
}
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/DimensionalWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/PointWriter.java
similarity index 85%
rename from lucene/core/src/java/org/apache/lucene/codecs/DimensionalWriter.java
rename to lucene/core/src/java/org/apache/lucene/codecs/PointWriter.java
index 32a80ca36b7..8e946018799 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/DimensionalWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/PointWriter.java
@@ -23,40 +23,40 @@ import java.io.IOException;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.MergeState;
-/** Abstract API to write dimensional values
+/** Abstract API to write points
*
* @lucene.experimental
*/
-public abstract class DimensionalWriter implements Closeable {
+public abstract class PointWriter implements Closeable {
/** Sole constructor. (For invocation by subclass
* constructors, typically implicit.) */
- protected DimensionalWriter() {
+ protected PointWriter() {
}
/** Write all values contained in the provided reader */
- public abstract void writeField(FieldInfo fieldInfo, DimensionalReader values) throws IOException;
+ public abstract void writeField(FieldInfo fieldInfo, PointReader values) throws IOException;
/** Default naive merge implemenation for one field: it just re-indexes all the values
* from the incoming segment. The default codec overrides this for 1D fields and uses
* a faster but more complex implementation. */
protected void mergeOneField(MergeState mergeState, FieldInfo fieldInfo) throws IOException {
writeField(fieldInfo,
- new DimensionalReader() {
+ new PointReader() {
@Override
public void intersect(String fieldName, IntersectVisitor mergedVisitor) throws IOException {
if (fieldName.equals(fieldInfo.name) == false) {
throw new IllegalArgumentException("field name must match the field being merged");
}
- for (int i=0;i This data structure is written as a series of blocks on disk, with an in-memory perfectly balanced
@@ -71,9 +71,9 @@ import org.apache.lucene.index.SegmentWriteState;
* @lucene.experimental
*/
-public final class Lucene60DimensionalFormat extends DimensionalFormat {
+public final class Lucene60PointFormat extends PointFormat {
- static final String CODEC_NAME = "Lucene60DimensionalFormat";
+ static final String CODEC_NAME = "Lucene60PointFormat";
/**
* Filename extension for the leaf blocks
@@ -92,16 +92,16 @@ public final class Lucene60DimensionalFormat extends DimensionalFormat {
static final int INDEX_VERSION_CURRENT = INDEX_VERSION_START;
/** Sole constructor */
- public Lucene60DimensionalFormat() {
+ public Lucene60PointFormat() {
}
@Override
- public DimensionalWriter fieldsWriter(SegmentWriteState state) throws IOException {
- return new Lucene60DimensionalWriter(state);
+ public PointWriter fieldsWriter(SegmentWriteState state) throws IOException {
+ return new Lucene60PointWriter(state);
}
@Override
- public DimensionalReader fieldsReader(SegmentReadState state) throws IOException {
- return new Lucene60DimensionalReader(state);
+ public PointReader fieldsReader(SegmentReadState state) throws IOException {
+ return new Lucene60PointReader(state);
}
}
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60DimensionalReader.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60PointReader.java
similarity index 77%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60DimensionalReader.java
rename to lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60PointReader.java
index c940e17d455..2e2bddbe80f 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60DimensionalReader.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene60/Lucene60PointReader.java
@@ -28,7 +28,7 @@ import java.util.List;
import java.util.Map;
import org.apache.lucene.codecs.CodecUtil;
-import org.apache.lucene.codecs.DimensionalReader;
+import org.apache.lucene.codecs.PointReader;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.IndexFileNames;
import org.apache.lucene.index.SegmentReadState;
@@ -39,31 +39,31 @@ import org.apache.lucene.util.Accountables;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.bkd.BKDReader;
-/** Reads dimensional values previously written with {@link Lucene60DimensionalWriter} */
-public class Lucene60DimensionalReader extends DimensionalReader implements Closeable {
+/** Reads point values previously written with {@link Lucene60PointWriter} */
+public class Lucene60PointReader extends PointReader implements Closeable {
final IndexInput dataIn;
final SegmentReadState readState;
final Map
- * Another approach is {@link DimensionalLongField}, which indexes the
+ * Another approach is {@link LongPoint}, which indexes the
* values in sorted order.
* For indexing a {@link Date} or {@link Calendar}, just get the unix timestamp as
* Info about what files are live
*
*
- *
*
*
diff --git a/lucene/core/src/java/org/apache/lucene/document/DimensionalBinaryField.java b/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
similarity index 87%
rename from lucene/core/src/java/org/apache/lucene/document/DimensionalBinaryField.java
rename to lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
index 718a101554c..a74b17c3e98 100644
--- a/lucene/core/src/java/org/apache/lucene/document/DimensionalBinaryField.java
+++ b/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
@@ -24,7 +24,7 @@ import org.apache.lucene.util.BytesRef;
* efficient. Muliple values for the same field in one documents
* is allowed. */
-public final class DimensionalBinaryField extends Field {
+public final class BinaryPoint extends Field {
private static FieldType getType(byte[][] point) {
if (point == null) {
@@ -89,22 +89,22 @@ public final class DimensionalBinaryField extends Field {
return new BytesRef(packed);
}
- /** General purpose API: creates a new DimensionalField, indexing the
+ /** General purpose API: creates a new BinaryPoint, indexing the
* provided N-dimensional binary point.
*
* @param name field name
* @param point byte[][] value
* @throws IllegalArgumentException if the field name or value is null.
*/
- public DimensionalBinaryField(String name, byte[]... point) {
+ public BinaryPoint(String name, byte[]... point) {
super(name, pack(point), getType(point));
}
/** Expert API */
- public DimensionalBinaryField(String name, byte[] packedPoint, FieldType type) {
+ public BinaryPoint(String name, byte[] packedPoint, FieldType type) {
super(name, packedPoint, type);
- if (packedPoint.length != type.dimensionCount() * type.dimensionNumBytes()) {
- throw new IllegalArgumentException("packedPoint is length=" + packedPoint.length + " but type.dimensionCount()=" + type.dimensionCount() + " and type.dimensionNumBytes()=" + type.dimensionNumBytes());
+ if (packedPoint.length != type.pointDimensionCount() * type.pointNumBytes()) {
+ throw new IllegalArgumentException("packedPoint is length=" + packedPoint.length + " but type.pointDimensionCount()=" + type.pointDimensionCount() + " and type.pointNumBytes()=" + type.pointNumBytes());
}
}
}
diff --git a/lucene/core/src/java/org/apache/lucene/document/DateTools.java b/lucene/core/src/java/org/apache/lucene/document/DateTools.java
index e8f6622651f..e378ece28f5 100644
--- a/lucene/core/src/java/org/apache/lucene/document/DateTools.java
+++ b/lucene/core/src/java/org/apache/lucene/document/DateTools.java
@@ -24,7 +24,6 @@ import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
-import org.apache.lucene.search.DimensionalRangeQuery;
import org.apache.lucene.search.PrefixQuery;
import org.apache.lucene.search.TermRangeQuery;
@@ -39,12 +38,12 @@ import org.apache.lucene.search.TermRangeQuery;
* {@link TermRangeQuery} and {@link PrefixQuery} will require more memory and become slower.
*
* {@link org.apache.lucene.codecs.lucene60.Lucene60DimensionalFormat Dimensional values}
+ * {@link org.apache.lucene.codecs.lucene60.Lucene60PointFormat Point values}
* .dii, .dim
- * Holds dimensionally indexed fields, if any
+ * Holds indexed points, if any
* long
using {@link Date#getTime} or {@link Calendar#getTimeInMillis} and
- * index this as a numeric value with {@link DimensionalLongField}
- * and use {@link DimensionalRangeQuery} to query it.
+ * index this as a numeric value with {@link LongPoint}
+ * and use {@link org.apache.lucene.search.PointRangeQuery} to query it.
*/
public class DateTools {
diff --git a/lucene/core/src/java/org/apache/lucene/document/DimensionalDoubleField.java b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
similarity index 94%
rename from lucene/core/src/java/org/apache/lucene/document/DimensionalDoubleField.java
rename to lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
index db93cd42727..a7a63e0c34f 100644
--- a/lucene/core/src/java/org/apache/lucene/document/DimensionalDoubleField.java
+++ b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java
@@ -26,7 +26,7 @@ import org.apache.lucene.util.RamUsageEstimator;
* efficient. Muliple values for the same field in one documents
* is allowed. */
-public final class DimensionalDoubleField extends Field {
+public final class DoublePoint extends Field {
private static FieldType getType(int numDims) {
FieldType type = new FieldType();
@@ -73,14 +73,14 @@ public final class DimensionalDoubleField extends Field {
return new BytesRef(packed);
}
- /** Creates a new DimensionalDoubleField, indexing the
+ /** Creates a new DoublePoint, indexing the
* provided N-dimensional int point.
*
* @param name field name
* @param point double[] value
* @throws IllegalArgumentException if the field name or value is null.
*/
- public DimensionalDoubleField(String name, double... point) {
+ public DoublePoint(String name, double... point) {
super(name, pack(point), getType(point.length));
}
}
diff --git a/lucene/core/src/java/org/apache/lucene/document/FieldType.java b/lucene/core/src/java/org/apache/lucene/document/FieldType.java
index 846f853ab73..c6a137b3823 100644
--- a/lucene/core/src/java/org/apache/lucene/document/FieldType.java
+++ b/lucene/core/src/java/org/apache/lucene/document/FieldType.java
@@ -18,7 +18,6 @@ package org.apache.lucene.document;
*/
import org.apache.lucene.analysis.Analyzer; // javadocs
-import org.apache.lucene.index.DimensionalValues; // javadocs
import org.apache.lucene.index.DocValuesType;
import org.apache.lucene.index.IndexOptions;
import org.apache.lucene.index.IndexableFieldType;
@@ -32,7 +31,7 @@ public class FieldType implements IndexableFieldType {
/** Data type of the numeric value
* @since 3.2
*
- * @deprecated Please switch to {@link DimensionalValues} instead
+ * @deprecated Please switch to {@link org.apache.lucene.index.PointValues} instead
*/
@Deprecated
public enum LegacyNumericType {
@@ -304,7 +303,7 @@ public class FieldType implements IndexableFieldType {
* future modifications.
* @see #numericType()
*
- * @deprecated Please switch to {@link DimensionalValues} instead
+ * @deprecated Please switch to {@link org.apache.lucene.index.PointValues} instead
*/
@Deprecated
public void setNumericType(LegacyNumericType type) {
@@ -320,7 +319,7 @@ public class FieldType implements IndexableFieldType {
* The default is null
(no numeric type)
* @see #setNumericType(org.apache.lucene.document.FieldType.LegacyNumericType)
*
- * @deprecated Please switch to {@link DimensionalValues} instead
+ * @deprecated Please switch to {@link org.apache.lucene.index.PointValues} instead
*/
@Deprecated
public LegacyNumericType numericType() {
@@ -335,7 +334,7 @@ public class FieldType implements IndexableFieldType {
* future modifications.
* @see #numericPrecisionStep()
*
- * @deprecated Please switch to {@link DimensionalValues} instead
+ * @deprecated Please switch to {@link org.apache.lucene.index.PointValues} instead
*/
@Deprecated
public void setNumericPrecisionStep(int precisionStep) {
@@ -354,7 +353,7 @@ public class FieldType implements IndexableFieldType {
* The default is {@link org.apache.lucene.util.LegacyNumericUtils#PRECISION_STEP_DEFAULT}
* @see #setNumericPrecisionStep(int)
*
- * @deprecated Please switch to {@link DimensionalValues} instead
+ * @deprecated Please switch to {@link org.apache.lucene.index.PointValues} instead
*/
@Deprecated
public int numericPrecisionStep() {
@@ -362,22 +361,22 @@ public class FieldType implements IndexableFieldType {
}
/**
- * Enables dimensional indexing.
+ * Enables points indexing.
*/
public void setDimensions(int dimensionCount, int dimensionNumBytes) {
if (dimensionCount < 0) {
- throw new IllegalArgumentException("dimensionCount must be >= 0; got " + dimensionCount);
+ throw new IllegalArgumentException("pointDimensionCount must be >= 0; got " + dimensionCount);
}
if (dimensionNumBytes < 0) {
- throw new IllegalArgumentException("dimensionNumBytes must be >= 0; got " + dimensionNumBytes);
+ throw new IllegalArgumentException("pointNumBytes must be >= 0; got " + dimensionNumBytes);
}
if (dimensionCount == 0) {
if (dimensionNumBytes != 0) {
- throw new IllegalArgumentException("when dimensionCount is 0 dimensionNumBytes must 0; got " + dimensionNumBytes);
+ throw new IllegalArgumentException("when pointDimensionCount is 0 pointNumBytes must 0; got " + dimensionNumBytes);
}
} else if (dimensionNumBytes == 0) {
if (dimensionCount != 0) {
- throw new IllegalArgumentException("when dimensionNumBytes is 0 dimensionCount must 0; got " + dimensionCount);
+ throw new IllegalArgumentException("when pointNumBytes is 0 pointDimensionCount must 0; got " + dimensionCount);
}
}
@@ -386,12 +385,12 @@ public class FieldType implements IndexableFieldType {
}
@Override
- public int dimensionCount() {
+ public int pointDimensionCount() {
return dimensionCount;
}
@Override
- public int dimensionNumBytes() {
+ public int pointNumBytes() {
return dimensionNumBytes;
}
@@ -435,9 +434,9 @@ public class FieldType implements IndexableFieldType {
result.append(numericPrecisionStep);
}
if (dimensionCount != 0) {
- result.append(",dimensionCount=");
+ result.append(",pointDimensionCount=");
result.append(dimensionCount);
- result.append(",dimensionNumBytes=");
+ result.append(",pointNumBytes=");
result.append(dimensionNumBytes);
}
}
diff --git a/lucene/core/src/java/org/apache/lucene/document/DimensionalFloatField.java b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
similarity index 94%
rename from lucene/core/src/java/org/apache/lucene/document/DimensionalFloatField.java
rename to lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
index 1fd6ea89eea..a023a4a82b5 100644
--- a/lucene/core/src/java/org/apache/lucene/document/DimensionalFloatField.java
+++ b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java
@@ -26,7 +26,7 @@ import org.apache.lucene.util.RamUsageEstimator;
* efficient. Muliple values for the same field in one documents
* is allowed. */
-public final class DimensionalFloatField extends Field {
+public final class FloatPoint extends Field {
private static FieldType getType(int numDims) {
FieldType type = new FieldType();
@@ -73,14 +73,14 @@ public final class DimensionalFloatField extends Field {
return new BytesRef(packed);
}
- /** Creates a new DimensionalFloatField, indexing the
+ /** Creates a new FloatPoint, indexing the
* provided N-dimensional float point.
*
* @param name field name
* @param point int[] value
* @throws IllegalArgumentException if the field name or value is null.
*/
- public DimensionalFloatField(String name, float... point) {
+ public FloatPoint(String name, float... point) {
super(name, pack(point), getType(point.length));
}
}
diff --git a/lucene/core/src/java/org/apache/lucene/document/DimensionalIntField.java b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
similarity index 94%
rename from lucene/core/src/java/org/apache/lucene/document/DimensionalIntField.java
rename to lucene/core/src/java/org/apache/lucene/document/IntPoint.java
index 83604a947df..28f6a555472 100644
--- a/lucene/core/src/java/org/apache/lucene/document/DimensionalIntField.java
+++ b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java
@@ -26,7 +26,7 @@ import org.apache.lucene.util.RamUsageEstimator;
* efficient. Muliple values for the same field in one documents
* is allowed. */
-public final class DimensionalIntField extends Field {
+public final class IntPoint extends Field {
private static FieldType getType(int numDims) {
FieldType type = new FieldType();
@@ -73,14 +73,14 @@ public final class DimensionalIntField extends Field {
return new BytesRef(packed);
}
- /** Creates a new DimensionalIntField, indexing the
+ /** Creates a new IntPoint, indexing the
* provided N-dimensional int point.
*
* @param name field name
* @param point int[] value
* @throws IllegalArgumentException if the field name or value is null.
*/
- public DimensionalIntField(String name, int... point) {
+ public IntPoint(String name, int... point) {
super(name, pack(point), getType(point.length));
}
}
diff --git a/lucene/core/src/java/org/apache/lucene/document/LegacyDoubleField.java b/lucene/core/src/java/org/apache/lucene/document/LegacyDoubleField.java
index ed4b2ef40f1..eaebd61af89 100644
--- a/lucene/core/src/java/org/apache/lucene/document/LegacyDoubleField.java
+++ b/lucene/core/src/java/org/apache/lucene/document/LegacyDoubleField.java
@@ -105,7 +105,7 @@ import org.apache.lucene.index.IndexOptions;
* class is a wrapper around this token stream type for
* easier, more intuitive usage.
The {@link org.apache.lucene.document.DateTools} is a utility class to make dates and times searchable. {@link - * org.apache.lucene.document.DimensionalIntField}, {@link org.apache.lucene.document.DimensionalLongField}, - * {@link org.apache.lucene.document.DimensionalFloatField} and {@link org.apache.lucene.document.DimensionalDoubleField} enable indexing - * of numeric values (and also dates) for fast range queries using {@link org.apache.lucene.search.DimensionalRangeQuery}
+ * org.apache.lucene.document.IntPoint}, {@link org.apache.lucene.document.LongPoint}, + * {@link org.apache.lucene.document.FloatPoint} and {@link org.apache.lucene.document.DoublePoint} enable indexing + * of numeric values (and also dates) for fast range queries using {@link org.apache.lucene.search.PointRangeQuery} */ package org.apache.lucene.document; diff --git a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java index 1571b51d1b8..c3aa49f9a65 100644 --- a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java +++ b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java @@ -33,7 +33,7 @@ import java.util.Locale; import java.util.Map; import org.apache.lucene.codecs.Codec; -import org.apache.lucene.codecs.DimensionalReader; +import org.apache.lucene.codecs.PointReader; import org.apache.lucene.codecs.DocValuesProducer; import org.apache.lucene.codecs.NormsProducer; import org.apache.lucene.codecs.PostingsFormat; @@ -215,8 +215,8 @@ public final class CheckIndex implements Closeable { /** Status for testing of DocValues (null if DocValues could not be tested). */ public DocValuesStatus docValuesStatus; - /** Status for testing of DimensionalValues (null if DimensionalValues could not be tested). */ - public DimensionalValuesStatus dimensionalValuesStatus; + /** Status for testing of PointValues (null if PointValues could not be tested). */ + public PointsStatus pointsStatus; } /** @@ -358,17 +358,17 @@ public final class CheckIndex implements Closeable { } /** - * Status from testing DimensionalValues + * Status from testing PointValues */ - public static final class DimensionalValuesStatus { + public static final class PointsStatus { - DimensionalValuesStatus() { + PointsStatus() { } - /** Total number of dimensional values points tested. */ + /** Total number of values points tested. */ public long totalValuePoints; - /** Total number of fields with dimensional values. */ + /** Total number of fields with points. */ public int totalValueFields; /** Exception thrown during doc values test (null on success) */ @@ -721,8 +721,8 @@ public final class CheckIndex implements Closeable { // Test Docvalues segInfoStat.docValuesStatus = testDocValues(reader, infoStream, failFast); - // Test DimensionalValues - segInfoStat.dimensionalValuesStatus = testDimensionalValues(reader, infoStream, failFast); + // Test PointValues + segInfoStat.pointsStatus = testPoints(reader, infoStream, failFast); // Rethrow the first exception we encountered // This will cause stats for failed segments to be incremented properly @@ -1681,23 +1681,23 @@ public final class CheckIndex implements Closeable { } /** - * Test the dimensional values index. + * Test the points index * @lucene.experimental */ - public static Status.DimensionalValuesStatus testDimensionalValues(CodecReader reader, PrintStream infoStream, boolean failFast) throws IOException { + public static Status.PointsStatus testPoints(CodecReader reader, PrintStream infoStream, boolean failFast) throws IOException { FieldInfos fieldInfos = reader.getFieldInfos(); - Status.DimensionalValuesStatus status = new Status.DimensionalValuesStatus(); + Status.PointsStatus status = new Status.PointsStatus(); try { - if (fieldInfos.hasDimensionalValues()) { - DimensionalReader values = reader.getDimensionalReader(); + if (fieldInfos.hasPointValues()) { + PointReader values = reader.getPointReader(); if (values == null) { - throw new RuntimeException("there are fields with dimensional values, but reader.getDimensionalRader() is null"); + throw new RuntimeException("there are fields with points, but reader.getPointReader() is null"); } for (FieldInfo fieldInfo : fieldInfos) { - if (fieldInfo.getDimensionCount() > 0) { + if (fieldInfo.getPointDimensionCount() > 0) { status.totalValueFields++; - int dimCount = fieldInfo.getDimensionCount(); - int bytesPerDim = fieldInfo.getDimensionNumBytes(); + int dimCount = fieldInfo.getPointDimensionCount(); + int bytesPerDim = fieldInfo.getPointNumBytes(); byte[] lastMinPackedValue = new byte[dimCount*bytesPerDim]; BytesRef lastMinPacked = new BytesRef(lastMinPackedValue); byte[] lastMaxPackedValue = new byte[dimCount*bytesPerDim]; @@ -1707,7 +1707,7 @@ public final class CheckIndex implements Closeable { lastMinPacked.length = bytesPerDim; scratch.length = bytesPerDim; values.intersect(fieldInfo.name, - new DimensionalValues.IntersectVisitor() { + new PointValues.IntersectVisitor() { @Override public void visit(int docID) { throw new RuntimeException("codec called IntersectVisitor.visit without a packed value for docID=" + docID); @@ -1737,7 +1737,7 @@ public final class CheckIndex implements Closeable { } @Override - public DimensionalValues.Relation compare(byte[] minPackedValue, byte[] maxPackedValue) { + public PointValues.Relation compare(byte[] minPackedValue, byte[] maxPackedValue) { checkPackedValue("min packed value", minPackedValue, -1); System.arraycopy(minPackedValue, 0, lastMinPackedValue, 0, minPackedValue.length); checkPackedValue("max packed value", maxPackedValue, -1); @@ -1745,7 +1745,7 @@ public final class CheckIndex implements Closeable { // We always pretend the query shape is so complex that it crosses every cell, so // that packedValue is passed for every document - return DimensionalValues.Relation.CELL_CROSSES_QUERY; + return PointValues.Relation.CELL_CROSSES_QUERY; } private void checkPackedValue(String desc, byte[] packedValue, int docID) { diff --git a/lucene/core/src/java/org/apache/lucene/index/CodecReader.java b/lucene/core/src/java/org/apache/lucene/index/CodecReader.java index c879b9ed2bf..a5642e4c759 100644 --- a/lucene/core/src/java/org/apache/lucene/index/CodecReader.java +++ b/lucene/core/src/java/org/apache/lucene/index/CodecReader.java @@ -25,7 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.lucene.codecs.DimensionalReader; +import org.apache.lucene.codecs.PointReader; import org.apache.lucene.codecs.DocValuesProducer; import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.NormsProducer; @@ -77,10 +77,10 @@ public abstract class CodecReader extends LeafReader implements Accountable { public abstract FieldsProducer getPostingsReader(); /** - * Expert: retrieve underlying DimensionalReader + * Expert: retrieve underlying PointReader * @lucene.internal */ - public abstract DimensionalReader getDimensionalReader(); + public abstract PointReader getPointReader(); @Override public final void document(int docID, StoredFieldVisitor visitor) throws IOException { @@ -322,9 +322,9 @@ public abstract class CodecReader extends LeafReader implements Accountable { ramBytesUsed += getTermVectorsReader().ramBytesUsed(); } - // dimensional values - if (getDimensionalReader() != null) { - ramBytesUsed += getDimensionalReader().ramBytesUsed(); + // points + if (getPointReader() != null) { + ramBytesUsed += getPointReader().ramBytesUsed(); } return ramBytesUsed; @@ -358,9 +358,9 @@ public abstract class CodecReader extends LeafReader implements Accountable { resources.add(Accountables.namedAccountable("term vectors", getTermVectorsReader())); } - // dimensional values - if (getDimensionalReader() != null) { - resources.add(Accountables.namedAccountable("dimensional values", getDimensionalReader())); + // points + if (getPointReader() != null) { + resources.add(Accountables.namedAccountable("points", getPointReader())); } return Collections.unmodifiableList(resources); diff --git a/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java b/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java index 0370008be99..23dc6f66746 100644 --- a/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java +++ b/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java @@ -23,8 +23,8 @@ import java.util.HashMap; import java.util.Map; import org.apache.lucene.analysis.TokenStream; -import org.apache.lucene.codecs.DimensionalFormat; -import org.apache.lucene.codecs.DimensionalWriter; +import org.apache.lucene.codecs.PointFormat; +import org.apache.lucene.codecs.PointWriter; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.NormsConsumer; @@ -93,7 +93,7 @@ final class DefaultIndexingChain extends DocConsumer { int maxDoc = state.segmentInfo.maxDoc(); writeNorms(state); writeDocValues(state); - writeDimensionalValues(state); + writePoints(state); // it's possible all docs hit non-aborting exceptions... initStoredFieldsWriter(); @@ -121,33 +121,33 @@ final class DefaultIndexingChain extends DocConsumer { docWriter.codec.fieldInfosFormat().write(state.directory, state.segmentInfo, "", state.fieldInfos, IOContext.DEFAULT); } - /** Writes all buffered dimensional values. */ - private void writeDimensionalValues(SegmentWriteState state) throws IOException { - DimensionalWriter dimensionalWriter = null; + /** Writes all buffered points. */ + private void writePoints(SegmentWriteState state) throws IOException { + PointWriter pointWriter = null; boolean success = false; try { for (int i=0;iThe - * {@link org.apache.lucene.search.DimensionalRangeQuery DimensionalRangeQuery} + * {@link org.apache.lucene.search.PointRangeQuery PointRangeQuery} * matches all documents that occur in a numeric range. - * For DimensionalRangeQuery to work, you must index the values - * using a one of the numeric fields ({@link org.apache.lucene.document.DimensionalIntField DimensionalIntField}, - * {@link org.apache.lucene.document.DimensionalLongField DimensionalLongField}, {@link org.apache.lucene.document.DimensionalFloatField DimensionalFloatField}, - * or {@link org.apache.lucene.document.DimensionalDoubleField DimensionalDoubleField}). + * For PointRangeQuery to work, you must index the values + * using a one of the numeric fields ({@link org.apache.lucene.document.IntPoint IntPoint}, + * {@link org.apache.lucene.document.LongPoint LongPoint}, {@link org.apache.lucene.document.FloatPoint FloatPoint}, + * or {@link org.apache.lucene.document.DoublePoint DoublePoint}). * *
* NOTE: be very careful using this query: it is diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/DimensionalPointInPolygonQuery.java b/lucene/sandbox/src/java/org/apache/lucene/search/PointInPolygonQuery.java similarity index 84% rename from lucene/sandbox/src/java/org/apache/lucene/search/DimensionalPointInPolygonQuery.java rename to lucene/sandbox/src/java/org/apache/lucene/search/PointInPolygonQuery.java index 20a1e944a3d..abdc5b9fdcb 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/search/DimensionalPointInPolygonQuery.java +++ b/lucene/sandbox/src/java/org/apache/lucene/search/PointInPolygonQuery.java @@ -20,10 +20,10 @@ package org.apache.lucene.search; import java.io.IOException; import java.util.Arrays; -import org.apache.lucene.document.DimensionalLatLonField; -import org.apache.lucene.index.DimensionalValues.IntersectVisitor; -import org.apache.lucene.index.DimensionalValues.Relation; -import org.apache.lucene.index.DimensionalValues; +import org.apache.lucene.document.LatLonPoint; +import org.apache.lucene.index.PointValues.IntersectVisitor; +import org.apache.lucene.index.PointValues.Relation; +import org.apache.lucene.index.PointValues; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.util.DocIdSetBuilder; @@ -33,11 +33,11 @@ import org.apache.lucene.util.NumericUtils; /** Finds all previously indexed points that fall within the specified polygon. * - *
The field must be indexed with using {@link DimensionalLatLonField} added per document. + *
The field must be indexed with using {@link org.apache.lucene.document.LatLonPoint} added per document. * * @lucene.experimental */ -public class DimensionalPointInPolygonQuery extends Query { +public class PointInPolygonQuery extends Query { final String field; final double minLat; final double maxLat; @@ -47,7 +47,7 @@ public class DimensionalPointInPolygonQuery extends Query { final double[] polyLons; /** The lats/lons must be clockwise or counter-clockwise. */ - public DimensionalPointInPolygonQuery(String field, double[] polyLats, double[] polyLons) { + public PointInPolygonQuery(String field, double[] polyLats, double[] polyLons) { this.field = field; if (polyLats.length != polyLons.length) { throw new IllegalArgumentException("polyLats and polyLons must be equal length"); @@ -105,9 +105,9 @@ public class DimensionalPointInPolygonQuery extends Query { @Override public Scorer scorer(LeafReaderContext context) throws IOException { LeafReader reader = context.reader(); - DimensionalValues values = reader.getDimensionalValues(); + PointValues values = reader.getPointValues(); if (values == null) { - // No docs in this segment had any dimensional fields + // No docs in this segment had any points fields return null; } @@ -124,8 +124,8 @@ public class DimensionalPointInPolygonQuery extends Query { @Override public void visit(int docID, byte[] packedValue) { assert packedValue.length == 8; - double lat = DimensionalLatLonField.decodeLat(NumericUtils.bytesToInt(packedValue, 0)); - double lon = DimensionalLatLonField.decodeLon(NumericUtils.bytesToInt(packedValue, 1)); + double lat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(packedValue, 0)); + double lon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(packedValue, 1)); if (GeoRelationUtils.pointInPolygon(polyLons, polyLats, lat, lon)) { hitCount[0]++; result.add(docID); @@ -134,10 +134,10 @@ public class DimensionalPointInPolygonQuery extends Query { @Override public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) { - double cellMinLat = DimensionalLatLonField.decodeLat(NumericUtils.bytesToInt(minPackedValue, 0)); - double cellMinLon = DimensionalLatLonField.decodeLon(NumericUtils.bytesToInt(minPackedValue, 1)); - double cellMaxLat = DimensionalLatLonField.decodeLat(NumericUtils.bytesToInt(maxPackedValue, 0)); - double cellMaxLon = DimensionalLatLonField.decodeLon(NumericUtils.bytesToInt(maxPackedValue, 1)); + double cellMinLat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(minPackedValue, 0)); + double cellMinLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(minPackedValue, 1)); + double cellMaxLat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(maxPackedValue, 0)); + double cellMaxLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(maxPackedValue, 1)); if (cellMinLat <= minLat && cellMaxLat >= maxLat && cellMinLon <= minLon && cellMaxLon >= maxLon) { // Cell fully encloses the query @@ -169,7 +169,7 @@ public class DimensionalPointInPolygonQuery extends Query { if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; - DimensionalPointInPolygonQuery that = (DimensionalPointInPolygonQuery) o; + PointInPolygonQuery that = (PointInPolygonQuery) o; if (Arrays.equals(polyLons, that.polyLons) == false) { return false; diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/DimensionalPointInRectQuery.java b/lucene/sandbox/src/java/org/apache/lucene/search/PointInRectQuery.java similarity index 78% rename from lucene/sandbox/src/java/org/apache/lucene/search/DimensionalPointInRectQuery.java rename to lucene/sandbox/src/java/org/apache/lucene/search/PointInRectQuery.java index b2e8bf39a4f..9af6097609a 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/search/DimensionalPointInRectQuery.java +++ b/lucene/sandbox/src/java/org/apache/lucene/search/PointInRectQuery.java @@ -19,10 +19,10 @@ package org.apache.lucene.search; import java.io.IOException; -import org.apache.lucene.document.DimensionalLatLonField; -import org.apache.lucene.index.DimensionalValues.IntersectVisitor; -import org.apache.lucene.index.DimensionalValues.Relation; -import org.apache.lucene.index.DimensionalValues; +import org.apache.lucene.document.LatLonPoint; +import org.apache.lucene.index.PointValues.IntersectVisitor; +import org.apache.lucene.index.PointValues.Relation; +import org.apache.lucene.index.PointValues; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; @@ -32,11 +32,11 @@ import org.apache.lucene.util.NumericUtils; /** Finds all previously indexed points that fall within the specified boundings box. * - *
The field must be indexed with using {@link DimensionalLatLonField} added per document. + *
The field must be indexed with using {@link org.apache.lucene.document.LatLonPoint} added per document.
*
* @lucene.experimental */
-public class DimensionalPointInRectQuery extends Query {
+public class PointInRectQuery extends Query {
final String field;
final double minLat;
final double maxLat;
@@ -44,7 +44,7 @@ public class DimensionalPointInRectQuery extends Query {
final double maxLon;
/** Matches all points >= minLon, minLat (inclusive) and < maxLon, maxLat (exclusive). */
- public DimensionalPointInRectQuery(String field, double minLat, double maxLat, double minLon, double maxLon) {
+ public PointInRectQuery(String field, double minLat, double maxLat, double minLon, double maxLon) {
this.field = field;
if (GeoUtils.isValidLat(minLat) == false) {
throw new IllegalArgumentException("minLat=" + minLat + " is not a valid latitude");
@@ -74,9 +74,9 @@ public class DimensionalPointInRectQuery extends Query {
@Override
public Scorer scorer(LeafReaderContext context) throws IOException {
LeafReader reader = context.reader();
- DimensionalValues values = reader.getDimensionalValues();
+ PointValues values = reader.getPointValues();
if (values == null) {
- // No docs in this segment had any dimensional fields
+ // No docs in this segment had any points fields
return null;
}
@@ -98,8 +98,8 @@ public class DimensionalPointInRectQuery extends Query {
@Override
public void visit(int docID, byte[] packedValue) {
assert packedValue.length == 8;
- double lat = DimensionalLatLonField.decodeLat(NumericUtils.bytesToInt(packedValue, 0));
- double lon = DimensionalLatLonField.decodeLon(NumericUtils.bytesToInt(packedValue, 1));
+ double lat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(packedValue, 0));
+ double lon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(packedValue, 1));
if (lat >= minLat && lat <= maxLat && lon >= minLon && lon <= maxLon) {
hitCount[0]++;
result.add(docID);
@@ -108,10 +108,10 @@ public class DimensionalPointInRectQuery extends Query {
@Override
public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) {
- double cellMinLat = DimensionalLatLonField.decodeLat(NumericUtils.bytesToInt(minPackedValue, 0));
- double cellMinLon = DimensionalLatLonField.decodeLon(NumericUtils.bytesToInt(minPackedValue, 1));
- double cellMaxLat = DimensionalLatLonField.decodeLat(NumericUtils.bytesToInt(maxPackedValue, 0));
- double cellMaxLon = DimensionalLatLonField.decodeLon(NumericUtils.bytesToInt(maxPackedValue, 1));
+ double cellMinLat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(minPackedValue, 0));
+ double cellMinLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(minPackedValue, 1));
+ double cellMaxLat = LatLonPoint.decodeLat(NumericUtils.bytesToInt(maxPackedValue, 0));
+ double cellMaxLon = LatLonPoint.decodeLon(NumericUtils.bytesToInt(maxPackedValue, 1));
if (minLat <= cellMinLat && maxLat >= cellMaxLat && minLon <= cellMinLon && maxLon >= cellMaxLon) {
return Relation.CELL_INSIDE_QUERY;
@@ -141,9 +141,9 @@ public class DimensionalPointInRectQuery extends Query {
q.setDisableCoord(true);
// E.g.: maxLon = -179, minLon = 179
- DimensionalPointInRectQuery left = new DimensionalPointInRectQuery(field, minLat, maxLat, GeoUtils.MIN_LON_INCL, maxLon);
+ PointInRectQuery left = new PointInRectQuery(field, minLat, maxLat, GeoUtils.MIN_LON_INCL, maxLon);
q.add(new BooleanClause(left, BooleanClause.Occur.SHOULD));
- DimensionalPointInRectQuery right = new DimensionalPointInRectQuery(field, minLat, maxLat, minLon, GeoUtils.MAX_LON_INCL);
+ PointInRectQuery right = new PointInRectQuery(field, minLat, maxLat, minLon, GeoUtils.MAX_LON_INCL);
q.add(new BooleanClause(right, BooleanClause.Occur.SHOULD));
return new ConstantScoreQuery(q.build());
} else {
@@ -163,8 +163,8 @@ public class DimensionalPointInRectQuery extends Query {
@Override
public boolean equals(Object other) {
- if (super.equals(other) && other instanceof DimensionalPointInRectQuery) {
- final DimensionalPointInRectQuery q = (DimensionalPointInRectQuery) other;
+ if (super.equals(other) && other instanceof PointInRectQuery) {
+ final PointInRectQuery q = (PointInRectQuery) other;
return field.equals(q.field) &&
minLat == q.minLat &&
maxLat == q.maxLat &&
diff --git a/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java b/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
index aa51a482caf..694fcdabf36 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/search/TestDocValuesRangeQuery.java
@@ -19,7 +19,7 @@ package org.apache.lucene.search;
import java.io.IOException;
-import org.apache.lucene.document.DimensionalLongField;
+import org.apache.lucene.document.LongPoint;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.NumericDocValuesField;
@@ -53,12 +53,12 @@ public class TestDocValuesRangeQuery extends LuceneTestCase {
for (int j = 0; j < numValues; ++j) {
final long value = TestUtil.nextLong(random(), -100, 10000);
doc.add(new SortedNumericDocValuesField("dv", value));
- doc.add(new DimensionalLongField("idx", value));
+ doc.add(new LongPoint("idx", value));
}
iw.addDocument(doc);
}
if (random().nextBoolean()) {
- iw.deleteDocuments(DimensionalRangeQuery.new1DLongRange("idx", 0L, true, 10L, true));
+ iw.deleteDocuments(PointRangeQuery.new1DLongRange("idx", 0L, true, 10L, true));
}
iw.commit();
final IndexReader reader = iw.getReader();
@@ -70,7 +70,7 @@ public class TestDocValuesRangeQuery extends LuceneTestCase {
final Long max = random().nextBoolean() ? null : TestUtil.nextLong(random(), -100, 1000);
final boolean minInclusive = random().nextBoolean();
final boolean maxInclusive = random().nextBoolean();
- final Query q1 = DimensionalRangeQuery.new1DLongRange("idx", min, minInclusive, max, maxInclusive);
+ final Query q1 = PointRangeQuery.new1DLongRange("idx", min, minInclusive, max, maxInclusive);
final Query q2 = DocValuesRangeQuery.newLongRange("dv", min, max, minInclusive, maxInclusive);
assertSameMatches(searcher, q1, q2, false);
}
@@ -180,13 +180,13 @@ public class TestDocValuesRangeQuery extends LuceneTestCase {
final long value = TestUtil.nextLong(random(), -100, 10000);
doc.add(new SortedNumericDocValuesField("dv1", value));
doc.add(new SortedSetDocValuesField("dv2", toSortableBytes(value)));
- doc.add(new DimensionalLongField("idx", value));
+ doc.add(new LongPoint("idx", value));
doc.add(new StringField("f", random().nextBoolean() ? "a" : "b", Store.NO));
}
iw.addDocument(doc);
}
if (random().nextBoolean()) {
- iw.deleteDocuments(DimensionalRangeQuery.new1DLongRange("idx", 0L, true, 10L, true));
+ iw.deleteDocuments(PointRangeQuery.new1DLongRange("idx", 0L, true, 10L, true));
}
iw.commit();
final IndexReader reader = iw.getReader();
@@ -200,7 +200,7 @@ public class TestDocValuesRangeQuery extends LuceneTestCase {
final boolean maxInclusive = random().nextBoolean();
BooleanQuery.Builder ref = new BooleanQuery.Builder();
- ref.add(DimensionalRangeQuery.new1DLongRange("idx", min, minInclusive, max, maxInclusive), Occur.FILTER);
+ ref.add(PointRangeQuery.new1DLongRange("idx", min, minInclusive, max, maxInclusive), Occur.FILTER);
ref.add(new TermQuery(new Term("f", "a")), Occur.MUST);
BooleanQuery.Builder bq1 = new BooleanQuery.Builder();
diff --git a/lucene/sandbox/src/test/org/apache/lucene/search/TestDimensionalQueries.java b/lucene/sandbox/src/test/org/apache/lucene/search/TestLatLonPointQueries.java
similarity index 76%
rename from lucene/sandbox/src/test/org/apache/lucene/search/TestDimensionalQueries.java
rename to lucene/sandbox/src/test/org/apache/lucene/search/TestLatLonPointQueries.java
index 23234ef3507..313ec21f289 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/search/TestDimensionalQueries.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/search/TestLatLonPointQueries.java
@@ -17,24 +17,22 @@ package org.apache.lucene.search;
* limitations under the License.
*/
-import org.apache.lucene.document.DimensionalLatLonField;
+import org.apache.lucene.document.LatLonPoint;
import org.apache.lucene.document.Document;
-import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BaseGeoPointTestCase;
import org.apache.lucene.util.GeoDistanceUtils;
import org.apache.lucene.util.GeoRect;
-import org.apache.lucene.util.SloppyMath;
-public class TestDimensionalQueries extends BaseGeoPointTestCase {
+public class TestLatLonPointQueries extends BaseGeoPointTestCase {
@Override
protected void addPointToDoc(String field, Document doc, double lat, double lon) {
- doc.add(new DimensionalLatLonField(field, lat, lon));
+ doc.add(new LatLonPoint(field, lat, lon));
}
@Override
protected Query newRectQuery(String field, GeoRect rect) {
- return new DimensionalPointInRectQuery(field, rect.minLat, rect.maxLat, rect.minLon, rect.maxLon);
+ return new PointInRectQuery(field, rect.minLat, rect.maxLat, rect.minLon, rect.maxLon);
}
@Override
@@ -50,7 +48,7 @@ public class TestDimensionalQueries extends BaseGeoPointTestCase {
@Override
protected Query newPolygonQuery(String field, double[] lats, double[] lons) {
- return new DimensionalPointInPolygonQuery(FIELD_NAME, lats, lons);
+ return new PointInPolygonQuery(FIELD_NAME, lats, lons);
}
@Override
@@ -58,13 +56,13 @@ public class TestDimensionalQueries extends BaseGeoPointTestCase {
assert Double.isNaN(pointLat) == false;
- int rectLatMinEnc = DimensionalLatLonField.encodeLat(rect.minLat);
- int rectLatMaxEnc = DimensionalLatLonField.encodeLat(rect.maxLat);
- int rectLonMinEnc = DimensionalLatLonField.encodeLon(rect.minLon);
- int rectLonMaxEnc = DimensionalLatLonField.encodeLon(rect.maxLon);
+ int rectLatMinEnc = LatLonPoint.encodeLat(rect.minLat);
+ int rectLatMaxEnc = LatLonPoint.encodeLat(rect.maxLat);
+ int rectLonMinEnc = LatLonPoint.encodeLon(rect.minLon);
+ int rectLonMaxEnc = LatLonPoint.encodeLon(rect.maxLon);
- int pointLatEnc = DimensionalLatLonField.encodeLat(pointLat);
- int pointLonEnc = DimensionalLatLonField.encodeLon(pointLon);
+ int pointLatEnc = LatLonPoint.encodeLat(pointLat);
+ int pointLonEnc = LatLonPoint.encodeLon(pointLon);
if (rect.minLon < rect.maxLon) {
return pointLatEnc >= rectLatMinEnc &&
@@ -114,12 +112,12 @@ public class TestDimensionalQueries extends BaseGeoPointTestCase {
boolean small = random().nextBoolean();
for(int iter=0;iter The field must be indexed using {@link Geo3DPoint}.
*
* @lucene.experimental */
@@ -62,7 +62,7 @@ public class PointInGeo3DShapeQuery extends Query {
@Override
public Scorer scorer(LeafReaderContext context) throws IOException {
LeafReader reader = context.reader();
- DimensionalValues values = reader.getDimensionalValues();
+ PointValues values = reader.getPointValues();
if (values == null) {
return null;
}
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPointField.java b/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java
similarity index 95%
rename from lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPointField.java
rename to lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java
index 64e92a42a89..3a3a31f439a 100644
--- a/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPointField.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/geo3d/TestGeo3DPoint.java
@@ -28,12 +28,12 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.lucene.codecs.Codec;
-import org.apache.lucene.codecs.DimensionalFormat;
-import org.apache.lucene.codecs.DimensionalReader;
-import org.apache.lucene.codecs.DimensionalWriter;
+import org.apache.lucene.codecs.PointFormat;
+import org.apache.lucene.codecs.PointReader;
+import org.apache.lucene.codecs.PointWriter;
import org.apache.lucene.codecs.FilterCodec;
-import org.apache.lucene.codecs.lucene60.Lucene60DimensionalReader;
-import org.apache.lucene.codecs.lucene60.Lucene60DimensionalWriter;
+import org.apache.lucene.codecs.lucene60.Lucene60PointReader;
+import org.apache.lucene.codecs.lucene60.Lucene60PointWriter;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.NumericDocValuesField;
@@ -60,7 +60,7 @@ import org.junit.BeforeClass;
import com.carrotsearch.randomizedtesting.generators.RandomInts;
-public class TestGeo3DPointField extends LuceneTestCase {
+public class TestGeo3DPoint extends LuceneTestCase {
private static boolean smallBBox;
@@ -77,21 +77,21 @@ public class TestGeo3DPointField extends LuceneTestCase {
int maxPointsInLeafNode = TestUtil.nextInt(random(), 16, 2048);
double maxMBSortInHeap = 3.0 + (3*random().nextDouble());
if (VERBOSE) {
- System.out.println("TEST: using Lucene60DimensionalFormat with maxPointsInLeafNode=" + maxPointsInLeafNode + " and maxMBSortInHeap=" + maxMBSortInHeap);
+ System.out.println("TEST: using Lucene60PointFormat with maxPointsInLeafNode=" + maxPointsInLeafNode + " and maxMBSortInHeap=" + maxMBSortInHeap);
}
return new FilterCodec("Lucene60", Codec.getDefault()) {
@Override
- public DimensionalFormat dimensionalFormat() {
- return new DimensionalFormat() {
+ public PointFormat pointFormat() {
+ return new PointFormat() {
@Override
- public DimensionalWriter fieldsWriter(SegmentWriteState writeState) throws IOException {
- return new Lucene60DimensionalWriter(writeState, maxPointsInLeafNode, maxMBSortInHeap);
+ public PointWriter fieldsWriter(SegmentWriteState writeState) throws IOException {
+ return new Lucene60PointWriter(writeState, maxPointsInLeafNode, maxMBSortInHeap);
}
@Override
- public DimensionalReader fieldsReader(SegmentReadState readState) throws IOException {
- return new Lucene60DimensionalReader(readState);
+ public PointReader fieldsReader(SegmentReadState readState) throws IOException {
+ return new Lucene60PointReader(readState);
}
};
}
@@ -107,7 +107,7 @@ public class TestGeo3DPointField extends LuceneTestCase {
iwc.setCodec(getCodec());
IndexWriter w = new IndexWriter(dir, iwc);
Document doc = new Document();
- doc.add(new Geo3DPointField("field", PlanetModel.WGS84, toRadians(50.7345267), toRadians(-97.5303555)));
+ doc.add(new Geo3DPoint("field", PlanetModel.WGS84, toRadians(50.7345267), toRadians(-97.5303555)));
w.addDocument(doc);
IndexReader r = DirectoryReader.open(w, true);
// We can't wrap with "exotic" readers because the query must see the BKD3DDVFormat:
@@ -663,7 +663,7 @@ public class TestGeo3DPointField extends LuceneTestCase {
doc.add(newStringField("id", ""+id, Field.Store.NO));
doc.add(new NumericDocValuesField("id", id));
if (Double.isNaN(lats[id]) == false) {
- doc.add(new Geo3DPointField("point", planetModel, lats[id], lons[id]));
+ doc.add(new Geo3DPoint("point", planetModel, lats[id], lons[id]));
}
w.addDocument(doc);
if (id > 0 && random().nextInt(100) == 42) {
diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
index 05bb6773810..92271f3db08 100644
--- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
+++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java
@@ -34,7 +34,7 @@ import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.PostingsFormat;
import org.apache.lucene.codecs.lucene60.Lucene60Codec;
-import org.apache.lucene.document.DimensionalIntField;
+import org.apache.lucene.document.IntPoint;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StoredField;
@@ -44,7 +44,7 @@ import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
-import org.apache.lucene.search.DimensionalRangeQuery;
+import org.apache.lucene.search.PointRangeQuery;
import org.apache.lucene.search.ScoreDoc;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.search.suggest.BitsProducer;
@@ -305,7 +305,7 @@ public class TestSuggestField extends LuceneTestCase {
Document document = new Document();
document.add(new SuggestField("suggest_field", "abc_" + i, i));
document.add(new StoredField("weight_fld", i));
- document.add(new DimensionalIntField("weight_fld", i));
+ document.add(new IntPoint("weight_fld", i));
iw.addDocument(document);
if (usually()) {
@@ -313,7 +313,7 @@ public class TestSuggestField extends LuceneTestCase {
}
}
- iw.deleteDocuments(DimensionalRangeQuery.new1DIntRange("weight_fld", 2, true, null, false));
+ iw.deleteDocuments(PointRangeQuery.new1DIntRange("weight_fld", 2, true, null, false));
DirectoryReader reader = DirectoryReader.open(iw);
SuggestIndexSearcher indexSearcher = new SuggestIndexSearcher(reader);
diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingCodec.java b/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingCodec.java
index 99131293bcc..1e32e012868 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingCodec.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingCodec.java
@@ -17,7 +17,7 @@ package org.apache.lucene.codecs.asserting;
* limitations under the License.
*/
-import org.apache.lucene.codecs.DimensionalFormat;
+import org.apache.lucene.codecs.PointFormat;
import org.apache.lucene.codecs.DocValuesFormat;
import org.apache.lucene.codecs.FilterCodec;
import org.apache.lucene.codecs.LiveDocsFormat;
@@ -54,7 +54,7 @@ public class AssertingCodec extends FilterCodec {
private final LiveDocsFormat liveDocs = new AssertingLiveDocsFormat();
private final PostingsFormat defaultFormat = new AssertingPostingsFormat();
private final DocValuesFormat defaultDVFormat = new AssertingDocValuesFormat();
- private final DimensionalFormat dimensionalFormat = new AssertingDimensionalFormat();
+ private final PointFormat pointFormat = new AssertingPointFormat();
public AssertingCodec() {
super("Asserting", TestUtil.getDefaultCodec());
@@ -91,8 +91,8 @@ public class AssertingCodec extends FilterCodec {
}
@Override
- public DimensionalFormat dimensionalFormat() {
- return dimensionalFormat;
+ public PointFormat pointFormat() {
+ return pointFormat;
}
@Override
diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingDimensionalFormat.java b/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingPointFormat.java
similarity index 70%
rename from lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingDimensionalFormat.java
rename to lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingPointFormat.java
index 4191f65579f..7b306d7e10a 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingDimensionalFormat.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingPointFormat.java
@@ -20,9 +20,9 @@ package org.apache.lucene.codecs.asserting;
import java.io.IOException;
import java.util.Collection;
-import org.apache.lucene.codecs.DimensionalFormat;
-import org.apache.lucene.codecs.DimensionalReader;
-import org.apache.lucene.codecs.DimensionalWriter;
+import org.apache.lucene.codecs.PointFormat;
+import org.apache.lucene.codecs.PointReader;
+import org.apache.lucene.codecs.PointWriter;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.MergeState;
import org.apache.lucene.index.SegmentReadState;
@@ -31,26 +31,26 @@ import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.TestUtil;
/**
- * Just like the default dimensional format but with additional asserts.
+ * Just like the default point format but with additional asserts.
*/
-public final class AssertingDimensionalFormat extends DimensionalFormat {
- private final DimensionalFormat in = TestUtil.getDefaultCodec().dimensionalFormat();
+public final class AssertingPointFormat extends PointFormat {
+ private final PointFormat in = TestUtil.getDefaultCodec().pointFormat();
@Override
- public DimensionalWriter fieldsWriter(SegmentWriteState state) throws IOException {
- return new AssertingDimensionalWriter(state, in.fieldsWriter(state));
+ public PointWriter fieldsWriter(SegmentWriteState state) throws IOException {
+ return new AssertingPointWriter(state, in.fieldsWriter(state));
}
@Override
- public DimensionalReader fieldsReader(SegmentReadState state) throws IOException {
- return new AssertingDimensionalReader(in.fieldsReader(state));
+ public PointReader fieldsReader(SegmentReadState state) throws IOException {
+ return new AssertingPointReader(in.fieldsReader(state));
}
- static class AssertingDimensionalReader extends DimensionalReader {
- private final DimensionalReader in;
+ static class AssertingPointReader extends PointReader {
+ private final PointReader in;
- AssertingDimensionalReader(DimensionalReader in) {
+ AssertingPointReader(PointReader in) {
this.in = in;
// do a few simple checks on init
assert toString() != null;
@@ -90,8 +90,8 @@ public final class AssertingDimensionalFormat extends DimensionalFormat {
}
@Override
- public DimensionalReader getMergeInstance() throws IOException {
- return new AssertingDimensionalReader(in.getMergeInstance());
+ public PointReader getMergeInstance() throws IOException {
+ return new AssertingPointReader(in.getMergeInstance());
}
@Override
@@ -120,17 +120,17 @@ public final class AssertingDimensionalFormat extends DimensionalFormat {
}
}
- static class AssertingDimensionalWriter extends DimensionalWriter {
- private final DimensionalWriter in;
+ static class AssertingPointWriter extends PointWriter {
+ private final PointWriter in;
- AssertingDimensionalWriter(SegmentWriteState writeState, DimensionalWriter in) {
+ AssertingPointWriter(SegmentWriteState writeState, PointWriter in) {
this.in = in;
}
@Override
- public void writeField(FieldInfo fieldInfo, DimensionalReader values) throws IOException {
- if (fieldInfo.getDimensionCount() == 0) {
- throw new IllegalArgumentException("writing field=\"" + fieldInfo.name + "\" but dimensionalCount is 0");
+ public void writeField(FieldInfo fieldInfo, PointReader values) throws IOException {
+ if (fieldInfo.getPointDimensionCount() == 0) {
+ throw new IllegalArgumentException("writing field=\"" + fieldInfo.name + "\" but pointDimensionalCount is 0");
}
in.writeField(fieldInfo, values);
}
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
index f7d9f16fe51..b4b6f7d26f9 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
@@ -312,7 +312,7 @@ abstract class BaseIndexFileFormatTestCase extends LuceneTestCase {
FieldInfo proto = oneDocReader.getFieldInfos().fieldInfo("field");
FieldInfo field = new FieldInfo(proto.name, proto.number, proto.hasVectors(), proto.omitsNorms(), proto.hasPayloads(),
proto.getIndexOptions(), proto.getDocValuesType(), proto.getDocValuesGen(), new HashMap<>(),
- proto.getDimensionCount(), proto.getDimensionNumBytes());
+ proto.getPointDimensionCount(), proto.getPointNumBytes());
FieldInfos fieldInfos = new FieldInfos(new FieldInfo[] { field } );
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/MismatchedLeafReader.java b/lucene/test-framework/src/java/org/apache/lucene/index/MismatchedLeafReader.java
index c57159faa89..664e76a6c2a 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/MismatchedLeafReader.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/MismatchedLeafReader.java
@@ -67,8 +67,8 @@ public class MismatchedLeafReader extends FilterLeafReader {
oldInfo.getDocValuesType(), // docValuesType
oldInfo.getDocValuesGen(), // dvGen
oldInfo.attributes(), // attributes
- oldInfo.getDimensionCount(), // dimension count
- oldInfo.getDimensionNumBytes()); // dimension numBytes
+ oldInfo.getPointDimensionCount(), // dimension count
+ oldInfo.getPointNumBytes()); // dimension numBytes
shuffled.set(i, newInfo);
}
diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java b/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java
index 734bced0040..6de6213675b 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java
@@ -24,7 +24,7 @@ import java.util.List;
import java.util.Random;
import org.apache.lucene.index.BinaryDocValues;
-import org.apache.lucene.index.DimensionalValues;
+import org.apache.lucene.index.PointValues;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.FieldInfos;
import org.apache.lucene.index.Fields;
@@ -257,7 +257,7 @@ public class QueryUtils {
}
@Override
- public DimensionalValues getDimensionalValues() {
+ public PointValues getPointValues() {
return null;
}
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java b/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java
index 6e18fd7dd18..a198130cf87 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java
@@ -34,10 +34,11 @@ import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.zip.GZIPInputStream;
-import org.apache.lucene.document.DimensionalIntField;
+import org.apache.lucene.document.IntPoint;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
+import org.apache.lucene.document.IntPoint;
import org.apache.lucene.document.NumericDocValuesField;
import org.apache.lucene.document.SortedDocValuesField;
import org.apache.lucene.document.StringField;
@@ -186,7 +187,7 @@ public class LineFileDocs implements Closeable {
id = new StringField("docid", "", Field.Store.YES);
doc.add(id);
- idNum = new DimensionalIntField("docid_int", 0);
+ idNum = new IntPoint("docid_int", 0);
doc.add(idNum);
date = new StringField("date", "", Field.Store.YES);
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
index 04b4220b3e0..99d4be3ebe2 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
@@ -57,7 +57,7 @@ import org.apache.lucene.codecs.lucene60.Lucene60Codec;
import org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat;
import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat;
import org.apache.lucene.document.BinaryDocValuesField;
-import org.apache.lucene.document.DimensionalBinaryField;
+import org.apache.lucene.document.BinaryPoint;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType.LegacyNumericType;
@@ -1037,7 +1037,7 @@ public final class TestUtil {
final Field field1 = (Field) f;
final Field field2;
final DocValuesType dvType = field1.fieldType().docValuesType();
- final int dimCount = field1.fieldType().dimensionCount();
+ final int dimCount = field1.fieldType().pointDimensionCount();
final LegacyNumericType numType = field1.fieldType().numericType();
if (dvType != DocValuesType.NONE) {
switch(dvType) {
@@ -1057,7 +1057,7 @@ public final class TestUtil {
BytesRef br = field1.binaryValue();
byte[] bytes = new byte[br.length];
System.arraycopy(br.bytes, br.offset, bytes, 0, br.length);
- field2 = new DimensionalBinaryField(field1.name(), bytes, field1.fieldType());
+ field2 = new BinaryPoint(field1.name(), bytes, field1.fieldType());
} else if (numType != null) {
switch (numType) {
case INT:
diff --git a/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java b/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java
index 3e9db033dff..93e23cb5270 100644
--- a/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java
+++ b/lucene/test-framework/src/test/org/apache/lucene/codecs/compressing/TestCompressingStoredFieldsFormat.java
@@ -22,10 +22,11 @@ import java.util.Random;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.codecs.Codec;
-import org.apache.lucene.document.DimensionalIntField;
+import org.apache.lucene.document.IntPoint;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
+import org.apache.lucene.document.IntPoint;
import org.apache.lucene.document.StoredField;
import org.apache.lucene.index.BaseStoredFieldsFormatTestCase;
import org.apache.lucene.index.CodecReader;
@@ -69,7 +70,7 @@ public class TestCompressingStoredFieldsFormat extends BaseStoredFieldsFormatTes
IndexWriter iw = new IndexWriter(dir, iwConf);
final Document validDoc = new Document();
- validDoc.add(new DimensionalIntField("id", 0));
+ validDoc.add(new IntPoint("id", 0));
validDoc.add(new StoredField("id", 0));
iw.addDocument(validDoc);
iw.commit();
diff --git a/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java b/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
index 58ea6cccfe8..694e53af08c 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java
@@ -741,8 +741,8 @@ public class ExpandComponent extends SearchComponent implements PluginInfoInitia
DocValuesType.NONE,
fieldInfo.getDocValuesGen(),
fieldInfo.attributes(),
- fieldInfo.getDimensionCount(),
- fieldInfo.getDimensionNumBytes());
+ fieldInfo.getPointDimensionCount(),
+ fieldInfo.getPointNumBytes());
newInfos.add(f);
} else {
diff --git a/solr/core/src/java/org/apache/solr/search/Insanity.java b/solr/core/src/java/org/apache/solr/search/Insanity.java
index 6043aa1850a..11920a9b121 100644
--- a/solr/core/src/java/org/apache/solr/search/Insanity.java
+++ b/solr/core/src/java/org/apache/solr/search/Insanity.java
@@ -67,7 +67,7 @@ public class Insanity {
if (fi.name.equals(insaneField)) {
filteredInfos.add(new FieldInfo(fi.name, fi.number, fi.hasVectors(), fi.omitsNorms(),
fi.hasPayloads(), fi.getIndexOptions(), DocValuesType.NONE, -1, Collections.emptyMap(),
- fi.getDimensionCount(), fi.getDimensionNumBytes()));
+ fi.getPointDimensionCount(), fi.getPointNumBytes()));
} else {
filteredInfos.add(fi);
}
diff --git a/solr/core/src/test/org/apache/solr/search/TestDocSet.java b/solr/core/src/test/org/apache/solr/search/TestDocSet.java
index 9708e82d675..f435e6b5821 100644
--- a/solr/core/src/test/org/apache/solr/search/TestDocSet.java
+++ b/solr/core/src/test/org/apache/solr/search/TestDocSet.java
@@ -23,7 +23,7 @@ import java.util.List;
import java.util.Random;
import org.apache.lucene.index.BinaryDocValues;
-import org.apache.lucene.index.DimensionalValues;
+import org.apache.lucene.index.PointValues;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.FieldInfos;
import org.apache.lucene.index.Fields;
@@ -428,7 +428,7 @@ public class TestDocSet extends LuceneTestCase {
}
@Override
- public DimensionalValues getDimensionalValues() {
+ public PointValues getPointValues() {
return null;
}