diff --git a/dev-tools/eclipse/dot.classpath b/dev-tools/eclipse/dot.classpath index 6de80f0b85f..5589282b3ec 100644 --- a/dev-tools/eclipse/dot.classpath +++ b/dev-tools/eclipse/dot.classpath @@ -13,7 +13,6 @@ - diff --git a/lucene/contrib/misc/src/resources/META-INF/services/org.apache.lucene.index.codecs.Codec b/lucene/contrib/misc/src/resources/META-INF/services/org.apache.lucene.index.codecs.Codec deleted file mode 100644 index c29837d9289..00000000000 --- a/lucene/contrib/misc/src/resources/META-INF/services/org.apache.lucene.index.codecs.Codec +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -org.apache.lucene.index.codecs.appending.AppendingCodec diff --git a/lucene/src/java/org/apache/lucene/index/IndexReader.java b/lucene/src/java/org/apache/lucene/index/IndexReader.java index cc750e1a0ed..21a8fb42be0 100644 --- a/lucene/src/java/org/apache/lucene/index/IndexReader.java +++ b/lucene/src/java/org/apache/lucene/index/IndexReader.java @@ -31,6 +31,7 @@ import org.apache.lucene.document.DocumentStoredFieldVisitor; import org.apache.lucene.index.codecs.PerDocValues; import org.apache.lucene.index.values.IndexDocValues; import org.apache.lucene.search.FieldCache; // javadocs +import org.apache.lucene.search.SearcherManager; // javadocs import org.apache.lucene.store.*; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.Bits; @@ -372,8 +373,7 @@ public abstract class IndexReader implements Cloneable,Closeable { * for doing so); if a new reader is returned you also * must eventually close it. Be sure to never close a * reader while other threads are still using it; see - * SearcherManager in - * contrib/misc to simplify managing this. + * {@link SearcherManager} to simplify managing this. * * @throws CorruptIndexException if the index is corrupt * @throws IOException if there is a low-level IO error diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java b/lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java similarity index 99% rename from lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java rename to lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java index 255a5099073..a821acdbd97 100644 --- a/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java +++ b/lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingCodec.java @@ -80,7 +80,7 @@ public class AppendingCodec extends Codec { public FieldInfosFormat fieldInfosFormat() { return fieldInfos; } - + @Override public NormsFormat normsFormat() { return norms; diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingPostingsFormat.java b/lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingPostingsFormat.java similarity index 100% rename from lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingPostingsFormat.java rename to lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingPostingsFormat.java diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosFormat.java b/lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosFormat.java similarity index 100% rename from lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosFormat.java rename to lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosFormat.java diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosWriter.java b/lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosWriter.java similarity index 100% rename from lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosWriter.java rename to lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingSegmentInfosWriter.java diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsDictReader.java b/lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsDictReader.java similarity index 100% rename from lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsDictReader.java rename to lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsDictReader.java diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsDictWriter.java b/lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsDictWriter.java similarity index 100% rename from lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsDictWriter.java rename to lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsDictWriter.java diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsIndexReader.java b/lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsIndexReader.java similarity index 100% rename from lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsIndexReader.java rename to lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsIndexReader.java diff --git a/lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsIndexWriter.java b/lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsIndexWriter.java similarity index 100% rename from lucene/contrib/misc/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsIndexWriter.java rename to lucene/src/java/org/apache/lucene/index/codecs/appending/AppendingTermsIndexWriter.java diff --git a/lucene/src/resources/META-INF/services/org.apache.lucene.index.codecs.Codec b/lucene/src/resources/META-INF/services/org.apache.lucene.index.codecs.Codec index de644791164..d87ffb46b06 100644 --- a/lucene/src/resources/META-INF/services/org.apache.lucene.index.codecs.Codec +++ b/lucene/src/resources/META-INF/services/org.apache.lucene.index.codecs.Codec @@ -16,3 +16,4 @@ org.apache.lucene.index.codecs.lucene40.Lucene40Codec org.apache.lucene.index.codecs.lucene3x.Lucene3xCodec org.apache.lucene.index.codecs.simpletext.SimpleTextCodec +org.apache.lucene.index.codecs.appending.AppendingCodec diff --git a/lucene/src/test-framework/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/src/test-framework/java/org/apache/lucene/util/LuceneTestCase.java index 08c83c8f584..ca44d8d209b 100644 --- a/lucene/src/test-framework/java/org/apache/lucene/util/LuceneTestCase.java +++ b/lucene/src/test-framework/java/org/apache/lucene/util/LuceneTestCase.java @@ -40,6 +40,7 @@ import org.apache.lucene.document.FieldType; import org.apache.lucene.index.*; import org.apache.lucene.index.codecs.Codec; import org.apache.lucene.index.codecs.PostingsFormat; +import org.apache.lucene.index.codecs.appending.AppendingCodec; import org.apache.lucene.index.codecs.lucene40.Lucene40Codec; import org.apache.lucene.index.codecs.preflexrw.PreFlexRWCodec; import org.apache.lucene.index.codecs.simpletext.SimpleTextCodec; @@ -286,6 +287,8 @@ public abstract class LuceneTestCase extends Assert { PREFLEX_IMPERSONATION_IS_ACTIVE = true; } else if ("SimpleText".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) && randomVal == 9)) { codec = new SimpleTextCodec(); + } else if ("Appending".equals(TEST_CODEC) || ("random".equals(TEST_CODEC) && randomVal == 8)) { + codec = new AppendingCodec(); } else if (!"random".equals(TEST_CODEC)) { codec = Codec.forName(TEST_CODEC); } else if ("random".equals(TEST_POSTINGSFORMAT)) { diff --git a/lucene/contrib/misc/src/test/org/apache/lucene/index/codecs/appending/TestAppendingCodec.java b/lucene/src/test/org/apache/lucene/index/codecs/appending/TestAppendingCodec.java similarity index 100% rename from lucene/contrib/misc/src/test/org/apache/lucene/index/codecs/appending/TestAppendingCodec.java rename to lucene/src/test/org/apache/lucene/index/codecs/appending/TestAppendingCodec.java diff --git a/solr/core/src/java/org/apache/solr/schema/ByteField.java b/solr/core/src/java/org/apache/solr/schema/ByteField.java index f584bf9528b..093c0dde9cc 100644 --- a/solr/core/src/java/org/apache/solr/schema/ByteField.java +++ b/solr/core/src/java/org/apache/solr/schema/ByteField.java @@ -28,7 +28,21 @@ import java.io.IOException; import java.util.Map; /** + * A numeric field that can contain 8-bit signed two's complement integer + * values, encoded as simple Strings. * + *

