You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by dn...@apache.org on 2004/08/30 22:52:16 UTC
cvs commit: jakarta-lucene/src/test/org/apache/lucene/search TestSort.java TestPhraseQuery.java
dnaber 2004/08/30 13:52:16
Modified: src/test/org/apache/lucene/search TestSort.java
TestPhraseQuery.java
Log:
stop using the deprecated Field constructor
Revision Changes Path
1.8 +8 -8 jakarta-lucene/src/test/org/apache/lucene/search/TestSort.java
Index: TestSort.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestSort.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TestSort.java 24 May 2004 22:51:42 -0000 1.7
+++ TestSort.java 30 Aug 2004 20:52:15 -0000 1.8
@@ -113,13 +113,13 @@
IndexWriter writer = new IndexWriter (indexStore, new SimpleAnalyzer(), true);
for (int i=0; i<data.length; ++i) {
if (((i%2)==0 && even) || ((i%2)==1 && odd)) {
- Document doc = new Document(); // store, index, token
- doc.add (new Field ("tracer", data[i][0], true, false, false));
- doc.add (new Field ("contents", data[i][1], false, true, true));
- if (data[i][2] != null) doc.add (new Field ("int", data[i][2], false, true, false));
- if (data[i][3] != null) doc.add (new Field ("float", data[i][3], false, true, false));
- if (data[i][4] != null) doc.add (new Field ("string", data[i][4], false, true, false));
- if (data[i][5] != null) doc.add (new Field ("custom", data[i][5], false, true, false));
+ Document doc = new Document();
+ doc.add (new Field ("tracer", data[i][0], Field.Store.YES, Field.Index.NO));
+ doc.add (new Field ("contents", data[i][1], Field.Store.NO, Field.Index.TOKENIZED));
+ if (data[i][2] != null) doc.add (new Field ("int", data[i][2], Field.Store.NO, Field.Index.UN_TOKENIZED));
+ if (data[i][3] != null) doc.add (new Field ("float", data[i][3], Field.Store.NO, Field.Index.UN_TOKENIZED));
+ if (data[i][4] != null) doc.add (new Field ("string", data[i][4], Field.Store.NO, Field.Index.UN_TOKENIZED));
+ if (data[i][5] != null) doc.add (new Field ("custom", data[i][5], Field.Store.NO, Field.Index.UN_TOKENIZED));
writer.addDocument (doc);
}
}
1.8 +6 -6 jakarta-lucene/src/test/org/apache/lucene/search/TestPhraseQuery.java
Index: TestPhraseQuery.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestPhraseQuery.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TestPhraseQuery.java 27 Aug 2004 21:59:31 -0000 1.7
+++ TestPhraseQuery.java 30 Aug 2004 20:52:15 -0000 1.8
@@ -183,12 +183,12 @@
IndexWriter writer = new IndexWriter(directory, new WhitespaceAnalyzer(), true);
Document doc = new Document();
- doc.add(new Field("source", "marketing info", true, true, true));
+ doc.add(new Field("source", "marketing info", Field.Store.YES, Field.Index.TOKENIZED));
writer.addDocument(doc);
doc = new Document();
- doc.add(new Field("contents", "foobar", true, true, true));
- doc.add(new Field("source", "marketing info", true, true, true));
+ doc.add(new Field("contents", "foobar", Field.Store.YES, Field.Index.TOKENIZED));
+ doc.add(new Field("source", "marketing info", Field.Store.YES, Field.Index.TOKENIZED));
writer.addDocument(doc);
writer.optimize();
@@ -213,15 +213,15 @@
writer = new IndexWriter(directory, new WhitespaceAnalyzer(), true);
doc = new Document();
- doc.add(new Field("contents", "map entry woo", true, true, true));
+ doc.add(new Field("contents", "map entry woo", Field.Store.YES, Field.Index.TOKENIZED));
writer.addDocument(doc);
doc = new Document();
- doc.add(new Field("contents", "woo map entry", true, true, true));
+ doc.add(new Field("contents", "woo map entry", Field.Store.YES, Field.Index.TOKENIZED));
writer.addDocument(doc);
doc = new Document();
- doc.add(new Field("contents", "map foobarword entry woo", true, true, true));
+ doc.add(new Field("contents", "map foobarword entry woo", Field.Store.YES, Field.Index.TOKENIZED));
writer.addDocument(doc);
writer.optimize();
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org