Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 50646 invoked from network); 8 Apr 2002 14:07:57 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 8 Apr 2002 14:07:57 -0000 Received: (qmail 14640 invoked by uid 97); 8 Apr 2002 14:07:57 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 14604 invoked by uid 97); 8 Apr 2002 14:07:57 -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 14589 invoked from network); 8 Apr 2002 14:07:56 -0000 Message-Id: <818623B5FD23D51193200002B32C076103A1555E@excsrv44.mayo.edu> From: "Armbrust, Daniel C." To: 'Lucene Users List' Subject: RE: Newbie Questions Date: Mon, 8 Apr 2002 09:07:18 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N The way that we have done this (and this isn't necessarily the best way, it was just the solution we came up with) is that we store all dates and numbers as strings, but formatted in such a way that when they are alphabetized, they will be in the right order. The Lucene Date Filtering mechanism was useless to us, because it doesn't allow dates before 1970. We stored all of our dates as strings in a format of year month day, this way they sorted in the proper order. Then you can write your own datefilter, which is basically a cut and paste from lucenes date filter. We also had an age field, and to make it sort properly, we had to prefix all of the ages, like 003 050 101 This way they sort properly, and you can write an age filter (again a cut and paste from date filter) that will let you search for ages > 50. Oh, and to apply more than one filter at a time (the way we did it) you will need the Chainable Filter class, which I think is now on the contributions page, but was also in the mailing archives in the last 2 weeks. Dan -----Original Message----- From: Chris Withers [mailto:chrisw@nipltd.com] Sent: Sunday, April 07, 2002 4:55 AM To: lucene-user@jakarta.apache.org Subject: Newbie Questions Hi there, I'm new to Lucene and have what will hopefully be a couple of simple questions. 1. Can I index numbers with Lucene? If so, ints or floats or ? 2. Can I index dates with Lucene? In either case, is there any way I can sort the results returned by a search on these fields? Also, can I search for only documents which have been indexed with a range in one of these fields? For example: I only want documents where the 'cost' field is between 1000 and 2000 and where the date of manufacture was prior to 13th June 1978. cheers, Chris -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: