Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@www.apache.org Received: (qmail 33648 invoked from network); 1 Sep 2004 22:28:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Sep 2004 22:28:36 -0000 Received: (qmail 20939 invoked by uid 500); 1 Sep 2004 22:27:49 -0000 Delivered-To: apmail-jakarta-lucene-dev-archive@jakarta.apache.org Received: (qmail 20796 invoked by uid 500); 1 Sep 2004 22:27:48 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 20614 invoked by uid 500); 1 Sep 2004 22:27:47 -0000 Received: (qmail 20591 invoked by uid 99); 1 Sep 2004 22:27:46 -0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 01 Sep 2004 15:27:46 -0700 Received: (qmail 33196 invoked by uid 1912); 1 Sep 2004 22:27:44 -0000 Date: 1 Sep 2004 22:27:44 -0000 Message-ID: <20040901222744.33195.qmail@minotaur.apache.org> From: dnaber@apache.org To: jakarta-lucene-cvs@apache.org Subject: cvs commit: jakarta-lucene/src/demo/org/apache/lucene/demo HTMLDocument.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N dnaber 2004/09/01 15:27:44 Modified: src/demo/org/apache/lucene/demo HTMLDocument.java Log: start using the non-deprecated API Revision Changes Path 1.5 +16 -17 jakarta-lucene/src/demo/org/apache/lucene/demo/HTMLDocument.java Index: HTMLDocument.java =================================================================== RCS file: /home/cvs/jakarta-lucene/src/demo/org/apache/lucene/demo/HTMLDocument.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- HTMLDocument.java 6 Aug 2004 19:26:16 -0000 1.4 +++ HTMLDocument.java 1 Sep 2004 22:27:44 -0000 1.5 @@ -45,21 +45,21 @@ // make a new, empty document Document doc = new Document(); - // Add the url as a field named "path". Use a Keyword field, so - // that it's searchable, but so that no attempt is made - // to tokenize the field into words. - doc.add(Field.Keyword("path", f.getPath().replace(dirSep, '/'))); + // Add the url as a field named "path". Use a field that is + // indexed (i.e. searchable), but don't tokenize the field into words. + doc.add(new Field("path", f.getPath().replace(dirSep, '/'), Field.Store.YES, + Field.Index.UN_TOKENIZED)); - // Add the last modified date of the file a field named "modified". Use a - // Keyword field, so that it's searchable, but so that no attempt is made - // to tokenize the field into words. - doc.add(Field.Keyword("modified", - DateField.timeToString(f.lastModified()))); + // Add the last modified date of the file a field named "modified". + // Use a field that is indexed (i.e. searchable), but don't tokenize + // the field into words. + doc.add(new Field("modified", DateField.timeToString(f.lastModified()), + Field.Store.YES, Field.Index.UN_TOKENIZED)); // Add the uid as a field, so that index can be incrementally maintained. // This field is not stored with document, it is indexed, but it is not // tokenized prior to indexing. - doc.add(new Field("uid", uid(f), false, true, false)); + doc.add(new Field("uid", uid(f), Field.Store.NO, Field.Index.UN_TOKENIZED)); FileInputStream fis = null; try { @@ -68,15 +68,14 @@ // Add the tag-stripped contents as a Reader-valued Text field so it will // get tokenized and indexed. - doc.add(Field.Text("contents", parser.getReader())); + doc.add(new Field("contents", parser.getReader())); - // Add the summary as an UnIndexed field, so that it is stored and returned - // with hit documents for display. - doc.add(Field.UnIndexed("summary", parser.getSummary())); + // Add the summary as a field that is stored and returned with + // hit documents for display. + doc.add(new Field("summary", parser.getSummary(), Field.Store.YES, Field.Index.NO)); - // Add the title as a separate Text field, so that it can be searched - // separately. - doc.add(Field.Text("title", parser.getTitle())); + // Add the title as a field that it can be searched and that is stored. + doc.add(new Field("title", parser.getTitle(), Field.Store.YES, Field.Index.TOKENIZED)); } finally { if (fis != null) fis.close(); --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-dev-help@jakarta.apache.org