reuseFields was set to true, then it attempts to reuse a
* Field instance. If such a field does not exist, it creates a new one.
*/
- Field getField(String name, FieldType ft) {
+ Field getField(String name, CoreFieldType ft) {
if (!reuseFields) {
return new Field(name, ft, "");
}
@@ -179,8 +174,8 @@
protected Config config;
- protected FieldType valType;
- protected FieldType bodyValType;
+ protected CoreFieldType valType;
+ protected CoreFieldType bodyValType;
protected ContentSource source;
protected boolean reuseFields;
@@ -206,7 +201,7 @@
doc.getFields().clear();
// Set ID_FIELD
- FieldType ft = new FieldType(valType);
+ CoreFieldType ft = new CoreFieldType(valType);
ft.setIndexed(true);
Field idField = ds.getField(ID_FIELD, ft);
@@ -461,7 +456,7 @@
boolean termVecPositions = config.get("doc.term.vector.positions", false);
boolean termVecOffsets = config.get("doc.term.vector.offsets", false);
- valType = new FieldType(TextField.TYPE_UNSTORED);
+ valType = new CoreFieldType(TextField.TYPE_UNSTORED);
valType.setStored(stored);
valType.setTokenized(tokenized);
valType.setOmitNorms(!norms);
@@ -470,7 +465,7 @@
valType.setStoreTermVectorOffsets(termVecOffsets);
valType.freeze();
- bodyValType = new FieldType(TextField.TYPE_UNSTORED);
+ bodyValType = new CoreFieldType(TextField.TYPE_UNSTORED);
bodyValType.setStored(bodyStored);
bodyValType.setTokenized(bodyTokenized);
bodyValType.setOmitNorms(!bodyNorms);
Index: modules/grouping/src/test/org/apache/lucene/search/grouping/TermAllGroupsCollectorTest.java
===================================================================
--- modules/grouping/src/test/org/apache/lucene/search/grouping/TermAllGroupsCollectorTest.java (revision 1163903)
+++ modules/grouping/src/test/org/apache/lucene/search/grouping/TermAllGroupsCollectorTest.java (working copy)
@@ -18,9 +18,9 @@
*/
import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.document.CoreFieldType;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
@@ -34,7 +34,7 @@
public void testTotalGroupCount() throws Exception {
final String groupField = "author";
- FieldType customType = new FieldType();
+ CoreFieldType customType = new CoreFieldType();
customType.setStored(true);
Directory dir = newDirectory();
Index: modules/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
===================================================================
--- modules/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java (revision 1163903)
+++ modules/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java (working copy)
@@ -21,13 +21,8 @@
import java.util.*;
import org.apache.lucene.analysis.MockAnalyzer;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.FieldType;
-import org.apache.lucene.document.NumericField;
+import org.apache.lucene.document.*;
import org.apache.lucene.index.FieldInfo.IndexOptions;
-import org.apache.lucene.document.StringField;
-import org.apache.lucene.document.TextField;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
@@ -50,7 +45,7 @@
final String groupField = "author";
- FieldType customType = new FieldType();
+ CoreFieldType customType = new CoreFieldType();
customType.setStored(true);
Directory dir = newDirectory();
@@ -401,7 +396,7 @@
//System.out.println("TEST: doc content=" + groupValue.content + " group=" + (groupValue.group == null ? "null" : groupValue.group.utf8ToString()) + " sort1=" + groupValue.sort1.utf8ToString() + " id=" + groupValue.id);
}
// So we can pull filter marking last doc in block:
- FieldType ft = new FieldType(StringField.TYPE_UNSTORED);
+ CoreFieldType ft = new CoreFieldType(StringField.TYPE_UNSTORED);
ft.setIndexOptions(IndexOptions.DOCS_ONLY);
ft.setOmitNorms(true);
final Field groupEnd = newField("groupend", "x", ft);
Index: modules/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java
===================================================================
--- modules/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java (revision 1163903)
+++ modules/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java (working copy)
@@ -2,9 +2,9 @@
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.document.CoreFieldType;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
@@ -132,14 +132,14 @@
Field f;
int scoreAndID = i + 1;
- FieldType customType = new FieldType(TextField.TYPE_STORED);
+ CoreFieldType customType = new CoreFieldType(TextField.TYPE_STORED);
customType.setTokenized(false);
customType.setOmitNorms(true);
f = newField(ID_FIELD, id2String(scoreAndID), customType); // for debug purposes
d.add(f);
- FieldType customType2 = new FieldType(TextField.TYPE_UNSTORED);
+ CoreFieldType customType2 = new CoreFieldType(TextField.TYPE_UNSTORED);
customType2.setOmitNorms(true);
f = newField(TEXT_FIELD, "text of doc" + scoreAndID + textLine(i), customType2); // for regular search
d.add(f);
Index: lucene/contrib/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java
===================================================================
--- lucene/contrib/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java (revision 1163903)
+++ lucene/contrib/demo/src/java/org/apache/lucene/demo/xmlparser/FormBasedXmlQueryDemo.java (working copy)
@@ -33,9 +33,9 @@
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.document.CoreFieldType;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.IndexWriter;
@@ -126,7 +126,7 @@
InputStream dataIn = getServletContext().getResourceAsStream("/WEB-INF/data.tsv");
BufferedReader br = new BufferedReader(new InputStreamReader(dataIn));
String line = br.readLine();
- final FieldType textNoNorms = new FieldType(TextField.TYPE_STORED);
+ final CoreFieldType textNoNorms = new CoreFieldType(TextField.TYPE_STORED);
textNoNorms.setOmitNorms(true);
while (line != null) {
line = line.trim();
Index: lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
===================================================================
--- lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java (revision 1163903)
+++ lucene/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java (working copy)
@@ -27,9 +27,9 @@
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+import org.apache.lucene.document.CoreFieldType;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
@@ -206,7 +206,7 @@
private void assembleDocument(Document document, int i) {
- FieldType customType = new FieldType(TextField.TYPE_STORED);
+ CoreFieldType customType = new CoreFieldType(TextField.TYPE_STORED);
customType.setStoreTermVectors(true);
customType.setStoreTermVectorOffsets(true);
customType.setStoreTermVectorPositions(true);
@@ -217,18 +217,18 @@
document.add(new Field("b0", customType, i + " All work and no play makes Jack a dull boy"));
//document.add(new Field("b1", i + " All work and no play makes Jack a dull boy", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO));
- FieldType customType2 = new FieldType(TextField.TYPE_STORED);
+ CoreFieldType customType2 = new CoreFieldType(TextField.TYPE_STORED);
customType2.setTokenized(false);
customType2.setOmitNorms(true);
document.add(new Field("b1", customType2, i + " All work and no play makes Jack a dull boy"));
//document.add(new Field("b2", i + " All work and no play makes Jack a dull boy", Field.Store.NO, Field.Index.NOT_ANALYZED, Field.TermVector.NO));
- FieldType customType3 = new FieldType(TextField.TYPE_UNSTORED);
+ CoreFieldType customType3 = new CoreFieldType(TextField.TYPE_UNSTORED);
customType3.setTokenized(false);
document.add(new Field("b1", customType3, i + " All work and no play makes Jack a dull boy"));
//document.add(new Field("b3", i + " All work and no play makes Jack a dull boy", Field.Store.YES, Field.Index.NO, Field.TermVector.NO));
- FieldType customType4 = new FieldType(TextField.TYPE_STORED);
+ CoreFieldType customType4 = new CoreFieldType(TextField.TYPE_STORED);
customType4.setIndexed(false);
customType4.setTokenized(false);
document.add(new Field("b1", customType4, i + " All work and no play makes Jack a dull boy"));
@@ -241,7 +241,7 @@
if (i > 3) {
//Field f = new Field("e", i + " Heres Johnny!", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS);
//f.setOmitNorms(true);
- FieldType customType5 = new FieldType(TextField.TYPE_UNSTORED);
+ CoreFieldType customType5 = new CoreFieldType(TextField.TYPE_UNSTORED);
customType5.setOmitNorms(true);
Field f = new Field("e", customType5, i + " Heres Johnny!");
document.add(f);
Index: lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java
===================================================================
--- lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java (revision 1163903)
+++ lucene/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexWriter.java (working copy)
@@ -484,28 +484,28 @@
// once fieldSettings, always fieldSettings.
- if (field.omitNorms()) {
+ if (field.fieldType().omitNorms()) {
fieldSetting.omitNorms = true;
}
- if (field.indexed() ) {
+ if (field.fieldType().indexed() ) {
fieldSetting.indexed = true;
}
- if (field.tokenized()) {
+ if (field.fieldType().tokenized()) {
fieldSetting.tokenized = true;
}
- if (field.stored()) {
+ if (field.fieldType().stored()) {
fieldSetting.stored = true;
}
if (field.binaryValue() != null) {
fieldSetting.isBinary = true;
}
- if (field.storeTermVectors()) {
+ if (field.fieldType().storeTermVectors()) {
fieldSetting.storeTermVector = true;
}
- if (field.storeTermVectorPositions()) {
+ if (field.fieldType().storeTermVectorPositions()) {
fieldSetting.storePositionWithTermVector = true;
}
- if (field.storeTermVectorOffsets()) {
+ if (field.fieldType().storeTermVectorOffsets()) {
fieldSetting.storeOffsetWithTermVector = true;
}
}
@@ -519,12 +519,12 @@
FieldSetting fieldSetting = fieldSettingsByFieldName.get(field.name());
- if (field.indexed()) {
+ if (field.fieldType().indexed()) {
LinkedList- * If doc values are stored in addition to an indexed ({@link FieldType#setIndexed(boolean)}) or stored - * ({@link FieldType#setStored(boolean)}) value it's recommended to pass the appropriate {@link FieldType} + * If doc values are stored in addition to an indexed ({@link CoreFieldType#setIndexed(boolean)}) or stored + * ({@link CoreFieldType#setStored(boolean)}) value it's recommended to pass the appropriate {@link CoreFieldType} * when creating the field: * *
@@ -81,14 +81,14 @@
* Creates a new {@link IndexDocValuesField} with the given name.
*/
public IndexDocValuesField(String name) {
- this(name, new FieldType());
+ this(name, new CoreFieldType());
}
- public IndexDocValuesField(String name, FieldType type) {
+ public IndexDocValuesField(String name, CoreFieldType type) {
this(name, type, null);
}
- public IndexDocValuesField(String name, FieldType type, String value) {
+ public IndexDocValuesField(String name, CoreFieldType type, String value) {
super(name, type);
fieldsData = value;
}
@@ -349,14 +349,14 @@
* Returns an IndexDocValuesField holding the value from
* the provided string field, as the specified type. The
* incoming field must have a string value. The name, {@link
- * FieldType} and string value are carried over from the
+ * CoreFieldType} and string value are carried over from the
* incoming Field.
*/
public static IndexDocValuesField build(Field field, ValueType type) {
if (field instanceof IndexDocValuesField) {
return (IndexDocValuesField) field;
}
- final IndexDocValuesField valField = new IndexDocValuesField(field.name(), field.getFieldType(), field.stringValue());
+ final IndexDocValuesField valField = new IndexDocValuesField(field.name(), field.fieldType(), field.stringValue());
switch (type) {
case BYTES_FIXED_DEREF:
case BYTES_FIXED_SORTED:
Index: lucene/src/java/org/apache/lucene/document/Field.java
===================================================================
--- lucene/src/java/org/apache/lucene/document/Field.java (revision 1163903)
+++ lucene/src/java/org/apache/lucene/document/Field.java (working copy)
@@ -21,6 +21,7 @@
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.FieldType;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.index.values.PerDocFieldValues;
import org.apache.lucene.index.values.ValueType;
@@ -36,7 +37,7 @@
public class Field implements IndexableField {
- protected FieldType type;
+ protected CoreFieldType type;
protected String name = "body";
// the data object for all different kind of field values
protected Object fieldsData;
@@ -47,13 +48,13 @@
protected float boost = 1.0f;
- public Field(String name, FieldType type) {
+ public Field(String name, CoreFieldType type) {
this.name = name;
this.type = type;
type.freeze();
}
- public Field(String name, FieldType type, Reader reader) {
+ public Field(String name, CoreFieldType type, Reader reader) {
if (name == null) {
throw new NullPointerException("name cannot be null");
}
@@ -67,7 +68,7 @@
type.freeze();
}
- public Field(String name, FieldType type, TokenStream tokenStream) {
+ public Field(String name, CoreFieldType type, TokenStream tokenStream) {
if (name == null) {
throw new NullPointerException("name cannot be null");
}
@@ -82,25 +83,25 @@
type.freeze();
}
- public Field(String name, FieldType type, byte[] value) {
+ public Field(String name, CoreFieldType type, byte[] value) {
this(name, type, value, 0, value.length);
}
- public Field(String name, FieldType type, byte[] value, int offset, int length) {
+ public Field(String name, CoreFieldType type, byte[] value, int offset, int length) {
this.fieldsData = new BytesRef(value, offset, length);
this.type = type;
this.name = name;
type.freeze();
}
- public Field(String name, FieldType type, BytesRef bytes) {
+ public Field(String name, CoreFieldType type, BytesRef bytes) {
this.fieldsData = bytes;
this.type = type;
this.name = name;
type.freeze();
}
- public Field(String name, FieldType type, String value) {
+ public Field(String name, CoreFieldType type, String value) {
if (name == null) {
throw new IllegalArgumentException("name cannot be null");
}
@@ -181,7 +182,7 @@
throw new IllegalArgumentException(
"cannot set a Reader value on a binary field");
}
- if (stored()) {
+ if (type.stored()) {
throw new IllegalArgumentException(
"cannot set a Reader value on a stored field");
}
@@ -206,7 +207,7 @@
* values from stringValue() or getBinaryValue()
*/
public void setTokenStream(TokenStream tokenStream) {
- if (!indexed() || !tokenized()) {
+ if (!type.indexed() || !type.tokenized()) {
throw new IllegalArgumentException(
"cannot set token stream on non indexed and tokenized field");
}
@@ -265,38 +266,6 @@
return fieldsData instanceof BytesRef;
}
- public boolean stored() {
- return type.stored();
- }
-
- public boolean indexed() {
- return type.indexed();
- }
-
- public boolean tokenized() {
- return type.tokenized();
- }
-
- public boolean omitNorms() {
- return type.omitNorms();
- }
-
- public IndexOptions indexOptions() {
- return type.indexOptions();
- }
-
- public boolean storeTermVectors() {
- return type.storeTermVectors();
- }
-
- public boolean storeTermVectorOffsets() {
- return type.storeTermVectorOffsets();
- }
-
- public boolean storeTermVectorPositions() {
- return type.storeTermVectorPositions();
- }
-
/** Prints a Field for human consumption. */
@Override
public String toString() {
@@ -329,7 +298,7 @@
}
/** Returns FieldType for this field. */
- public FieldType getFieldType() {
+ public CoreFieldType fieldType() {
return type;
}
}
Index: lucene/src/java/org/apache/lucene/document/FieldType.java (deleted)
===================================================================
Index: lucene/src/java/org/apache/lucene/document/NumericField.java
===================================================================
--- lucene/src/java/org/apache/lucene/document/NumericField.java (revision 1163903)
+++ lucene/src/java/org/apache/lucene/document/NumericField.java (working copy)
@@ -76,7 +76,7 @@
*
* By default, a NumericField's value is not stored but
* is indexed for range filtering and sorting. You can use
- * the {@link #NumericField(String, FieldType)}
+ * the {@link #NumericField(String, CoreFieldType)}
* constructor if you need to change these defaults.
*
* You may add the same field name as a NumericField to
@@ -104,7 +104,7 @@
* default value, 4, was selected for a reasonable tradeoff
* of disk space consumption versus performance. You can
* use the expert constructor {@link
- * #NumericField(String,int,FieldType)} if you'd
+ * #NumericField(String,int,CoreFieldType)} if you'd
* like to change the value. Note that you must also
* specify a congruent value when creating {@link
* NumericRangeQuery} or {@link NumericRangeFilter}.
@@ -138,8 +138,8 @@
*/
public static enum DataType { INT, LONG, FLOAT, DOUBLE }
- public static final FieldType TYPE_UNSTORED = new FieldType();
- public static final FieldType TYPE_STORED = new FieldType();
+ public static final CoreFieldType TYPE_UNSTORED = new CoreFieldType();
+ public static final CoreFieldType TYPE_STORED = new CoreFieldType();
static {
TYPE_UNSTORED.setIndexed(true);
TYPE_UNSTORED.setTokenized(true);
@@ -191,7 +191,7 @@
* instances on search results, or indexed using
* {@link NumericTokenStream}
*/
- public NumericField(String name, FieldType type) {
+ public NumericField(String name, CoreFieldType type) {
this(name, NumericUtils.PRECISION_STEP_DEFAULT, type);
}
@@ -231,14 +231,14 @@
* instances on search results, or indexed using
* {@link NumericTokenStream}
*/
- public NumericField(String name, int precisionStep, FieldType type) {
+ public NumericField(String name, int precisionStep, CoreFieldType type) {
super(name, type);
this.precisionStep = precisionStep;
}
/** Returns a {@link NumericTokenStream} for indexing the numeric value. */
public TokenStream tokenStreamValue() {
- if (!indexed()) return null;
+ if (!type.indexed()) return null;
if (numericTS == null) {
// lazy init the TokenStream as it is heavy to instantiate
// (attributes,...),
Index: lucene/src/java/org/apache/lucene/document/BinaryField.java
===================================================================
--- lucene/src/java/org/apache/lucene/document/BinaryField.java (revision 1163903)
+++ lucene/src/java/org/apache/lucene/document/BinaryField.java (working copy)
@@ -23,7 +23,7 @@
public final class BinaryField extends Field {
- public static final FieldType TYPE_STORED = new FieldType();
+ public static final CoreFieldType TYPE_STORED = new CoreFieldType();
static {
TYPE_STORED.setStored(true);
TYPE_STORED.freeze();
Index: lucene/src/java/org/apache/lucene/document/TextField.java
===================================================================
--- lucene/src/java/org/apache/lucene/document/TextField.java (revision 1163903)
+++ lucene/src/java/org/apache/lucene/document/TextField.java (working copy)
@@ -32,10 +32,10 @@
public final class TextField extends Field {
/* Indexed, tokenized, not stored. */
- public static final FieldType TYPE_UNSTORED = new FieldType();
+ public static final CoreFieldType TYPE_UNSTORED = new CoreFieldType();
/* Indexed, tokenized, stored. */
- public static final FieldType TYPE_STORED = new FieldType();
+ public static final CoreFieldType TYPE_STORED = new CoreFieldType();
static {
TYPE_UNSTORED.setIndexed(true);
Index: lucene/src/java/org/apache/lucene/document/StringField.java
===================================================================
--- lucene/src/java/org/apache/lucene/document/StringField.java (revision 1163903)
+++ lucene/src/java/org/apache/lucene/document/StringField.java (working copy)
@@ -33,11 +33,11 @@
/** Indexed, not tokenized, omits norms, indexes
* DOCS_ONLY, not stored. */
- public static final FieldType TYPE_UNSTORED = new FieldType();
+ public static final CoreFieldType TYPE_UNSTORED = new CoreFieldType();
/** Indexed, not tokenized, omits norms, indexes
* DOCS_ONLY, stored */
- public static final FieldType TYPE_STORED = new FieldType();
+ public static final CoreFieldType TYPE_STORED = new CoreFieldType();
static {
TYPE_UNSTORED.setIndexed(true);
Index: lucene/src/java/org/apache/lucene/document/Document.java
===================================================================
--- lucene/src/java/org/apache/lucene/document/Document.java (revision 1163903)
+++ lucene/src/java/org/apache/lucene/document/Document.java (working copy)
@@ -19,6 +19,7 @@
import java.util.*;
+import org.apache.lucene.index.FieldType;
import org.apache.lucene.index.IndexReader; // for javadoc
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.search.IndexSearcher; // for javadoc
@@ -28,12 +29,12 @@
/** Documents are the unit of indexing and search.
*
* A Document is a set of fields. Each field has a name and a textual value.
- * A field may be {@link IndexableField#stored() stored} with the document, in which
+ * A field may be {@link FieldType#stored() stored} with the document, in which
* case it is returned with search hits on the document. Thus each document
* should typically contain one or more stored fields which uniquely identify
* it.
*
- *
Note that fields which are not {@link IndexableField#stored() stored} are
+ *
Note that fields which are not {@link FieldType#stored() stored} are
* not available in documents retrieved from the index, e.g. with {@link
* ScoreDoc#doc} or {@link IndexReader#document(int)}.
*/
Index: lucene/src/java/org/apache/lucene/document/CoreFieldType.java
===================================================================
--- lucene/src/java/org/apache/lucene/document/CoreFieldType.java (revision 1163903)
+++ lucene/src/java/org/apache/lucene/document/CoreFieldType.java (working copy)
@@ -18,8 +18,9 @@
*/
import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.FieldType;
-public class FieldType {
+public class CoreFieldType implements FieldType {
private boolean indexed;
private boolean stored;
@@ -31,7 +32,7 @@
private IndexOptions indexOptions = IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
private boolean frozen;
- public FieldType(FieldType ref) {
+ public CoreFieldType(FieldType ref) {
this.indexed = ref.indexed();
this.stored = ref.stored();
this.tokenized = ref.tokenized();
@@ -43,7 +44,7 @@
// Do not copy frozen!
}
- public FieldType() {
+ public CoreFieldType() {
}
private void checkIfFrozen() {
Index: lucene/src/test-framework/org/apache/lucene/analysis/CollationTestBase.java
===================================================================
--- lucene/src/test-framework/org/apache/lucene/analysis/CollationTestBase.java (revision 1163903)
+++ lucene/src/test-framework/org/apache/lucene/analysis/CollationTestBase.java (working copy)
@@ -19,6 +19,7 @@
import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;
+import org.apache.lucene.document.*;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
@@ -33,11 +34,6 @@
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.FieldType;
-import org.apache.lucene.document.StringField;
-import org.apache.lucene.document.TextField;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IndexableBinaryStringTools;
import org.apache.lucene.util.LuceneTestCase;
@@ -199,7 +195,7 @@
{ "J", "y", "HOT", "HOT", "HOT", "HOT" },
};
- FieldType customType = new FieldType();
+ CoreFieldType customType = new CoreFieldType();
customType.setStored(true);
for (int i = 0 ; i < sortData.length ; ++i) {
Index: lucene/src/test-framework/org/apache/lucene/index/DocHelper.java
===================================================================
--- lucene/src/test-framework/org/apache/lucene/index/DocHelper.java (revision 1163903)
+++ lucene/src/test-framework/org/apache/lucene/index/DocHelper.java (working copy)
@@ -26,13 +26,8 @@
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
-import org.apache.lucene.document.BinaryField;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.StringField;
+import org.apache.lucene.document.*;
import org.apache.lucene.index.FieldInfo.IndexOptions;
-import org.apache.lucene.document.FieldType;
-import org.apache.lucene.document.TextField;
import org.apache.lucene.search.SimilarityProvider;
import org.apache.lucene.store.Directory;
@@ -40,36 +35,36 @@
class DocHelper {
- public static final FieldType customType;
+ public static final CoreFieldType customType;
public static final String FIELD_1_TEXT = "field one text";
public static final String TEXT_FIELD_1_KEY = "textField1";
public static Field textField1;
static {
- customType = new FieldType(TextField.TYPE_STORED);
+ customType = new CoreFieldType(TextField.TYPE_STORED);
textField1 = new Field(TEXT_FIELD_1_KEY, customType, FIELD_1_TEXT);
}
- public static final FieldType customType2;
+ public static final CoreFieldType customType2;
public static final String FIELD_2_TEXT = "field field field two text";
//Fields will be lexicographically sorted. So, the order is: field, text, two
public static final int [] FIELD_2_FREQS = {3, 1, 1};
public static final String TEXT_FIELD_2_KEY = "textField2";
public static Field textField2;
static {
- customType2 = new FieldType(TextField.TYPE_STORED);
+ customType2 = new CoreFieldType(TextField.TYPE_STORED);
customType2.setStoreTermVectors(true);
customType2.setStoreTermVectorPositions(true);
customType2.setStoreTermVectorOffsets(true);
textField2 = new Field(TEXT_FIELD_2_KEY, customType2, FIELD_2_TEXT);
}
- public static final FieldType customType3;
+ public static final CoreFieldType customType3;
public static final String FIELD_3_TEXT = "aaaNoNorms aaaNoNorms bbbNoNorms";
public static final String TEXT_FIELD_3_KEY = "textField3";
public static Field textField3;
static {
- customType3 = new FieldType(TextField.TYPE_STORED);
+ customType3 = new CoreFieldType(TextField.TYPE_STORED);
customType3.setOmitNorms(true);
textField3 = new Field(TEXT_FIELD_3_KEY, customType3, FIELD_3_TEXT);
}
@@ -81,33 +76,33 @@
keyField = new Field(KEYWORD_FIELD_KEY, StringField.TYPE_STORED, KEYWORD_TEXT);
}
- public static final FieldType customType5;
+ public static final CoreFieldType customType5;
public static final String NO_NORMS_TEXT = "omitNormsText";
public static final String NO_NORMS_KEY = "omitNorms";
public static Field noNormsField;
static {
- customType5 = new FieldType(TextField.TYPE_STORED);
+ customType5 = new CoreFieldType(TextField.TYPE_STORED);
customType5.setOmitNorms(true);
customType5.setTokenized(false);
noNormsField = new Field(NO_NORMS_KEY, customType5, NO_NORMS_TEXT);
}
- public static final FieldType customType6;
+ public static final CoreFieldType customType6;
public static final String NO_TF_TEXT = "analyzed with no tf and positions";
public static final String NO_TF_KEY = "omitTermFreqAndPositions";
public static Field noTFField;
static {
- customType6 = new FieldType(TextField.TYPE_STORED);
+ customType6 = new CoreFieldType(TextField.TYPE_STORED);
customType6.setIndexOptions(IndexOptions.DOCS_ONLY);
noTFField = new Field(NO_TF_KEY, customType6, NO_TF_TEXT);
}
- public static final FieldType customType7;
+ public static final CoreFieldType customType7;
public static final String UNINDEXED_FIELD_TEXT = "unindexed field text";
public static final String UNINDEXED_FIELD_KEY = "unIndField";
public static Field unIndField;
static {
- customType7 = new FieldType();
+ customType7 = new CoreFieldType();
customType7.setStored(true);
unIndField = new Field(UNINDEXED_FIELD_KEY, customType7, UNINDEXED_FIELD_TEXT);
}
@@ -117,12 +112,12 @@
public static final String UNSTORED_FIELD_1_KEY = "unStoredField1";
public static Field unStoredField1 = new Field(UNSTORED_FIELD_1_KEY, TextField.TYPE_UNSTORED, UNSTORED_1_FIELD_TEXT);
- public static final FieldType customType8;
+ public static final CoreFieldType customType8;
public static final String UNSTORED_2_FIELD_TEXT = "unstored field text";
public static final String UNSTORED_FIELD_2_KEY = "unStoredField2";
public static Field unStoredField2;
static {
- customType8 = new FieldType(TextField.TYPE_UNSTORED);
+ customType8 = new CoreFieldType(TextField.TYPE_UNSTORED);
customType8.setStoreTermVectors(true);
unStoredField2 = new Field(UNSTORED_FIELD_2_KEY, customType8, UNSTORED_2_FIELD_TEXT);
}
@@ -205,15 +200,15 @@
for (int i=0; i