+ * Field values will sort numerically, but Range Queries (and other features + * that rely on numeric ranges) will not work as expected: values will be + * evaluated in unicode String order, not numeric order. + *

+ * + *
    + *
  • Min Value Allowed: -128
  • + *
  • Max Value Allowed: 127
  • + *
+ * + * @see Byte */ public class ByteField extends FieldType { @Override diff --git a/solr/core/src/java/org/apache/solr/schema/DoubleField.java b/solr/core/src/java/org/apache/solr/schema/DoubleField.java index 22e34c96407..3131fa094b9 100644 --- a/solr/core/src/java/org/apache/solr/schema/DoubleField.java +++ b/solr/core/src/java/org/apache/solr/schema/DoubleField.java @@ -28,7 +28,18 @@ import java.io.IOException; import java.util.Map; /** + * A legacy numeric field type that encodes "Double" values as simple Strings. + * This class should not be used except by people with existing indexes that + * contain numeric values indexed as Strings. + * New schemas should use {@link TrieDoubleField}. * + *

+ * Field values will sort numerically, but Range Queries (and other features + * that rely on numeric ranges) will not work as expected: values will be + * evaluated in unicode String order, not numeric order. + *

+ * + * @see TrieDoubleField */ public class DoubleField extends FieldType { @Override diff --git a/solr/core/src/java/org/apache/solr/schema/FloatField.java b/solr/core/src/java/org/apache/solr/schema/FloatField.java index e784d70d756..4229638dc96 100644 --- a/solr/core/src/java/org/apache/solr/schema/FloatField.java +++ b/solr/core/src/java/org/apache/solr/schema/FloatField.java @@ -27,7 +27,18 @@ import org.apache.solr.response.TextResponseWriter; import java.util.Map; import java.io.IOException; /** + * A legacy numeric field type that encodes "Float" values as simple Strings. + * This class should not be used except by people with existing indexes that + * contain numeric values indexed as Strings. + * New schemas should use {@link TrieFloatField}. * + *

+ * Field values will sort numerically, but Range Queries (and other features + * that rely on numeric ranges) will not work as expected: values will be + * evaluated in unicode String order, not numeric order. + *

+ * + * @see TrieFloatField */ public class FloatField extends FieldType { @Override diff --git a/solr/core/src/java/org/apache/solr/schema/IntField.java b/solr/core/src/java/org/apache/solr/schema/IntField.java index 3c1b1944cd8..c074d5338cd 100644 --- a/solr/core/src/java/org/apache/solr/schema/IntField.java +++ b/solr/core/src/java/org/apache/solr/schema/IntField.java @@ -27,7 +27,18 @@ import org.apache.solr.response.TextResponseWriter; import java.util.Map; import java.io.IOException; /** + * A legacy numeric field type that encodes "Integer" values as simple Strings. + * This class should not be used except by people with existing indexes that + * contain numeric values indexed as Strings. + * New schemas should use {@link TrieIntField}. * + *

+ * Field values will sort numerically, but Range Queries (and other features + * that rely on numeric ranges) will not work as expected: values will be + * evaluated in unicode String order, not numeric order. + *

+ * + * @see TrieIntField */ public class IntField extends FieldType { @Override diff --git a/solr/core/src/java/org/apache/solr/schema/LongField.java b/solr/core/src/java/org/apache/solr/schema/LongField.java index 7c8e066ac45..a8fe83b715e 100644 --- a/solr/core/src/java/org/apache/solr/schema/LongField.java +++ b/solr/core/src/java/org/apache/solr/schema/LongField.java @@ -27,7 +27,18 @@ import org.apache.solr.search.QParser; import java.io.IOException; import java.util.Map; /** + * A legacy numeric field type that encodes "Long" values as simple Strings. + * This class should not be used except by people with existing indexes that + * contain numeric values indexed as Strings. + * New schemas should use {@link TrieLongField}. * + *

+ * Field values will sort numerically, but Range Queries (and other features + * that rely on numeric ranges) will not work as expected: values will be + * evaluated in unicode String order, not numeric order. + *

+ * + * @see TrieLongField */ public class LongField extends FieldType { @Override diff --git a/solr/core/src/java/org/apache/solr/schema/ShortField.java b/solr/core/src/java/org/apache/solr/schema/ShortField.java index 7520d58d21c..59cab5a3f05 100644 --- a/solr/core/src/java/org/apache/solr/schema/ShortField.java +++ b/solr/core/src/java/org/apache/solr/schema/ShortField.java @@ -29,8 +29,21 @@ import java.util.Map; /** + * A numeric field that can contain 16-bit signed two's complement integer + * values, encoded as simple Strings. * + *

+ * Field values will sort numerically, but Range Queries (and other features + * that rely on numeric ranges) will not work as expected: values will be + * evaluated in unicode String order, not numeric order. + *

* + *
    + *
  • Min Value Allowed: -32768
  • + *
  • Max Value Allowed: 32767
  • + *
+ * + * @see Short **/ public class ShortField extends FieldType { @Override diff --git a/solr/core/src/java/org/apache/solr/schema/SortableDoubleField.java b/solr/core/src/java/org/apache/solr/schema/SortableDoubleField.java index 9bd93499b69..a9facc51365 100644 --- a/solr/core/src/java/org/apache/solr/schema/SortableDoubleField.java +++ b/solr/core/src/java/org/apache/solr/schema/SortableDoubleField.java @@ -36,8 +36,19 @@ import org.apache.solr.response.TextResponseWriter; import java.util.Map; import java.io.IOException; /** + * A legacy numeric field type that encodes "Double" values as Strings such + * that Term enumeration order matches the natural numeric order. This class + * should not be used except by people with existing indexes that already + * contain fields of this type. New schemas should use {@link TrieDoubleField}. * + *

+ * The naming convention "Sortable" comes from the fact that both the numeric + * values and encoded String representations Sort identically (as opposed to + * a direct String representation where values such as "11" sort before values + * such as "2"). + *

* + * @see TrieDoubleField * @deprecated use {@link DoubleField} or {@link TrieDoubleField} - will be removed in 5.x */ @Deprecated diff --git a/solr/core/src/java/org/apache/solr/schema/SortableFloatField.java b/solr/core/src/java/org/apache/solr/schema/SortableFloatField.java index 1ed0edf5074..11aeb4bbbfe 100644 --- a/solr/core/src/java/org/apache/solr/schema/SortableFloatField.java +++ b/solr/core/src/java/org/apache/solr/schema/SortableFloatField.java @@ -35,9 +35,21 @@ import org.apache.solr.response.TextResponseWriter; import java.util.Map; import java.io.IOException; + /** + * A legacy numeric field type that encodes "Float" values as Strings such + * that Term enumeration order matches the natural numeric order. This class + * should not be used except by people with existing indexes that already + * contain fields of this type. New schemas should use {@link TrieFloatField}. * - * + *

+ * The naming convention "Sortable" comes from the fact that both the numeric + * values and encoded String representations Sort identically (as opposed to + * a direct String representation where values such as "11" sort before values + * such as "2"). + *

+ * + * @see TrieFloatField * @deprecated use {@link FloatField} or {@link TrieFloatField} - will be removed in 5.x */ @Deprecated diff --git a/solr/core/src/java/org/apache/solr/schema/SortableIntField.java b/solr/core/src/java/org/apache/solr/schema/SortableIntField.java index 834bd645f47..810e1390168 100644 --- a/solr/core/src/java/org/apache/solr/schema/SortableIntField.java +++ b/solr/core/src/java/org/apache/solr/schema/SortableIntField.java @@ -35,9 +35,21 @@ import org.apache.solr.response.TextResponseWriter; import java.util.Map; import java.io.IOException; + /** + * A legacy numeric field type that encodes "Integer" values as Strings such + * that Term enumeration order matches the natural numeric order. This class + * should not be used except by people with existing indexes that already + * contain fields of this type. New schemas should use {@link TrieIntField}. * + *

+ * The naming convention "Sortable" comes from the fact that both the numeric + * values and encoded String representations Sort identically (as opposed to + * a direct String representation where values such as "11" sort before values + * such as "2"). + *

* + * @see TrieIntField * @deprecated use {@link IntField} or {@link TrieIntField} - will be removed in 5.x */ @Deprecated diff --git a/solr/core/src/java/org/apache/solr/schema/SortableLongField.java b/solr/core/src/java/org/apache/solr/schema/SortableLongField.java index 0e0b3a52906..ce5b2cc2475 100644 --- a/solr/core/src/java/org/apache/solr/schema/SortableLongField.java +++ b/solr/core/src/java/org/apache/solr/schema/SortableLongField.java @@ -36,8 +36,19 @@ import org.apache.solr.response.TextResponseWriter; import java.util.Map; import java.io.IOException; /** + * A legacy numeric field type that encodes "Long" values as Strings such + * that Term enumeration order matches the natural numeric order. This class + * should not be used except by people with existing indexes that already + * contain fields of this type. New schemas should use {@link TrieLongField}. * + *

+ * The naming convention "Sortable" comes from the fact that both the numeric + * values and encoded String representations Sort identically (as opposed to + * a direct String representation where values such as "11" sort before values + * such as "2"). + *

* + * @see TrieLongField * @deprecated use {@link LongField} or {@link TrieLongField} - will be removed in 5.x */ @Deprecated diff --git a/solr/core/src/java/org/apache/solr/schema/TrieDoubleField.java b/solr/core/src/java/org/apache/solr/schema/TrieDoubleField.java index 3ca211b2168..d5dba1aef14 100755 --- a/solr/core/src/java/org/apache/solr/schema/TrieDoubleField.java +++ b/solr/core/src/java/org/apache/solr/schema/TrieDoubleField.java @@ -17,6 +17,22 @@ package org.apache.solr.schema; +/** + * A numeric field that can contain double-precision 64-bit IEEE 754 floating + * point values. + * + *
    + *
  • Min Value Allowed: 4.9E-324
  • + *
  • Max Value Allowed: 1.7976931348623157E308
  • + *
+ * + * NOTE: The behavior of this class when given values of + * {@link Double#NaN}, {@link Double#NEGATIVE_INFINITY}, or + * {@link Double#POSITIVE_INFINITY} is undefined. + * + * @see Double + * @see Java Language Specification, s4.2.3 + */ public class TrieDoubleField extends TrieField { { type=TrieTypes.DOUBLE; diff --git a/solr/core/src/java/org/apache/solr/schema/TrieFloatField.java b/solr/core/src/java/org/apache/solr/schema/TrieFloatField.java index 91226f31348..3c8326974a2 100755 --- a/solr/core/src/java/org/apache/solr/schema/TrieFloatField.java +++ b/solr/core/src/java/org/apache/solr/schema/TrieFloatField.java @@ -17,6 +17,22 @@ package org.apache.solr.schema; +/** + * A numeric field that can contain single-precision 32-bit IEEE 754 + * floating point values. + * + *
    + *
  • Min Value Allowed: 1.401298464324817E-45
  • + *
  • Max Value Allowed: 3.4028234663852886E38
  • + *
+ * + * NOTE: The behavior of this class when given values of + * {@link Float#NaN}, {@link Float#NEGATIVE_INFINITY}, or + * {@link Float#POSITIVE_INFINITY} is undefined. + * + * @see Float + * @see Java Language Specification, s4.2.3 + */ public class TrieFloatField extends TrieField { { type=TrieTypes.FLOAT; diff --git a/solr/core/src/java/org/apache/solr/schema/TrieIntField.java b/solr/core/src/java/org/apache/solr/schema/TrieIntField.java index 999193fe917..12a26da9683 100755 --- a/solr/core/src/java/org/apache/solr/schema/TrieIntField.java +++ b/solr/core/src/java/org/apache/solr/schema/TrieIntField.java @@ -17,6 +17,16 @@ package org.apache.solr.schema; +/** + * A numeric field that can contain 32-bit signed two's complement integer values. + * + *
    + *
  • Min Value Allowed: -2147483648
  • + *
  • Max Value Allowed: 2147483647
  • + *
+ * + * @see Integer + */ public class TrieIntField extends TrieField { { type=TrieTypes.INTEGER; diff --git a/solr/core/src/java/org/apache/solr/schema/TrieLongField.java b/solr/core/src/java/org/apache/solr/schema/TrieLongField.java index 6e2272b26d0..e0c0f2c0d39 100755 --- a/solr/core/src/java/org/apache/solr/schema/TrieLongField.java +++ b/solr/core/src/java/org/apache/solr/schema/TrieLongField.java @@ -17,6 +17,16 @@ package org.apache.solr.schema; +/** + * A numeric field that can contain 64-bit signed two's complement integer values. + * + *
    + *
  • Min Value Allowed: -9223372036854775808
  • + *
  • Max Value Allowed: 9223372036854775807
  • + *
+ * + * @see Long + */ public class TrieLongField extends TrieField { { type=TrieTypes.LONG;