From lucene-user-return-4978-qmlist-jakarta-archive-lucene-user=nagoya.apache.org@jakarta.apache.org Thu Jul 10 18:38:20 2003 Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 3733 invoked from network); 10 Jul 2003 18:38:19 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 10 Jul 2003 18:38:19 -0000 Received: (qmail 17508 invoked by uid 97); 10 Jul 2003 18:40:51 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 17501 invoked from network); 10 Jul 2003 18:40:51 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 10 Jul 2003 18:40:51 -0000 Received: (qmail 3428 invoked by uid 500); 10 Jul 2003 18:38:16 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 3330 invoked from network); 10 Jul 2003 18:38:14 -0000 Received: from mail.disney.com (204.128.192.15) by daedalus.apache.org with SMTP; 10 Jul 2003 18:38:14 -0000 Received: from Hermes10.corp.disney.com (hermes10.corp.disney.com [153.7.110.102]) by mail.disney.com (Switch-2.2.6/Switch-2.2.4) with ESMTP id h6AIbc916119 for ; Thu, 10 Jul 2003 11:37:38 -0700 (PDT) Received: from sm-cala-xc07.swna.wdpr.disney.com by hermes.corp.disney.com with ESMTP; Thu, 10 Jul 2003 11:38:29 -0700 Received: from sm-cala-xm11.swna.wdpr.disney.com ([153.7.195.53]) by sm-cala-xc07.swna.wdpr.disney.com with Microsoft SMTPSVC(5.0.2195.5329); Thu, 10 Jul 2003 11:38:17 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Getting back a Date object? Date: Thu, 10 Jul 2003 11:38:17 -0700 Message-Id: <496A2C679221504D8B8AE4B10267E876019D7A65@gb-sm-cala-xm11.corp.disney.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Getting back a Date object? Thread-Index: AcNEAIG0ckjiEIh4S+iewXwAyCJcIwDEW4+w From: "Wilton, Reece" To: "Lucene Users List" X-OriginalArrivalTime: 10 Jul 2003 18:38:17.0805 (UTC) FILETIME=[6E1047D0:01C34712] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, There is a Field.Keyword factory method that takes a date. I'm using it like this: searchDoc.add(Field.Keyword("TIMESTAMP", new Date())); The JavaDoc for this method says it is stored in the index, for return with hits. So how do I get it out of the Hits? The only thing I can see is getting a String or a Field from Hits. And Field only allows you to get a String from it. Should I be using the readerValue() for this? Any help is appreciated! Reece -----Original Message----- From: Francesco Bellomi [mailto:fbellomi@libero.it]=20 Sent: Sunday, July 06, 2003 1:50 PM To: Lucene Users List Subject: Directory implementation using NIO Hi, I developed a Directory implementation that accesses an index stored on the filesystem using memory-mapped files (as provided by the NIO API, introduced in Java 1.4). You can download the complied jar and the source from here: www.fran.it/lucene-NIO.zip Basically there are 3 new classes: NIODirectory, NIOInputStream and NIOOutputStream. They are heavily based on FSDirectory, FSInputStream and FSOutputStream. NIOInputStram provides memory-mapped access to files. It does not rely on Lucene InputStream's caching feature, since direct access to the memory-mapped file should be faster. Also, cloned stream with independent positions are implemented using NIO buffer duplication (a buffer duplicate holds the same content but has its own position), and so the implementation logic is much simpler than FSInputStream's. Some methods of Directory have been overridden to replace the caching feature. Some of then were final in Directory, so I have used a slightly modified version of Directory.java (BTW, I wonder why so many methods in Lucene are made final...) These classes only works with the recently released Java 1.4.2. This is due to the fact that buffers connected with memory-mapped files could not be programmatically unmapped in previous releases, (they were unmapped only through finalization) and actively mapped files cannot be deleted. These issue are partially resolved with 1.4.2. NIOOutputStream is the same as FSOutputStream; I don't know any way to take advantege of NIO for writing indexes (memory mapped buffers have a static size, so they are not useful if your file is growing). I don't have a benchmarking suite for Lucene, so I can't accurately evaluate the speed of this implementation. I tested it on a small application I am developing and it seems to work well, but I think my test are not significative. Of course only the searching feature is expected to be faster, since the index writing is unchanged. Francesco - Francesco Bellomi "Use truth to show illusion, and illusion to show truth." --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org