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 2011/08/17 01:21:22 UTC
svn commit: r1158472 [2/2] - in /lucene/dev/branches/fieldtype_conflicted:
lucene/src/java/org/apache/lucene/document/
lucene/src/java/org/apache/lucene/index/
lucene/src/java/org/apache/lucene/search/
lucene/src/test-framework/org/apache/lucene/index/...
Modified: lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestOmitPositions.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestOmitPositions.java?rev=1158472&r1=1158471&r2=1158472&view=diff
==============================================================================
--- lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestOmitPositions.java (original)
+++ lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestOmitPositions.java Tue Aug 16 23:21:21 2011
@@ -21,6 +21,8 @@ import org.apache.lucene.analysis.Analyz
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.TextField;
import org.apache.lucene.index.FieldInfo.IndexOptions;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.store.Directory;
@@ -37,8 +39,9 @@ public class TestOmitPositions extends L
Directory dir = newDirectory();
RandomIndexWriter w = new RandomIndexWriter(random, dir);
Document doc = new Document();
- Field f = newField("foo", "this is a test test", Field.Index.ANALYZED);
- f.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+ FieldType ft = new FieldType(TextField.TYPE_UNSTORED);
+ ft.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+ Field f = newField("foo", "this is a test test", ft);
doc.add(f);
for (int i = 0; i < 100; i++) {
w.addDocument(doc);
@@ -67,42 +70,42 @@ public class TestOmitPositions extends L
Document d = new Document();
// f1,f2,f3: docs only
- Field f1 = newField("f1", "This field has docs only", Field.Store.NO, Field.Index.ANALYZED);
- f1.setIndexOptions(IndexOptions.DOCS_ONLY);
+ FieldType ft = new FieldType(TextField.TYPE_UNSTORED);
+ ft.setIndexOptions(IndexOptions.DOCS_ONLY);
+
+ Field f1 = newField("f1", "This field has docs only", ft);
d.add(f1);
- Field f2 = newField("f2", "This field has docs only", Field.Store.NO, Field.Index.ANALYZED);
- f2.setIndexOptions(IndexOptions.DOCS_ONLY);
+ Field f2 = newField("f2", "This field has docs only", ft);
d.add(f2);
- Field f3 = newField("f3", "This field has docs only", Field.Store.NO, Field.Index.ANALYZED);
- f3.setIndexOptions(IndexOptions.DOCS_ONLY);
+ Field f3 = newField("f3", "This field has docs only", ft);
d.add(f3);
+
+ FieldType ft2 = new FieldType(TextField.TYPE_UNSTORED);
+ ft2.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
// f4,f5,f6 docs and freqs
- Field f4 = newField("f4", "This field has docs and freqs", Field.Store.NO, Field.Index.ANALYZED);
- f4.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+ Field f4 = newField("f4", "This field has docs and freqs", ft2);
d.add(f4);
- Field f5 = newField("f5", "This field has docs and freqs", Field.Store.NO, Field.Index.ANALYZED);
- f5.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+ Field f5 = newField("f5", "This field has docs and freqs", ft2);
d.add(f5);
- Field f6 = newField("f6", "This field has docs and freqs", Field.Store.NO, Field.Index.ANALYZED);
- f6.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+ Field f6 = newField("f6", "This field has docs and freqs", ft2);
d.add(f6);
+ FieldType ft3 = new FieldType(TextField.TYPE_UNSTORED);
+ ft3.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+
// f7,f8,f9 docs/freqs/positions
- Field f7 = newField("f7", "This field has docs and freqs and positions", Field.Store.NO, Field.Index.ANALYZED);
- f7.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+ Field f7 = newField("f7", "This field has docs and freqs and positions", ft3);
d.add(f7);
- Field f8 = newField("f8", "This field has docs and freqs and positions", Field.Store.NO, Field.Index.ANALYZED);
- f8.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+ Field f8 = newField("f8", "This field has docs and freqs and positions", ft3);
d.add(f8);
- Field f9 = newField("f9", "This field has docs and freqs and positions", Field.Store.NO, Field.Index.ANALYZED);
- f9.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+ Field f9 = newField("f9", "This field has docs and freqs and positions", ft3);
d.add(f9);
writer.addDocument(d);
@@ -113,42 +116,33 @@ public class TestOmitPositions extends L
d = new Document();
// f1,f4,f7: docs only
- f1 = newField("f1", "This field has docs only", Field.Store.NO, Field.Index.ANALYZED);
- f1.setIndexOptions(IndexOptions.DOCS_ONLY);
+ f1 = newField("f1", "This field has docs only", ft);
d.add(f1);
- f4 = newField("f4", "This field has docs only", Field.Store.NO, Field.Index.ANALYZED);
- f4.setIndexOptions(IndexOptions.DOCS_ONLY);
+ f4 = newField("f4", "This field has docs only", ft);
d.add(f4);
- f7 = newField("f7", "This field has docs only", Field.Store.NO, Field.Index.ANALYZED);
- f7.setIndexOptions(IndexOptions.DOCS_ONLY);
+ f7 = newField("f7", "This field has docs only", ft);
d.add(f7);
// f2, f5, f8: docs and freqs
- f2 = newField("f2", "This field has docs and freqs", Field.Store.NO, Field.Index.ANALYZED);
- f2.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+ f2 = newField("f2", "This field has docs and freqs", ft2);
d.add(f2);
- f5 = newField("f5", "This field has docs and freqs", Field.Store.NO, Field.Index.ANALYZED);
- f5.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+ f5 = newField("f5", "This field has docs and freqs", ft2);
d.add(f5);
- f8 = newField("f8", "This field has docs and freqs", Field.Store.NO, Field.Index.ANALYZED);
- f8.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+ f8 = newField("f8", "This field has docs and freqs", ft2);
d.add(f8);
// f3, f6, f9: docs and freqs and positions
- f3 = newField("f3", "This field has docs and freqs and positions", Field.Store.NO, Field.Index.ANALYZED);
- f3.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+ f3 = newField("f3", "This field has docs and freqs and positions", ft3);
d.add(f3);
- f6 = newField("f6", "This field has docs and freqs and positions", Field.Store.NO, Field.Index.ANALYZED);
- f6.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+ f6 = newField("f6", "This field has docs and freqs and positions", ft3);
d.add(f6);
- f9 = newField("f9", "This field has docs and freqs and positions", Field.Store.NO, Field.Index.ANALYZED);
- f9.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
+ f9 = newField("f9", "This field has docs and freqs and positions", ft3);
d.add(f9);
writer.addDocument(d);
@@ -201,9 +195,10 @@ public class TestOmitPositions extends L
lmp.setMergeFactor(2);
lmp.setUseCompoundFile(false);
Document d = new Document();
-
- Field f1 = newField("f1", "This field has term freqs", Field.Store.NO, Field.Index.ANALYZED);
- f1.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+
+ FieldType ft = new FieldType(TextField.TYPE_UNSTORED);
+ ft.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
+ Field f1 = newField("f1", "This field has term freqs", ft);
d.add(f1);
for(int i=0;i<30;i++)
@@ -215,7 +210,7 @@ public class TestOmitPositions extends L
// now add some documents with positions, and check there is no prox after optimization
d = new Document();
- f1 = newField("f1", "This field has positions", Field.Store.NO, Field.Index.ANALYZED);
+ f1 = newField("f1", "This field has positions", TextField.TYPE_UNSTORED);
d.add(f1);
for(int i=0;i<30;i++)
Modified: lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestOmitTf.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestOmitTf.java?rev=1158472&r1=1158471&r2=1158472&view=diff
==============================================================================
--- lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestOmitTf.java (original)
+++ lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestOmitTf.java Tue Aug 16 23:21:21 2011
@@ -27,12 +27,9 @@ import org.apache.lucene.analysis.Analyz
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-<<<<<<<
import org.apache.lucene.index.FieldInfo.IndexOptions;
-=======
import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.TextField;
->>>>>>>
import org.apache.lucene.index.IndexReader.AtomicReaderContext;
import org.apache.lucene.search.*;
import org.apache.lucene.search.BooleanClause.Occur;
@@ -63,7 +60,7 @@ public class TestOmitTf extends LuceneTe
private static final FieldType normalType = new FieldType(TextField.TYPE_UNSTORED);
static {
- omitType.setOmitTermFreqAndPositions(true);
+ omitType.setIndexOptions(IndexOptions.DOCS_ONLY);
}
// Tests whether the DocumentWriter correctly enable the
@@ -79,12 +76,7 @@ public class TestOmitTf extends LuceneTe
d.add(f1);
// this field will NOT have Tf
-<<<<<<<
- Field f2 = newField("f2", "This field has NO Tf in all docs", Field.Store.NO, Field.Index.ANALYZED);
- f2.setIndexOptions(IndexOptions.DOCS_ONLY);
-=======
Field f2 = newField("f2", "This field has NO Tf in all docs", omitType);
->>>>>>>
d.add(f2);
writer.addDocument(d);
@@ -94,18 +86,10 @@ public class TestOmitTf extends LuceneTe
d = new Document();
// Reverse
-<<<<<<<
- f1.setIndexOptions(IndexOptions.DOCS_ONLY);
-=======
f1 = newField("f1", "This field has term freqs", omitType);
->>>>>>>
d.add(f1);
-<<<<<<<
- f2.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
-=======
f2 = newField("f2", "This field has NO Tf in all docs", normalType);
->>>>>>>
d.add(f2);
writer.addDocument(d);
@@ -143,12 +127,7 @@ public class TestOmitTf extends LuceneTe
d.add(f1);
// this field will NOT have Tf
-<<<<<<<
- Field f2 = newField("f2", "This field has NO Tf in all docs", Field.Store.NO, Field.Index.ANALYZED);
- f2.setIndexOptions(IndexOptions.DOCS_ONLY);
-=======
Field f2 = newField("f2", "This field has NO Tf in all docs", omitType);
->>>>>>>
d.add(f2);
for(int i=0;i<30;i++)
@@ -159,18 +138,10 @@ public class TestOmitTf extends LuceneTe
d = new Document();
// Reverese
-<<<<<<<
- f1.setIndexOptions(IndexOptions.DOCS_ONLY);
-=======
f1 = newField("f1", "This field has term freqs", omitType);
->>>>>>>
d.add(f1);
-<<<<<<<
- f2.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
-=======
f2 = newField("f2", "This field has NO Tf in all docs", normalType);
->>>>>>>
d.add(f2);
for(int i=0;i<30;i++)
@@ -215,11 +186,6 @@ public class TestOmitTf extends LuceneTe
for(int i=0;i<5;i++)
writer.addDocument(d);
-<<<<<<<
- f2.setIndexOptions(IndexOptions.DOCS_ONLY);
-
-=======
->>>>>>>
for(int i=0;i<20;i++)
writer.addDocument(d);
@@ -257,12 +223,7 @@ public class TestOmitTf extends LuceneTe
lmp.setUseCompoundFile(false);
Document d = new Document();
-<<<<<<<
- Field f1 = newField("f1", "This field has no term freqs", Field.Store.NO, Field.Index.ANALYZED);
- f1.setIndexOptions(IndexOptions.DOCS_ONLY);
-=======
Field f1 = newField("f1", "This field has term freqs", omitType);
->>>>>>>
d.add(f1);
for(int i=0;i<30;i++)
@@ -274,7 +235,7 @@ public class TestOmitTf extends LuceneTe
// now add some documents with positions, and check there is no prox after optimization
d = new Document();
- f1 = newField("f1", "This field has positions", Field.Store.NO, Field.Index.ANALYZED);
+ f1 = newField("f1", "This field has positions", TextField.TYPE_UNSTORED);
d.add(f1);
for(int i=0;i<30;i++)
@@ -308,12 +269,7 @@ public class TestOmitTf extends LuceneTe
Document d = new Document();
sb.append(term).append(" ");
String content = sb.toString();
-<<<<<<<
- Field noTf = newField("noTf", content + (i%2==0 ? "" : " notf"), Field.Store.NO, Field.Index.ANALYZED);
- noTf.setIndexOptions(IndexOptions.DOCS_ONLY);
-=======
Field noTf = newField("noTf", content + (i%2==0 ? "" : " notf"), omitType);
->>>>>>>
d.add(noTf);
Field tf = newField("tf", content + (i%2==0 ? " tf" : ""), normalType);
Modified: lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestRollback.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestRollback.java?rev=1158472&r1=1158471&r2=1158472&view=diff
==============================================================================
--- lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestRollback.java (original)
+++ lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestRollback.java Tue Aug 16 23:21:21 2011
@@ -46,15 +46,9 @@ public class TestRollback extends Lucene
for (int i = 0; i < 3; i++) {
Document doc = new Document();
String value = Integer.toString(i);
-<<<<<<<
- doc.add(newField("pk", value, Store.YES, Index.ANALYZED_NO_NORMS));
- doc.add(newField("text", "foo", Store.YES, Index.ANALYZED_NO_NORMS));
- w.updateDocument(new Term("pk", value), doc);
-=======
doc.add(newField("pk", value, customType));
doc.add(newField("text", "foo", customType));
- w.updateDocument(pkTerm.createTerm(value), doc);
->>>>>>>
+ w.updateDocument(new Term("pk", value), doc);
}
w.rollback();
Modified: lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestRollingUpdates.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestRollingUpdates.java?rev=1158472&r1=1158471&r2=1158472&view=diff
==============================================================================
--- lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestRollingUpdates.java (original)
+++ lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestRollingUpdates.java Tue Aug 16 23:21:21 2011
@@ -19,11 +19,7 @@ package org.apache.lucene.index;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.*;
-<<<<<<<
-import org.apache.lucene.document.Field.Index;
import org.apache.lucene.index.codecs.CodecProvider;
-=======
->>>>>>>
import org.apache.lucene.store.*;
import org.apache.lucene.util.*;
import org.junit.Test;
Modified: lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java?rev=1158472&r1=1158471&r2=1158472&view=diff
==============================================================================
--- lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java (original)
+++ lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestSameTokenSamePosition.java Tue Aug 16 23:21:21 2011
@@ -58,8 +58,7 @@ public class TestSameTokenSamePosition e
Directory dir = newDirectory();
RandomIndexWriter riw = new RandomIndexWriter(random, dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new BugReproAnalyzer()));
Document doc = new Document();
- doc.add(new Field("eng", "Six drunken" /*This shouldn't matter. */,
- Field.Store.YES, Field.Index.ANALYZED));
+ doc.add(new Field("eng", TextField.TYPE_STORED, "Six drunken" /*This shouldn't matter. */));
for (int i = 0; i < 100; i++) {
riw.addDocument(doc);
}
Modified: lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java?rev=1158472&r1=1158471&r2=1158472&view=diff
==============================================================================
--- lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java (original)
+++ lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java Tue Aug 16 23:21:21 2011
@@ -674,18 +674,13 @@ public class TestStressIndexing2 extends
public void indexDoc() throws IOException {
Document d = new Document();
- FieldType customType1 = new FieldType(TextField.TYPE_UNSTORED);
- customType1.setStored(true);
+ FieldType customType1 = new FieldType(TextField.TYPE_STORED);
customType1.setTokenized(false);
customType1.setOmitNorms(true);
ArrayList<Field> fields = new ArrayList<Field>();
String idString = getIdString();
-<<<<<<<
- Field idField = newField("id", idString, Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS);
-=======
- Field idField = newField(idTerm.field(), idString, customType1);
->>>>>>>
+ Field idField = newField("id", idString, customType1);
fields.add(idField);
int nFields = nextInt(maxFields);
Modified: lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestStressNRT.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestStressNRT.java?rev=1158472&r1=1158471&r2=1158472&view=diff
==============================================================================
--- lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestStressNRT.java (original)
+++ lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestStressNRT.java Tue Aug 16 23:21:21 2011
@@ -29,6 +29,8 @@ 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.FieldType;
+import org.apache.lucene.document.StringField;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;
@@ -228,8 +230,10 @@ public class TestStressNRT extends Lucen
// add tombstone first
if (tombstones) {
Document d = new Document();
- d.add(new Field("id","-"+Integer.toString(id), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
- d.add(new Field(field, Long.toString(nextVal), Field.Store.YES, Field.Index.NO));
+ d.add(new Field("id", StringField.TYPE_STORED, "-"+Integer.toString(id)));
+ FieldType stored = new FieldType();
+ stored.setStored(true);
+ d.add(new Field(field, stored, Long.toString(nextVal)));
writer.updateDocument(new Term("id", "-"+Integer.toString(id)), d);
}
@@ -244,8 +248,10 @@ public class TestStressNRT extends Lucen
// add tombstone first
if (tombstones) {
Document d = new Document();
- d.add(new Field("id","-"+Integer.toString(id), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
- d.add(new Field(field, Long.toString(nextVal), Field.Store.YES, Field.Index.NO));
+ d.add(new Field("id", StringField.TYPE_STORED, "-"+Integer.toString(id)));
+ FieldType stored = new FieldType();
+ stored.setStored(true);
+ d.add(new Field(field, stored, Long.toString(nextVal)));
writer.updateDocument(new Term("id", "-"+Integer.toString(id)), d);
}
@@ -257,8 +263,10 @@ public class TestStressNRT extends Lucen
} else {
// assertU(adoc("id",Integer.toString(id), field, Long.toString(nextVal)));
Document d = new Document();
- d.add(newField("id",Integer.toString(id), Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
- d.add(newField(field, Long.toString(nextVal), Field.Store.YES, Field.Index.NO));
+ d.add(new Field("id", StringField.TYPE_STORED, "-"+Integer.toString(id)));
+ FieldType stored = new FieldType();
+ stored.setStored(true);
+ d.add(new Field(field, stored, Long.toString(nextVal)));
if (VERBOSE) {
System.out.println("TEST: " + Thread.currentThread().getName() + ": u id:" + id + " val=" + nextVal);
}
Modified: lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestSumDocFreq.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestSumDocFreq.java?rev=1158472&r1=1158471&r2=1158472&view=diff
==============================================================================
--- lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestSumDocFreq.java (original)
+++ lucene/dev/branches/fieldtype_conflicted/lucene/src/test/org/apache/lucene/index/TestSumDocFreq.java Tue Aug 16 23:21:21 2011
@@ -20,6 +20,7 @@ package org.apache.lucene.index;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
+import org.apache.lucene.document.TextField;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util._TestUtil;
@@ -37,8 +38,8 @@ public class TestSumDocFreq extends Luce
RandomIndexWriter writer = new RandomIndexWriter(random, dir);
Document doc = new Document();
- Field field1 = newField("foo", "", Field.Index.ANALYZED);
- Field field2 = newField("bar", "", Field.Index.ANALYZED);
+ Field field1 = newField("foo", "", TextField.TYPE_UNSTORED);
+ Field field2 = newField("bar", "", TextField.TYPE_UNSTORED);
doc.add(field1);
doc.add(field2);
for (int i = 0; i < numDocs; i++) {
Modified: lucene/dev/branches/fieldtype_conflicted/modules/grouping/src/java/org/apache/lucene/search/grouping/package.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/fieldtype_conflicted/modules/grouping/src/java/org/apache/lucene/search/grouping/package.html?rev=1158472&r1=1158471&r2=1158472&view=diff
==============================================================================
--- lucene/dev/branches/fieldtype_conflicted/modules/grouping/src/java/org/apache/lucene/search/grouping/package.html (original)
+++ lucene/dev/branches/fieldtype_conflicted/modules/grouping/src/java/org/apache/lucene/search/grouping/package.html Tue Aug 16 23:21:21 2011
@@ -130,7 +130,7 @@ field fall into a single group.</p>
List<Document> oneGroup = ...;
Field groupEndField = new Field("groupEnd", "x", Field.Store.NO, Field.Index.NOT_ANALYZED);
- groupEndField.setOmitTermFreqAndPositions(true);
+ groupEndField.setIndexOptions(IndexOptions.DOCS_ONLY);
groupEndField.setOmitNorms(true);
oneGroup.get(oneGroup.size()-1).add(groupEndField);