You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2012/06/10 19:42:29 UTC
svn commit: r1348630 [7/7] - in /lucene/dev/trunk:
lucene/analysis/common/src/test/org/apache/lucene/analysis/core/
lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/
lucene/analysis/common/src/test/org/apache/lucene/analysis/que...
Modified: lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java (original)
+++ lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/FunctionTestSetup.java Sun Jun 10 17:42:19 2012
@@ -135,7 +135,7 @@ public abstract class FunctionTestSetup
f = newField(ID_FIELD, id2String(scoreAndID), customType); // for debug purposes
d.add(f);
- FieldType customType2 = new FieldType(TextField.TYPE_UNSTORED);
+ FieldType customType2 = new FieldType(TextField.TYPE_NOT_STORED);
customType2.setOmitNorms(true);
f = newField(TEXT_FIELD, "text of doc" + scoreAndID + textLine(i), customType2); // for regular search
d.add(f);
Modified: lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestBoostedQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestBoostedQuery.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestBoostedQuery.java (original)
+++ lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestBoostedQuery.java Sun Jun 10 17:42:19 2012
@@ -1,6 +1,5 @@
package org.apache.lucene.queries.function;
-import java.io.IOException;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
@@ -56,7 +55,7 @@ public class TestBoostedQuery extends Lu
iwConfig.setMergePolicy(newLogMergePolicy());
RandomIndexWriter iw = new RandomIndexWriter(random(), dir, iwConfig);
Document document = new Document();
- Field idField = new StringField("id", "");
+ Field idField = new StringField("id", "", Field.Store.NO);
document.add(idField);
iw.addDocument(document);
ir = iw.getReader();
Modified: lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java (original)
+++ lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/function/TestValueSources.java Sun Jun 10 17:42:19 2012
@@ -21,7 +21,6 @@ import java.util.Arrays;
import java.util.List;
import org.apache.lucene.analysis.MockAnalyzer;
-import org.apache.lucene.codecs.Codec;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
@@ -98,23 +97,23 @@ public class TestValueSources extends Lu
iwConfig.setMergePolicy(newLogMergePolicy());
RandomIndexWriter iw = new RandomIndexWriter(random(), dir, iwConfig);
Document document = new Document();
- Field idField = new StringField("id", "");
+ Field idField = new StringField("id", "", Field.Store.NO);
document.add(idField);
- Field byteField = new StringField("byte", "");
+ Field byteField = new StringField("byte", "", Field.Store.NO);
document.add(byteField);
- Field doubleField = new StringField("double", "");
+ Field doubleField = new StringField("double", "", Field.Store.NO);
document.add(doubleField);
- Field floatField = new StringField("float", "");
+ Field floatField = new StringField("float", "", Field.Store.NO);
document.add(floatField);
- Field intField = new StringField("int", "");
+ Field intField = new StringField("int", "", Field.Store.NO);
document.add(intField);
- Field longField = new StringField("long", "");
+ Field longField = new StringField("long", "", Field.Store.NO);
document.add(longField);
- Field shortField = new StringField("short", "");
+ Field shortField = new StringField("short", "", Field.Store.NO);
document.add(shortField);
- Field stringField = new StringField("string", "");
+ Field stringField = new StringField("string", "", Field.Store.NO);
document.add(stringField);
- Field textField = new TextField("text", "");
+ Field textField = new TextField("text", "", Field.Store.NO);
document.add(textField);
for (String [] doc : documents) {
Modified: lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java (original)
+++ lucene/dev/trunk/lucene/queries/src/test/org/apache/lucene/queries/mlt/TestMoreLikeThis.java Sun Jun 10 17:42:19 2012
@@ -26,7 +26,7 @@ import java.util.Map;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.search.BooleanClause;
@@ -65,7 +65,7 @@ public class TestMoreLikeThis extends Lu
private void addDoc(RandomIndexWriter writer, String text) throws IOException {
Document doc = new Document();
- doc.add(newField("text", text, TextField.TYPE_STORED));
+ doc.add(newTextField("text", text, Field.Store.YES));
writer.addDocument(doc);
}
Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java (original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiFieldQueryParser.java Sun Jun 10 17:42:19 2012
@@ -23,7 +23,7 @@ import java.util.Map;
import org.apache.lucene.analysis.*;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
@@ -283,7 +283,7 @@ public class TestMultiFieldQueryParser e
Directory ramDir = newDirectory();
IndexWriter iw = new IndexWriter(ramDir, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
Document doc = new Document();
- doc.add(newField("body", "blah the footest blah", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("body", "blah the footest blah", Field.Store.NO));
iw.addDocument(doc);
iw.close();
Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java (original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java Sun Jun 10 17:42:19 2012
@@ -22,7 +22,7 @@ import java.util.HashSet;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
@@ -120,8 +120,8 @@ public class TestComplexPhraseQuery exte
IndexWriter w = new IndexWriter(rd, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
for (int i = 0; i < docsContent.length; i++) {
Document doc = new Document();
- doc.add(newField("name", docsContent[i].name, TextField.TYPE_STORED));
- doc.add(newField("id", docsContent[i].id, TextField.TYPE_STORED));
+ doc.add(newTextField("name", docsContent[i].name, Field.Store.YES));
+ doc.add(newTextField("id", docsContent[i].id, Field.Store.YES));
w.addDocument(doc);
}
w.close();
Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java (original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestMultiFieldQPHelper.java Sun Jun 10 17:42:19 2012
@@ -17,15 +17,13 @@ package org.apache.lucene.queryparser.fl
* limitations under the License.
*/
-import java.io.IOException;
import java.io.Reader;
-import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
import org.apache.lucene.analysis.*;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
@@ -322,7 +320,7 @@ public class TestMultiFieldQPHelper exte
Directory ramDir = newDirectory();
IndexWriter iw = new IndexWriter(ramDir, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
Document doc = new Document();
- doc.add(newField("body", "blah the footest blah", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("body", "blah the footest blah", Field.Store.NO));
iw.addDocument(doc);
iw.close();
Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java (original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java Sun Jun 10 17:42:19 2012
@@ -199,7 +199,7 @@ public class TestNumericQueryParser exte
numericConfigMap.put(type.name(), new NumericConfig(PRECISION_STEP,
NUMBER_FORMAT, type));
- FieldType ft = new FieldType(IntField.TYPE);
+ FieldType ft = new FieldType(IntField.TYPE_NOT_STORED);
ft.setNumericType(type);
ft.setStored(true);
ft.setNumericPrecisionStep(PRECISION_STEP);
@@ -229,7 +229,7 @@ public class TestNumericQueryParser exte
numericConfigMap.put(DATE_FIELD_NAME, new NumericConfig(PRECISION_STEP,
DATE_FORMAT, NumericType.LONG));
- FieldType ft = new FieldType(LongField.TYPE);
+ FieldType ft = new FieldType(LongField.TYPE_NOT_STORED);
ft.setStored(true);
ft.setNumericPrecisionStep(PRECISION_STEP);
LongField dateField = new LongField(DATE_FIELD_NAME, 0l, ft);
Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java (original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java Sun Jun 10 17:42:19 2012
@@ -19,7 +19,6 @@ package org.apache.lucene.queryparser.fl
import java.io.IOException;
import java.io.Reader;
-import java.io.StringReader;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
@@ -35,7 +34,7 @@ import org.apache.lucene.analysis.tokena
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.apache.lucene.document.DateTools;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
@@ -1289,7 +1288,7 @@ public class TestQPHelper extends Lucene
Directory dir = newDirectory();
IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new CannedAnalyzer()));
Document doc = new Document();
- doc.add(newField("field", "", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("field", "", Field.Store.NO));
w.addDocument(doc);
IndexReader r = DirectoryReader.open(w, true);
IndexSearcher s = newSearcher(r);
Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java (original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/surround/query/SingleFieldTestDb.java Sun Jun 10 17:42:19 2012
@@ -19,6 +19,7 @@ package org.apache.lucene.queryparser.su
import java.util.Random;
+import org.apache.lucene.document.Field;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.store.RAMDirectory;
@@ -44,7 +45,7 @@ public class SingleFieldTestDb {
new MockAnalyzer(random)));
for (int j = 0; j < docs.length; j++) {
Document d = new Document();
- d.add(new TextField(fieldName, docs[j]));
+ d.add(new TextField(fieldName, docs[j], Field.Store.NO));
writer.addDocument(d);
}
writer.close();
Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java (original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java Sun Jun 10 17:42:19 2012
@@ -31,7 +31,7 @@ import org.apache.lucene.analysis.tokena
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.apache.lucene.document.DateTools;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
@@ -1111,7 +1111,7 @@ public abstract class QueryParserTestBas
Analyzer a = new MockAnalyzer(random(), MockTokenizer.SIMPLE, true, MockTokenFilter.ENGLISH_STOPSET, true);
IndexWriter w = new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, a));
Document doc = new Document();
- doc.add(newField("f", "the wizard of ozzy", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("f", "the wizard of ozzy", Field.Store.NO));
w.addDocument(doc);
IndexReader r = DirectoryReader.open(w, true);
w.close();
Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java (original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java Sun Jun 10 17:42:19 2012
@@ -22,8 +22,8 @@ import org.apache.lucene.analysis.MockAn
import org.apache.lucene.analysis.MockTokenFilter;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
import org.apache.lucene.document.IntField;
-import org.apache.lucene.document.TextField;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
@@ -69,9 +69,9 @@ public class TestParser extends LuceneTe
String date = line.substring(0, endOfDate).trim();
String content = line.substring(endOfDate).trim();
Document doc = new Document();
- doc.add(newField("date", date, TextField.TYPE_STORED));
- doc.add(newField("contents", content, TextField.TYPE_STORED));
- doc.add(new IntField("date2", Integer.valueOf(date)));
+ doc.add(newTextField("date", date, Field.Store.YES));
+ doc.add(newTextField("contents", content, Field.Store.YES));
+ doc.add(new IntField("date2", Integer.valueOf(date), Field.Store.NO));
writer.addDocument(doc);
line = d.readLine();
}
Modified: lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java (original)
+++ lucene/dev/trunk/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java Sun Jun 10 17:42:19 2012
@@ -19,7 +19,7 @@ package org.apache.lucene.queryparser.xm
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
@@ -129,7 +129,7 @@ public class TestQueryTemplateManager ex
String name = st.nextToken().trim();
if (st.hasMoreTokens()) {
String value = st.nextToken().trim();
- result.add(newField(name, value, TextField.TYPE_STORED));
+ result.add(newTextField(name, value, Field.Store.YES));
}
}
return result;
Modified: lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java (original)
+++ lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java Sun Jun 10 17:42:19 2012
@@ -22,8 +22,7 @@ import java.util.HashSet;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.StringField;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.*;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.IndexSearcher;
@@ -76,9 +75,9 @@ public class DuplicateFilterTest extends
private void addDoc(RandomIndexWriter writer, String url, String text, String date) throws IOException {
Document doc = new Document();
- doc.add(newField(KEY_FIELD, url, StringField.TYPE_STORED));
- doc.add(newField("text", text, TextField.TYPE_STORED));
- doc.add(newField("date", date, TextField.TYPE_STORED));
+ doc.add(newStringField(KEY_FIELD, url, Field.Store.YES));
+ doc.add(newTextField("text", text, Field.Store.YES));
+ doc.add(newTextField("date", date, Field.Store.YES));
writer.addDocument(doc);
}
Modified: lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java (original)
+++ lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java Sun Jun 10 17:42:19 2012
@@ -20,7 +20,7 @@ package org.apache.lucene.sandbox.querie
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
@@ -69,8 +69,8 @@ public class FuzzyLikeThisQueryTest exte
private void addDoc(RandomIndexWriter writer, String name, String id) throws IOException {
Document doc = new Document();
- doc.add(newField("name", name, TextField.TYPE_STORED));
- doc.add(newField("id", id, TextField.TYPE_STORED));
+ doc.add(newTextField("name", name, Field.Store.YES));
+ doc.add(newTextField("id", id, Field.Store.YES));
writer.addDocument(doc);
}
Modified: lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java (original)
+++ lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java Sun Jun 10 17:42:19 2012
@@ -6,7 +6,6 @@ import java.util.Locale;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-import org.apache.lucene.document.StringField;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.search.*;
@@ -58,7 +57,7 @@ public class TestSlowCollationMethods ex
for (int i = 0; i < numDocs; i++) {
Document doc = new Document();
String value = _TestUtil.randomUnicodeString(random());
- Field field = newField("field", value, StringField.TYPE_STORED);
+ Field field = newStringField("field", value, Field.Store.YES);
doc.add(field);
iw.addDocument(doc);
}
Modified: lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java (original)
+++ lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java Sun Jun 10 17:42:19 2012
@@ -23,7 +23,7 @@ import java.io.IOException;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.MultiReader;
import org.apache.lucene.index.RandomIndexWriter;
@@ -462,7 +462,7 @@ public class TestSlowFuzzyQuery extends
private void addDoc(String text, RandomIndexWriter writer) throws IOException {
Document doc = new Document();
- doc.add(newField("field", text, TextField.TYPE_STORED));
+ doc.add(newTextField("field", text, Field.Store.YES));
writer.addDocument(doc);
}
}
Modified: lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java (original)
+++ lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery2.java Sun Jun 10 17:42:19 2012
@@ -25,7 +25,6 @@ import org.apache.lucene.analysis.MockAn
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-import org.apache.lucene.document.TextField;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
@@ -93,7 +92,7 @@ public class TestSlowFuzzyQuery2 extends
RandomIndexWriter writer = new RandomIndexWriter(random(), dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.KEYWORD, false)).setMergePolicy(newLogMergePolicy()));
Document doc = new Document();
- Field field = newField("field", "", TextField.TYPE_UNSTORED);
+ Field field = newTextField("field", "", Field.Store.NO);
doc.add(field);
for (int i = 0; i < terms; i++) {
Modified: lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestRegexQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestRegexQuery.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestRegexQuery.java (original)
+++ lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestRegexQuery.java Sun Jun 10 17:42:19 2012
@@ -17,6 +17,7 @@ package org.apache.lucene.sandbox.querie
* limitations under the License.
*/
+import org.apache.lucene.document.Field;
import org.apache.lucene.search.spans.SpanMultiTermQueryWrapper;
import org.apache.lucene.store.Directory;
import org.apache.lucene.index.IndexReader;
@@ -25,7 +26,6 @@ import org.apache.lucene.index.RandomInd
import org.apache.lucene.index.Term;
import org.apache.lucene.index.Terms;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.index.TermsEnum;
@@ -47,7 +47,7 @@ public class TestRegexQuery extends Luce
directory = newDirectory();
RandomIndexWriter writer = new RandomIndexWriter(random(), directory);
Document doc = new Document();
- doc.add(newField(FN, "the quick brown fox jumps over the lazy dog", TextField.TYPE_UNSTORED));
+ doc.add(newTextField(FN, "the quick brown fox jumps over the lazy dog", Field.Store.NO));
writer.addDocument(doc);
reader = writer.getReader();
writer.close();
Modified: lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java (original)
+++ lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/regex/TestSpanRegexQuery.java Sun Jun 10 17:42:19 2012
@@ -17,24 +17,19 @@ package org.apache.lucene.sandbox.querie
* limitations under the License.
*/
-import java.io.IOException;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.FieldType;
-import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.Term;
-import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.spans.SpanFirstQuery;
import org.apache.lucene.search.spans.SpanMultiTermQueryWrapper;
import org.apache.lucene.search.spans.SpanQuery;
import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.LockObtainFailedException;
import org.apache.lucene.util.LuceneTestCase;
public class TestSpanRegexQuery extends LuceneTestCase {
@@ -65,10 +60,10 @@ public class TestSpanRegexQuery extends
// Field.Store.NO, Field.Index.ANALYZED));
// writer.addDocument(doc);
// doc = new Document();
- doc.add(newField("field", "auto update", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("field", "auto update", Field.Store.NO));
writer.addDocument(doc);
doc = new Document();
- doc.add(newField("field", "first auto update", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("field", "first auto update", Field.Store.NO));
writer.addDocument(doc);
writer.forceMerge(1);
writer.close();
Modified: lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/PrefixTreeStrategy.java Sun Jun 10 17:42:19 2012
@@ -87,23 +87,23 @@ public abstract class PrefixTreeStrategy
}
if( index ) {
- return new Field(fname,new CellTokenStream(cells.iterator()),TYPE_UNSTORED);
+ return new Field(fname,new CellTokenStream(cells.iterator()),TYPE_NOT_STORED);
}
throw new UnsupportedOperationException("Fields need to be indexed or store ["+fname+"]");
}
/* Indexed, tokenized, not stored. */
- public static final FieldType TYPE_UNSTORED = new FieldType();
+ public static final FieldType TYPE_NOT_STORED = new FieldType();
/* Indexed, tokenized, stored. */
public static final FieldType TYPE_STORED = new FieldType();
static {
- TYPE_UNSTORED.setIndexed(true);
- TYPE_UNSTORED.setTokenized(true);
- TYPE_UNSTORED.setOmitNorms(true);
- TYPE_UNSTORED.freeze();
+ TYPE_NOT_STORED.setIndexed(true);
+ TYPE_NOT_STORED.setTokenized(true);
+ TYPE_NOT_STORED.setOmitNorms(true);
+ TYPE_NOT_STORED.freeze();
TYPE_STORED.setStored(true);
TYPE_STORED.setIndexed(true);
Modified: lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/util/NumericFieldInfo.java Sun Jun 10 17:42:19 2012
@@ -39,7 +39,7 @@ public class NumericFieldInfo {
if (!store && !index)
throw new IllegalArgumentException("field must be indexed or stored");
- FieldType fieldType = new FieldType(DoubleField.TYPE);
+ FieldType fieldType = new FieldType(DoubleField.TYPE_NOT_STORED);
fieldType.setStored(store);
fieldType.setIndexed(index);
fieldType.setNumericPrecisionStep(precisionStep);
Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/StrategyTestCase.java Sun Jun 10 17:42:19 2012
@@ -76,8 +76,8 @@ public abstract class StrategyTestCase<T
while (sampleData.hasNext()) {
SampleData data = sampleData.next();
Document document = new Document();
- document.add(new Field("id", data.id, StringField.TYPE_STORED));
- document.add(new Field("name", data.name, StringField.TYPE_STORED));
+ document.add(new StringField("id", data.id, Field.Store.YES));
+ document.add(new StringField("name", data.name, Field.Store.YES));
Shape shape = ctx.readShape(data.shape);
for (IndexableField f : strategy.createFields(fieldInfo, shape, true, storeShape)) {
if( f != null ) { // null if incompatibleGeometry && ignore
Modified: lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestTermQueryPrefixGridStrategy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestTermQueryPrefixGridStrategy.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestTermQueryPrefixGridStrategy.java (original)
+++ lucene/dev/trunk/lucene/spatial/src/test/org/apache/lucene/spatial/prefix/TestTermQueryPrefixGridStrategy.java Sun Jun 10 17:42:19 2012
@@ -45,7 +45,7 @@ public class TestTermQueryPrefixGridStra
Shape point = new PointImpl(-118.243680, 34.052230);
Document losAngeles = new Document();
- losAngeles.add(new Field("name", "Los Angeles", StringField.TYPE_STORED));
+ losAngeles.add(new StringField("name", "Los Angeles", Field.Store.YES));
losAngeles.add(prefixGridStrategy.createField(fieldInfo, point, true, true));
addDocumentsAndCommit(Arrays.asList(losAngeles));
Modified: lucene/dev/trunk/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java (original)
+++ lucene/dev/trunk/lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java Sun Jun 10 17:42:19 2012
@@ -20,7 +20,6 @@ package org.apache.lucene.search.spell;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Comparator;
-import java.util.Iterator;
import java.util.List;
import org.apache.lucene.document.Document;
@@ -575,7 +574,7 @@ public class SpellChecker implements jav
Document doc = new Document();
// the word field is never queried on... its indexed so it can be quickly
// checked for rebuild (and stored for retrieval). Doesn't need norms or TF/pos
- Field f = new Field(F_WORD, text, StringField.TYPE_STORED);
+ Field f = new StringField(F_WORD, text, Field.Store.YES);
doc.add(f); // orig term
addGram(text, doc, ng1, ng2);
return doc;
@@ -588,7 +587,7 @@ public class SpellChecker implements jav
String end = null;
for (int i = 0; i < len - ng + 1; i++) {
String gram = text.substring(i, i + ng);
- FieldType ft = new FieldType(StringField.TYPE_UNSTORED);
+ FieldType ft = new FieldType(StringField.TYPE_NOT_STORED);
ft.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
Field ngramField = new Field(key, gram, ft);
// spellchecker does not use positional queries, but we want freqs
@@ -596,14 +595,14 @@ public class SpellChecker implements jav
doc.add(ngramField);
if (i == 0) {
// only one term possible in the startXXField, TF/pos and norms aren't needed.
- Field startField = new StringField("start" + ng, gram);
+ Field startField = new StringField("start" + ng, gram, Field.Store.NO);
doc.add(startField);
}
end = gram;
}
if (end != null) { // may not be present if len==ng1
// only one term possible in the endXXField, TF/pos and norms aren't needed.
- Field endField = new StringField("end" + ng, end);
+ Field endField = new StringField("end" + ng, end, Field.Store.NO);
doc.add(endField);
}
}
Modified: lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java (original)
+++ lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestDirectSpellChecker.java Sun Jun 10 17:42:19 2012
@@ -20,7 +20,7 @@ package org.apache.lucene.search.spell;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
@@ -39,7 +39,7 @@ public class TestDirectSpellChecker exte
String[] termsToAdd = { "metanoia", "metanoian", "metanoiai", "metanoias", "metanoið" };
for (int i = 0; i < termsToAdd.length; i++) {
Document doc = new Document();
- doc.add(newField("repentance", termsToAdd[i], TextField.TYPE_UNSTORED));
+ doc.add(newTextField("repentance", termsToAdd[i], Field.Store.NO));
writer.addDocument(doc);
}
@@ -68,7 +68,7 @@ public class TestDirectSpellChecker exte
for (int i = 0; i < 20; i++) {
Document doc = new Document();
- doc.add(newField("numbers", English.intToEnglish(i), TextField.TYPE_UNSTORED));
+ doc.add(newTextField("numbers", English.intToEnglish(i), Field.Store.NO));
writer.addDocument(doc);
}
@@ -108,7 +108,7 @@ public class TestDirectSpellChecker exte
// add some more documents
for (int i = 1000; i < 1100; i++) {
Document doc = new Document();
- doc.add(newField("numbers", English.intToEnglish(i), TextField.TYPE_UNSTORED));
+ doc.add(newTextField("numbers", English.intToEnglish(i), Field.Store.NO));
writer.addDocument(doc);
}
@@ -132,13 +132,13 @@ public class TestDirectSpellChecker exte
new MockAnalyzer(random(), MockTokenizer.SIMPLE, true));
Document doc = new Document();
- doc.add(newField("text", "foobar", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("text", "foobar", Field.Store.NO));
writer.addDocument(doc);
- doc.add(newField("text", "foobar", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("text", "foobar", Field.Store.NO));
writer.addDocument(doc);
- doc.add(newField("text", "foobaz", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("text", "foobaz", Field.Store.NO));
writer.addDocument(doc);
- doc.add(newField("text", "fobar", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("text", "fobar", Field.Store.NO));
writer.addDocument(doc);
IndexReader ir = writer.getReader();
@@ -200,7 +200,7 @@ public class TestDirectSpellChecker exte
for (int i = 0; i < 20; i++) {
Document doc = new Document();
- doc.add(newField("numbers", English.intToEnglish(i), TextField.TYPE_UNSTORED));
+ doc.add(newTextField("numbers", English.intToEnglish(i), Field.Store.NO));
writer.addDocument(doc);
}
@@ -224,7 +224,7 @@ public class TestDirectSpellChecker exte
for (int i = 0; i < 20; i++) {
Document doc = new Document();
- doc.add(newField("numbers", English.intToEnglish(i), TextField.TYPE_UNSTORED));
+ doc.add(newTextField("numbers", English.intToEnglish(i), Field.Store.NO));
writer.addDocument(doc);
}
@@ -249,7 +249,7 @@ public class TestDirectSpellChecker exte
for (int i = 0; i < 20; i++) {
Document doc = new Document();
- doc.add(newField("numbers", English.intToEnglish(i), TextField.TYPE_UNSTORED));
+ doc.add(newTextField("numbers", English.intToEnglish(i), Field.Store.NO));
writer.addDocument(doc);
}
Modified: lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java (original)
+++ lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java Sun Jun 10 17:42:19 2012
@@ -22,7 +22,7 @@ import java.io.IOException;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
@@ -54,23 +54,23 @@ public class TestLuceneDictionary extend
Document doc;
doc = new Document();
- doc.add(newField("aaa", "foo", TextField.TYPE_STORED));
+ doc.add(newTextField("aaa", "foo", Field.Store.YES));
writer.addDocument(doc);
doc = new Document();
- doc.add(newField("aaa", "foo", TextField.TYPE_STORED));
+ doc.add(newTextField("aaa", "foo", Field.Store.YES));
writer.addDocument(doc);
doc = new Document();
- doc.add(newField("contents", "Tom", TextField.TYPE_STORED));
+ doc.add(newTextField("contents", "Tom", Field.Store.YES));
writer.addDocument(doc);
doc = new Document();
- doc.add(newField("contents", "Jerry", TextField.TYPE_STORED));
+ doc.add(newTextField("contents", "Jerry", Field.Store.YES));
writer.addDocument(doc);
doc = new Document();
- doc.add(newField("zzz", "bar", TextField.TYPE_STORED));
+ doc.add(newTextField("zzz", "bar", Field.Store.YES));
writer.addDocument(doc);
writer.forceMerge(1);
Modified: lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java (original)
+++ lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestSpellChecker.java Sun Jun 10 17:42:19 2012
@@ -28,7 +28,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
@@ -59,14 +59,14 @@ public class TestSpellChecker extends Lu
for (int i = 0; i < 1000; i++) {
Document doc = new Document();
- doc.add(newField("field1", English.intToEnglish(i), TextField.TYPE_STORED));
- doc.add(newField("field2", English.intToEnglish(i + 1), TextField.TYPE_STORED)); // + word thousand
- doc.add(newField("field3", "fvei" + (i % 2 == 0 ? " five" : ""), TextField.TYPE_STORED)); // + word thousand
+ doc.add(newTextField("field1", English.intToEnglish(i), Field.Store.YES));
+ doc.add(newTextField("field2", English.intToEnglish(i + 1), Field.Store.YES)); // + word thousand
+ doc.add(newTextField("field3", "fvei" + (i % 2 == 0 ? " five" : ""), Field.Store.YES)); // + word thousand
writer.addDocument(doc);
}
{
Document doc = new Document();
- doc.add(newField("field1", "eight", TextField.TYPE_STORED)); // "eight" in
+ doc.add(newTextField("field1", "eight", Field.Store.YES)); // "eight" in
// the index
// twice
writer.addDocument(doc);
@@ -74,13 +74,12 @@ public class TestSpellChecker extends Lu
{
Document doc = new Document();
doc
- .add(newField("field1", "twenty-one twenty-one",
- TextField.TYPE_STORED)); // "twenty-one" in the index thrice
+ .add(newTextField("field1", "twenty-one twenty-one", Field.Store.YES)); // "twenty-one" in the index thrice
writer.addDocument(doc);
}
{
Document doc = new Document();
- doc.add(newField("field1", "twenty", TextField.TYPE_STORED)); // "twenty"
+ doc.add(newTextField("field1", "twenty", Field.Store.YES)); // "twenty"
// in the
// index
// twice
Modified: lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java (original)
+++ lucene/dev/trunk/lucene/suggest/src/test/org/apache/lucene/search/spell/TestWordBreakSpellChecker.java Sun Jun 10 17:42:19 2012
@@ -22,7 +22,7 @@ import junit.framework.Assert;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.TextField;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
@@ -44,23 +44,23 @@ public class TestWordBreakSpellChecker e
for (int i = 900; i < 1112; i++) {
Document doc = new Document();
String num = English.intToEnglish(i).replaceAll("[-]", " ").replaceAll("[,]", "");
- doc.add(newField("numbers", num, TextField.TYPE_UNSTORED));
+ doc.add(newTextField("numbers", num, Field.Store.NO));
writer.addDocument(doc);
}
{
Document doc = new Document();
- doc.add(newField("numbers", "thou hast sand betwixt thy toes", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("numbers", "thou hast sand betwixt thy toes", Field.Store.NO));
writer.addDocument(doc);
}
{
Document doc = new Document();
- doc.add(newField("numbers", "hundredeight eightyeight yeight", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("numbers", "hundredeight eightyeight yeight", Field.Store.NO));
writer.addDocument(doc);
}
{
Document doc = new Document();
- doc.add(newField("numbers", "tres y cinco", TextField.TYPE_UNSTORED));
+ doc.add(newTextField("numbers", "tres y cinco", Field.Store.NO));
writer.addDocument(doc);
}
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/analysis/CollationTestBase.java Sun Jun 10 17:42:19 2012
@@ -66,8 +66,8 @@ public abstract class CollationTestBase
IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
TEST_VERSION_CURRENT, analyzer));
Document doc = new Document();
- doc.add(new Field("content", "\u0633\u0627\u0628", TextField.TYPE_STORED));
- doc.add(new Field("body", "body", StringField.TYPE_STORED));
+ doc.add(new TextField("content", "\u0633\u0627\u0628", Field.Store.YES));
+ doc.add(new StringField("body", "body", Field.Store.YES));
writer.addDocument(doc);
writer.close();
IndexReader reader = DirectoryReader.open(dir);
@@ -103,7 +103,7 @@ public abstract class CollationTestBase
// orders the U+0698 character before the U+0633 character, so the single
// index Term below should NOT be returned by a TermRangeQuery with a Farsi
// Collator (or an Arabic one for the case when Farsi is not supported).
- doc.add(new Field("content", "\u0633\u0627\u0628", TextField.TYPE_STORED));
+ doc.add(new TextField("content", "\u0633\u0627\u0628", Field.Store.YES));
writer.addDocument(doc);
writer.close();
IndexReader reader = DirectoryReader.open(dir);
@@ -127,8 +127,8 @@ public abstract class CollationTestBase
IndexWriter writer = new IndexWriter(farsiIndex, new IndexWriterConfig(
TEST_VERSION_CURRENT, analyzer));
Document doc = new Document();
- doc.add(new Field("content", "\u0633\u0627\u0628", TextField.TYPE_STORED));
- doc.add(new Field("body", "body", StringField.TYPE_STORED));
+ doc.add(new TextField("content", "\u0633\u0627\u0628", Field.Store.YES));
+ doc.add(new StringField("body", "body", Field.Store.YES));
writer.addDocument(doc);
writer.close();
@@ -195,7 +195,7 @@ public abstract class CollationTestBase
for (int i = 0 ; i < sortData.length ; ++i) {
Document doc = new Document();
doc.add(new Field("tracer", sortData[i][0], customType));
- doc.add(new TextField("contents", sortData[i][1]));
+ doc.add(new TextField("contents", sortData[i][1], Field.Store.NO));
if (sortData[i][2] != null)
doc.add(new TextField("US", usAnalyzer.tokenStream("US", new StringReader(sortData[i][2]))));
if (sortData[i][3] != null)
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/DocHelper.java Sun Jun 10 17:42:19 2012
@@ -78,7 +78,7 @@ class DocHelper {
public static final String KEYWORD_FIELD_KEY = "keyField";
public static Field keyField;
static {
- keyField = new Field(KEYWORD_FIELD_KEY, KEYWORD_TEXT, StringField.TYPE_STORED);
+ keyField = new StringField(KEYWORD_FIELD_KEY, KEYWORD_TEXT, Field.Store.YES);
}
public static final FieldType customType5;
@@ -115,14 +115,14 @@ class DocHelper {
public static final String UNSTORED_1_FIELD_TEXT = "unstored field text";
public static final String UNSTORED_FIELD_1_KEY = "unStoredField1";
- public static Field unStoredField1 = new Field(UNSTORED_FIELD_1_KEY, UNSTORED_1_FIELD_TEXT, TextField.TYPE_UNSTORED);
+ public static Field unStoredField1 = new TextField(UNSTORED_FIELD_1_KEY, UNSTORED_1_FIELD_TEXT, Field.Store.NO);
public static final FieldType 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 FieldType(TextField.TYPE_NOT_STORED);
customType8.setStoreTermVectors(true);
unStoredField2 = new Field(UNSTORED_FIELD_2_KEY, UNSTORED_2_FIELD_TEXT, customType8);
}
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/ThreadedIndexingAndSearchingTestCase.java Sun Jun 10 17:42:19 2012
@@ -29,8 +29,6 @@ import java.util.concurrent.atomic.Atomi
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-import org.apache.lucene.document.StringField;
-import org.apache.lucene.document.TextField;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.PhraseQuery;
import org.apache.lucene.search.Query;
@@ -158,7 +156,7 @@ public abstract class ThreadedIndexingAn
final String addedField;
if (random().nextBoolean()) {
addedField = "extra" + random().nextInt(40);
- doc.add(newField(addedField, "a random field", TextField.TYPE_STORED));
+ doc.add(newTextField(addedField, "a random field", Field.Store.YES));
} else {
addedField = null;
}
@@ -181,7 +179,7 @@ public abstract class ThreadedIndexingAn
packID = packCount.getAndIncrement() + "";
}
- final Field packIDField = newField("packID", packID, StringField.TYPE_STORED);
+ final Field packIDField = newStringField("packID", packID, Field.Store.YES);
final List<String> docIDs = new ArrayList<String>();
final SubDocs subDocs = new SubDocs(packID, docIDs);
final List<Document> docsList = new ArrayList<Document>();
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/search/SearchEquivalenceTestBase.java Sun Jun 10 17:42:19 2012
@@ -62,8 +62,8 @@ public abstract class SearchEquivalenceT
analyzer = new MockAnalyzer(random, MockTokenizer.WHITESPACE, false, stopset, true);
RandomIndexWriter iw = new RandomIndexWriter(random, directory, analyzer);
Document doc = new Document();
- Field id = new StringField("id", "");
- Field field = new TextField("field", "");
+ Field id = new StringField("id", "", Field.Store.NO);
+ Field field = new TextField("field", "", Field.Store.NO);
doc.add(id);
doc.add(field);
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LineFileDocs.java Sun Jun 10 17:42:19 2012
@@ -162,7 +162,7 @@ public class LineFileDocs implements Clo
public DocState(boolean useDocValues) {
doc = new Document();
- title = new StringField("title", "");
+ title = new StringField("title", "", Field.Store.NO);
doc.add(title);
FieldType ft = new FieldType(TextField.TYPE_STORED);
@@ -176,10 +176,10 @@ public class LineFileDocs implements Clo
body = new Field("body", "", ft);
doc.add(body);
- id = new Field("docid", "", StringField.TYPE_STORED);
+ id = new StringField("docid", "", Field.Store.YES);
doc.add(id);
- date = new Field("date", "", StringField.TYPE_STORED);
+ date = new StringField("date", "", Field.Store.YES);
doc.add(date);
if (useDocValues) {
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java Sun Jun 10 17:42:19 2012
@@ -17,9 +17,6 @@ package org.apache.lucene.util;
* limitations under the License.
*/
-import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsBoolean;
-import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsInt;
-
import java.io.*;
import java.lang.annotation.*;
import java.lang.reflect.Constructor;
@@ -28,8 +25,11 @@ import java.util.*;
import java.util.concurrent.*;
import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.document.Field.Store;
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.index.*;
import org.apache.lucene.index.IndexReader.ReaderClosedListener;
import org.apache.lucene.search.*;
@@ -42,12 +42,14 @@ import org.junit.*;
import org.junit.rules.RuleChain;
import org.junit.rules.TestRule;
import org.junit.runner.RunWith;
-
import com.carrotsearch.randomizedtesting.*;
import com.carrotsearch.randomizedtesting.annotations.*;
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
import com.carrotsearch.randomizedtesting.rules.SystemPropertiesInvariantRule;
+import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsBoolean;
+import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsInt;
+
/**
* Base class for all Lucene unit tests, Junit3 or Junit4 variant.
*
@@ -841,6 +843,22 @@ public abstract class LuceneTestCase ext
}
}
+ public static Field newStringField(String name, String value, Store stored) {
+ return newField(random(), name, value, stored == Store.YES ? StringField.TYPE_STORED : StringField.TYPE_NOT_STORED);
+ }
+
+ public static Field newTextField(String name, String value, Store stored) {
+ return newField(random(), name, value, stored == Store.YES ? TextField.TYPE_STORED : TextField.TYPE_NOT_STORED);
+ }
+
+ public static Field newStringField(Random random, String name, String value, Store stored) {
+ return newField(random, name, value, stored == Store.YES ? StringField.TYPE_STORED : StringField.TYPE_NOT_STORED);
+ }
+
+ public static Field newTextField(Random random, String name, String value, Store stored) {
+ return newField(random, name, value, stored == Store.YES ? TextField.TYPE_STORED : TextField.TYPE_NOT_STORED);
+ }
+
public static Field newField(String name, String value, FieldType type) {
return newField(random(), name, value, type);
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java Sun Jun 10 17:42:19 2012
@@ -435,7 +435,7 @@ public class QueryComponent extends Sear
Sort sort = searcher.weightSort(rb.getSortSpec().getSort());
SortField[] sortFields = sort==null ? new SortField[]{SortField.FIELD_SCORE} : sort.getSort();
NamedList<Object[]> sortVals = new NamedList<Object[]>(); // order is important for the sort fields
- Field field = new StringField("dummy", ""); // a dummy Field
+ Field field = new StringField("dummy", "", Field.Store.NO); // a dummy Field
IndexReaderContext topReaderContext = searcher.getTopReaderContext();
AtomicReaderContext[] leaves = topReaderContext.leaves();
AtomicReaderContext currentLeaf = null;
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java Sun Jun 10 17:42:19 2012
@@ -34,14 +34,12 @@ import org.apache.lucene.document.LongFi
import org.apache.lucene.document.StoredField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.*;
-import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.search.*;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.OpenBitSet;
-import org.apache.lucene.util.ReaderUtil;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
@@ -461,7 +459,7 @@ public class SolrIndexSearcher extends I
@Override
public void intField(FieldInfo fieldInfo, int value) {
- FieldType ft = new FieldType(IntField.TYPE);
+ FieldType ft = new FieldType(IntField.TYPE_NOT_STORED);
ft.setStored(true);
ft.setIndexed(fieldInfo.isIndexed());
doc.add(new IntField(fieldInfo.name, value, ft));
@@ -469,7 +467,7 @@ public class SolrIndexSearcher extends I
@Override
public void longField(FieldInfo fieldInfo, long value) {
- FieldType ft = new FieldType(LongField.TYPE);
+ FieldType ft = new FieldType(LongField.TYPE_NOT_STORED);
ft.setStored(true);
ft.setIndexed(fieldInfo.isIndexed());
doc.add(new LongField(fieldInfo.name, value, ft));
@@ -477,7 +475,7 @@ public class SolrIndexSearcher extends I
@Override
public void floatField(FieldInfo fieldInfo, float value) {
- FieldType ft = new FieldType(FloatField.TYPE);
+ FieldType ft = new FieldType(FloatField.TYPE_NOT_STORED);
ft.setStored(true);
ft.setIndexed(fieldInfo.isIndexed());
doc.add(new FloatField(fieldInfo.name, value, ft));
@@ -485,7 +483,7 @@ public class SolrIndexSearcher extends I
@Override
public void doubleField(FieldInfo fieldInfo, double value) {
- FieldType ft = new FieldType(DoubleField.TYPE);
+ FieldType ft = new FieldType(DoubleField.TYPE_NOT_STORED);
ft.setStored(true);
ft.setIndexed(fieldInfo.isIndexed());
doc.add(new DoubleField(fieldInfo.name, value, ft));
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/FileBasedSpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/FileBasedSpellChecker.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/FileBasedSpellChecker.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/spelling/FileBasedSpellChecker.java Sun Jun 10 17:42:19 2012
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
+import org.apache.lucene.document.Field;
import org.apache.lucene.index.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -105,7 +106,7 @@ public class FileBasedSpellChecker exten
for (String s : lines) {
Document d = new Document();
- d.add(new TextField(WORD_FIELD_NAME, s));
+ d.add(new TextField(WORD_FIELD_NAME, s, Field.Store.NO));
writer.addDocument(d);
}
writer.forceMerge(1);
Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java Sun Jun 10 17:42:19 2012
@@ -124,8 +124,8 @@ public class TestArbitraryIndexDir exten
new IndexWriterConfig(Version.LUCENE_40, new StandardAnalyzer(Version.LUCENE_40))
);
Document doc = new Document();
- doc.add(new Field("id", "2", TextField.TYPE_STORED));
- doc.add(new Field("name", "name2", TextField.TYPE_STORED));
+ doc.add(new TextField("id", "2", Field.Store.YES));
+ doc.add(new TextField("name", "name2", Field.Store.YES));
iw.addDocument(doc);
iw.commit();
iw.close();
Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSort.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSort.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSort.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSort.java Sun Jun 10 17:42:19 2012
@@ -158,8 +158,8 @@ public class TestSort extends SolrTestCa
public void testSort() throws Exception {
Directory dir = new RAMDirectory();
- Field f = new Field("f", "0", StringField.TYPE_UNSTORED);
- Field f2 = new Field("f2", "0", StringField.TYPE_UNSTORED);
+ Field f = new StringField("f", "0", Field.Store.NO);
+ Field f2 = new StringField("f2", "0", Field.Store.NO);
for (int iterCnt = 0; iterCnt<iter; iterCnt++) {
IndexWriter iw = new IndexWriter(
Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java?rev=1348630&r1=1348629&r2=1348630&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java Sun Jun 10 17:42:19 2012
@@ -291,7 +291,7 @@ public class IndexBasedSpellCheckerTest
);
for (int i = 0; i < ALT_DOCS.length; i++) {
Document doc = new Document();
- doc.add(new Field("title", ALT_DOCS[i], TextField.TYPE_STORED));
+ doc.add(new TextField("title", ALT_DOCS[i], Field.Store.YES));
iw.addDocument(doc);
}
iw.forceMerge(1);